/*******************************************************************************
- * Copyright (c) 2010 Ericsson
+ * Copyright (c) 2010, 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
private ITmfTrace fTrace;
private Composite fParent;
private ListenerList fSelectionChangedListeners = new ListenerList();
+ private boolean fTraceSelected;
@Override
public void doSave(final IProgressMonitor monitor) {
int cacheSize = Integer.MAX_VALUE;
final ITmfTrace[] traces = new ITmfTrace[nbTraces];
for (int i = 0; i < nbTraces; i++) {
- final TmfTraceElement traceElement = traceEntries.get(i);
+ final TmfTraceElement traceElement = traceEntries.get(i).getElementUnderTraceFolder();
final ITmfTrace trace = traceElement.instantiateTrace();
final ITmfEvent traceEvent = traceElement.instantiateEvent();
if ((trace == null) || (traceEvent == null)) {
cacheSize = Math.min(cacheSize, trace.getCacheSize());
traces[i] = trace;
}
- final TmfExperiment experiment = new TmfExperiment(ITmfEvent.class, experimentElement.getName(), traces, cacheSize);
+ final TmfExperiment experiment = new TmfExperiment(ITmfEvent.class, experimentElement.getName(), traces, cacheSize, experimentElement.getResource());
experiment.setBookmarksFile(fFile);
fTrace = experiment;
break;
@Override
public void partActivated(IWorkbenchPart part) {
if (part == this && fTrace != null) {
+ if (fTraceSelected) {
+ return;
+ }
+ fTraceSelected = true;
broadcast(new TmfTraceSelectedSignal(this, fTrace));
}
}
*/
@Override
public void partBroughtToTop(IWorkbenchPart part) {
+ if (part == this && fTrace != null) {
+ if (fTraceSelected) {
+ return;
+ }
+ fTraceSelected = true;
+ broadcast(new TmfTraceSelectedSignal(this, fTrace));
+ }
}
/*
*/
@TmfSignalHandler
public void traceSelected(final TmfTraceSelectedSignal signal) {
- if ((signal.getSource() != this) && signal.getTrace().equals(fTrace)) {
- getSite().getPage().bringToTop(this);
+ if ((signal.getSource() != this)) {
+ if (signal.getTrace().equals(fTrace)) {
+ getSite().getPage().bringToTop(this);
+ } else {
+ fTraceSelected = false;
+ }
}
}