/*******************************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
package org.eclipse.linuxtools.internal.tmf.ui.project.model;
import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
// If trace is under an experiment, use the original trace from the traces folder
traceElement = traceElement.getElementUnderTraceFolder();
-
- // Get the editor resource
- final IResource resource = traceElement.getResource();
- if (resource instanceof IFile) {
- file = (IFile) resource;
- } else if (resource instanceof IFolder) {
- file = ((IFolder) resource).getFile(traceElement.getName() + '_');
- }
+ file = traceElement.getBookmarksFile();
} else if ((aSelection.getFirstElement() instanceof TmfExperimentElement)) {
TmfExperimentElement experimentElement = (TmfExperimentElement) aSelection.getFirstElement();
- file = experimentElement.getResource().getFile(experimentElement.getName() + '_');
+ file = experimentElement.getBookmarksFile();
}
if (file != null) {
IEditorPart localEditor = aPage.findEditor(tmpInput);
if (localEditor != null) {
// Editor found.
- aPage.activate(localEditor);
aPage.bringToTop(localEditor);
} else {
// Search in references for corresponding editor