fTable.refresh();\r
packColumns();\r
}\r
-// fTrace.seekEvent(fSelectedRank);\r
+ populateCompleted();\r
}\r
});\r
}\r
job.setPriority(Job.SHORT);\r
job.schedule();\r
}\r
- \r
+\r
+ protected void populateCompleted() {\r
+ // Nothing by default;\r
+ }\r
+\r
// ------------------------------------------------------------------------\r
// Bookmark handling\r
// ------------------------------------------------------------------------\r
import org.eclipse.linuxtools.tmf.event.TmfEvent;
import org.eclipse.linuxtools.tmf.experiment.TmfExperiment;
+import org.eclipse.linuxtools.tmf.signal.TmfExperimentDisposedSignal;
import org.eclipse.linuxtools.tmf.signal.TmfExperimentSelectedSignal;
import org.eclipse.linuxtools.tmf.signal.TmfSignalHandler;
+import org.eclipse.linuxtools.tmf.ui.TmfUiPlugin;
import org.eclipse.linuxtools.tmf.ui.viewers.events.TmfEventsTable;
import org.eclipse.swt.widgets.Composite;
@TmfSignalHandler
public void experimentSelected(TmfExperimentSelectedSignal<TmfEvent> signal) {
// Update the trace reference
- fExperiment = (TmfExperiment<TmfEvent>) signal.getExperiment();
- setPartName(fTitlePrefix + " - " + fExperiment.getName()); //$NON-NLS-1$
-
- if (fEventsTable != null) {
- fEventsTable.setTrace(fExperiment, false);
+ TmfExperiment<TmfEvent> exp = (TmfExperiment<TmfEvent>) signal.getExperiment();
+ if (!exp.equals(fExperiment)) {
+ fExperiment = exp;
+ setPartName(fTitlePrefix + " - " + fExperiment.getName()); //$NON-NLS-1$
+ if (fEventsTable != null) {
+ fEventsTable.setTrace(fExperiment, false);
+ }
}
}
+ @SuppressWarnings("unchecked")
+ @TmfSignalHandler
+ public void experimentDisposed(TmfExperimentDisposedSignal<TmfEvent> signal) {
+ // Clear the trace reference
+ TmfExperiment<TmfEvent> experiment = (TmfExperiment<TmfEvent>) signal.getExperiment();
+ if (experiment.equals(fExperiment)) {
+ fEventsTable.setTrace(null, false);
+ }
+
+ TmfUiPlugin.getDefault().getWorkbench().getWorkbenchWindows()[0].getShell().getDisplay().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ setPartName(fTitlePrefix);
+ }
+ });
+ }
+
}
\ No newline at end of file
import org.eclipse.linuxtools.tmf.request.ITmfEventRequest;
import org.eclipse.linuxtools.tmf.request.TmfDataRequest;
import org.eclipse.linuxtools.tmf.request.TmfEventRequest;
+import org.eclipse.linuxtools.tmf.signal.TmfExperimentDisposedSignal;
import org.eclipse.linuxtools.tmf.signal.TmfExperimentSelectedSignal;
import org.eclipse.linuxtools.tmf.signal.TmfExperimentUpdatedSignal;
import org.eclipse.linuxtools.tmf.signal.TmfSignalHandler;
*/
@Override
public synchronized void dispose() {
+
+ TmfExperimentDisposedSignal<T> signal = new TmfExperimentDisposedSignal<T>(this, this);
+ broadcast(signal);
+
if (fTraces != null) {
for (ITmfTrace trace : fTraces) {
trace.dispose();
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.tmf.signal;
+
+import org.eclipse.linuxtools.tmf.event.TmfEvent;
+import org.eclipse.linuxtools.tmf.experiment.TmfExperiment;
+
+/**
+ * <b><u>TmfExperimentDisposedSignal</u></b>
+ * <p>
+ * TODO: Implement me. Please.
+ */
+public class TmfExperimentDisposedSignal<T extends TmfEvent> extends TmfSignal {
+
+ private final TmfExperiment<T> fExperiment;
+
+ public TmfExperimentDisposedSignal(Object source, TmfExperiment<T> experiment) {
+ super(source);
+ fExperiment = experiment;
+ }
+
+ public TmfExperiment<? extends TmfEvent> getExperiment() {
+ return fExperiment;
+ }
+
+ @Override
+ @SuppressWarnings("nls")
+ public String toString() {
+ return "[TmfExperimentDisposedSignal (" + fExperiment.getName() + ")]";
+ }
+}
package org.eclipse.linuxtools.tmf.trace;
-import java.io.File;
import java.io.FileNotFoundException;
import java.util.Collections;
import java.util.Vector;
*/
protected TmfTrace(String name, Class<T> type, String path, int cacheSize, boolean indexTrace) throws FileNotFoundException {
super(name, type);
- int sep = path.lastIndexOf(File.separator);
- String simpleName = (sep >= 0) ? path.substring(sep + 1) : path;
- setName(simpleName);
+// if (path != null) {
+// int sep = path.lastIndexOf(File.separator);
+// String simpleName = (sep >= 0) ? path.substring(sep + 1) : path;
+// setName(simpleName);
+// }
fPath = path;
fIndexPageSize = (cacheSize > 0) ? cacheSize : DEFAULT_INDEX_PAGE_SIZE;
if (indexTrace) {
* event).
*/
- @SuppressWarnings({ "unchecked", "unused" })
+ @SuppressWarnings({ "unchecked" })
private void indexTrace(boolean waitForCompletion) {
final Job job = new Job("Indexing " + getName() + "...") { //$NON-NLS-1$ //$NON-NLS-2$