/*******************************************************************************
* Copyright (c) 2009, 2010, 2011 Ericsson
- *
+ *
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
* accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Francois Chouinard - Initial API and implementation
*******************************************************************************/
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
import org.eclipse.linuxtools.tmf.core.experiment.TmfExperiment;
import org.eclipse.linuxtools.tmf.core.signal.TmfExperimentSelectedSignal;
// Check if we are closing down
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window == null)
+ if (window == null) {
return false;
+ }
// Get the selection
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IWorkbenchPart part = page.getActivePart();
ISelectionProvider selectionProvider = part.getSite().getSelectionProvider();
- if (selectionProvider == null)
+ if (selectionProvider == null) {
return false;
+ }
ISelection selection = selectionProvider.getSelection();
// Make sure there is only one selection and that it is an experiment
// Check if we are closing down
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window == null)
+ if (window == null) {
return false;
+ }
try {
IFile bookmarksFile = fExperiment.getProject().getExperimentsFolder().getResource().getFile(BOOKMARKS_HIDDEN_FILE);
for (int i = 0; i < nbTraces; i++) {
TmfTraceElement element = traceEntries.get(i);
ITmfTrace trace = element.instantiateTrace();
- TmfEvent traceEvent = element.instantiateEvent();
- if (trace == null || traceEvent == null) {
+ ITmfEvent traceEvent = element.instantiateEvent();
+ if ((trace == null) || (traceEvent == null)) {
displayErrorMsg(Messages.OpenExperimentHandler_NoTraceType);
for (int j = 0; j < i; j++) {
traces[j].dispose();
return null;
}
try {
- trace.initTrace(element.getName(), element.getLocation().getPath(), traceEvent.getClass(), 0);
+ trace.initTrace(element.getName(), element.getLocation().getPath(), traceEvent.getClass());
} catch (FileNotFoundException e) {
displayErrorMsg(""); //$NON-NLS-1$
}
trace.setResource(element.getResource());
- cacheSize = Math.min(cacheSize, trace.getCacheSize());
+ cacheSize = Math.min(cacheSize, trace.getIndexPageSize());
String editorId = element.getEditorId();
if (editorId == null) {
useEditor = false;
IEditorInput editorInput = new TmfEditorInput(file, experiment);
IWorkbench wb = PlatformUI.getWorkbench();
IWorkbenchPage activePage = wb.getActiveWorkbenchWindow().getActivePage();
-
+
String editorId = TmfEventsEditor.ID;
IEditorPart editor = activePage.findEditor(new FileEditorInput(file));
- if (editor != null && editor instanceof IReusableEditor) {
+ if ((editor != null) && (editor instanceof IReusableEditor)) {
activePage.reuseEditor((IReusableEditor) editor, editorInput);
activePage.activate(editor);
} else {
activePage.openEditor(editorInput, editorId);
}
- experiment.initTrace(null, null, null, 0);
+ experiment.initTrace(null, null, null);
experiment.indexTrace(true);
IDE.setDefaultEditor(file, editorId);
// editor should dispose the experiment on close