import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
import org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal;
+import org.eclipse.tracecompass.tmf.core.signal.TmfSignal;
import org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler;
import org.eclipse.tracecompass.tmf.core.signal.TmfSignalManager;
import org.eclipse.tracecompass.tmf.core.signal.TmfTraceSelectedSignal;
import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
+import org.eclipse.tracecompass.tmf.core.trace.experiment.TmfExperiment;
import org.eclipse.tracecompass.tmf.core.util.Pair;
import org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractStateSystemTimeGraphView;
import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ILinkEvent;
private static final String BIRTH_TIME_COLUMN = Messages.ControlFlowView_birthTimeColumn;
private static final String INVISIBLE_COLUMN = Messages.ControlFlowView_invisibleColumn;
private Action fOptimizationAction;
+ private String fOriginalTabLabel;
private static final String NEXT_EVENT_ICON_PATH = "icons/elcl16/shift_r_edit.gif"; //$NON-NLS-1$
private static final String PREV_EVENT_ICON_PATH = "icons/elcl16/shift_l_edit.gif"; //$NON-NLS-1$
private MenuManager fThreadPresentationMenu;
private IAction fFlatAction;
-
private IAction fHierarchicalAction;
private IAction fPreviousEventAction;
private IAction fNextEventAction;
+ /** Pin related toggle switch */
+ private boolean fShowFollowThreadAction = true;
+
// ------------------------------------------------------------------------
// Constructors
// ------------------------------------------------------------------------
// add "Uncheck inactive" Button to TimeGraphFilterDialog
super.getTimeGraphCombo().addTimeGraphFilterUncheckInactiveButton(
new ControlFlowCheckActiveProvider(Messages.ControlFlowView_uncheckInactiveLabel, Messages.ControlFlowView_uncheckInactiveToolTip));
+ fOriginalTabLabel = getPartName();
}
/**
StructuredSelection sSel = (StructuredSelection) selection;
if (sSel.getFirstElement() instanceof ControlFlowEntry) {
ControlFlowEntry entry = (ControlFlowEntry) sSel.getFirstElement();
- menuManager.add(new FollowThreadAction(ControlFlowView.this, entry.getName(), entry.getThreadId(), entry.getTrace()));
+ if (fShowFollowThreadAction) {
+ menuManager.add(new FollowThreadAction(ControlFlowView.this, entry.getName(), entry.getThreadId(), entry.getTrace()));
+ }
}
}
}
@Override
protected boolean canBePinned() {
- //TODO: actionPin is not defined
- return false;
+ return true;
}
+ @Override
+ protected synchronized void setPinned(boolean pinned) {
+
+ /* Is pinned */
+ if (pinned) {
+ /* Ignore all outbound and inbound signal */
+ TmfSignalManager.addIgnoredOutboundSignal(this, TmfSignal.class);
+ TmfSignalManager.addIgnoredInboundSignal(this, TmfSignal.class);
+
+ String objectType = Messages.ControlFlowView_TraceLabel;
+ if (getTrace() instanceof TmfExperiment) {
+ objectType = Messages.ControlFlowView_ExperimentLabel;
+ }
+ setPartName(String.format("%s [%s][%s:%s]", fOriginalTabLabel, Messages.ControlFlowView_PinnedLabel, objectType, getTrace().getName())); //$NON-NLS-1$
+ } else {
+ TmfSignalManager.clearIgnoredInboundSignalList(this);
+ TmfSignalManager.clearIgnoredOutboundSignalList(this);
+
+ setPartName(fOriginalTabLabel);
+
+ loadTrace(TmfTraceManager.getInstance().getActiveTrace());
+ }
+
+ boolean enabled = !pinned;
+
+ fFlatAction.setEnabled(enabled);
+ fHierarchicalAction.setEnabled(enabled);
+ fOptimizationAction.setEnabled(enabled);
+ fPreviousEventAction.setEnabled(enabled);
+ fNextEventAction.setEnabled(enabled);
+ fThreadPresentationMenu.setVisible(enabled);
+ fThreadPresentationMenu.markDirty();
+
+ fShowFollowThreadAction = enabled;
+
+ /* Propagate pin state to viewer */
+ if (getTimeGraphCombo() != null) {
+ getTimeGraphCombo().setPinned(pinned);
+ } else {
+ getTimeGraphViewer().setPinned(pinned);
+ }
+
+ redraw();
+ }
}