doc: TmfView pin feature
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 8 Nov 2016 21:10:32 +0000 (16:10 -0500)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Fri, 11 Nov 2016 15:36:07 +0000 (10:36 -0500)
Change-Id: I9a29b1ee928b6857ebbaf46c890b72b4e82ac260
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
doc/org.eclipse.tracecompass.doc.dev/doc/Developer-Guide.mediawiki
doc/org.eclipse.tracecompass.doc.dev/doc/images/TmfViewPinAction.png [new file with mode: 0644]
doc/org.eclipse.tracecompass.doc.user/doc/User-Guide.mediawiki
doc/org.eclipse.tracecompass.doc.user/doc/images/pin_view.gif [new file with mode: 0644]

index 1054562653b56abde45eebd1555348dc9e015d98..0a5b6a5caf01624093789305a4a653e9bbbe69d6 100644 (file)
@@ -322,6 +322,7 @@ This tutorial will cover concepts like:
 * Signal handling (@TmfSignalHandler)
 * Data requests (TmfEventRequest)
 * SWTChart integration
+* Use of the pin feature
 
 '''Note''': Trace Compass 0.1.0 provides base implementations for generating SWTChart viewers and views. For more details please refer to chapter [[#TMF Built-in Views and Viewers]].
 
@@ -656,6 +657,78 @@ The view is now ready but we need a proper trace to test it. For this example, a
 
 In summary, we have implemented a simple TMF view using the SWTChart library. We made use of signals and requests to populate the view at the appropriate time and we formated the time stamps nicely. We also made sure that the time stamp format is updated when the preferences change.
 
+==== Pin feature ====
+
+The pin feature allow freezing a view. How it freezes is up to the view itself. Normally a pinned view
+will not synchronize on active trace changes, visual time range changes, selection time changes, marker updates etc.
+
+By default TmfView provides a pin button in its toolbar.<br>
+[[Image:images/TmfViewPinAction.png]]<br>
+
+By default nothing is done on button click, <code>setPinned</code> needs to be overridden to take action on user interaction. It is the view's responsibility to propagate the pinned state to its children (controls, scroll bars, etc.).
+
+e.g. <code>setPinned</code> from ControlFlowView:
+<pre>
+    @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();
+    }
+
+</pre>
+
+==== Disabling the pin feature ====
+
+If one wishes to disable the pin feature the <code>canBePinned</code> method can be overridden to return false. By default this function returns <code>True</code>.
+
+e.g.:
+
+<pre>
+    @Override
+    protected boolean canBePinned() {
+        return false;
+    }
+</pre>
+
 == TMF Built-in Views and Viewers ==
 
 TMF provides base implementations for several types of views and viewers for generating custom X-Y-Charts, Time Graphs, or Trees. They are well integrated with various TMF features such as reading traces and time synchronization with other views. They also handle mouse events for navigating the trace and view, zooming or presenting detailed information at mouse position. The code can be found in the TMF UI plug-in ''org.eclipse.tracecompass.tmf.ui''. See below for a list of relevant java packages:
diff --git a/doc/org.eclipse.tracecompass.doc.dev/doc/images/TmfViewPinAction.png b/doc/org.eclipse.tracecompass.doc.dev/doc/images/TmfViewPinAction.png
new file mode 100644 (file)
index 0000000..992b472
Binary files /dev/null and b/doc/org.eclipse.tracecompass.doc.dev/doc/images/TmfViewPinAction.png differ
index f9f51ed37e7398005d07747a345621c0bdeccee7..6e89f4121aaa1907faee2bfd83b14f1abb2aa8dd 100644 (file)
@@ -1975,6 +1975,10 @@ The tooltip indicates:
 The Control Flow View '''toolbar''', located at the top right of the view, has shortcut buttons to perform common actions:
 
 {|
+| [[Image:images/pin_view.gif]]
+| Pin view
+| Pin and unpin a view. A pinned Control Flow view is frozen in time and associated with the trace selected at the time of pinning. When the unpin button is clicked the view synchronizes back with the current state (trace, visible time range, time range selection, etc.).
+|-
 | [[Image:images/link.gif]]
 | Align Views
 | Disable and enable the automatic time axis alignment of time-based views. Disabling the alignment in this view will disable this feature across all the views because it's a workspace preference.
@@ -2125,6 +2129,10 @@ See Control Flow View's '''[[#Incomplete_regions | Incomplete regions]]'''.
 The Resources View '''toolbar''', located at the top right of the view, has shortcut buttons to perform common actions:
 
 {|
+| [[Image:images/pin_view.gif]]
+| Pin view
+| Pin and unpin a view. A pinned Resources view is frozen in time and associated with the trace selected at the time of pinning. When the unpin button is clicked the view synchronizes back with the current state (trace, visible time range, time range selection, etc.).
+|-
 | [[Image:images/link.gif]]
 | Align Views
 | Disable and enable the automatic time axis alignment of time-based views. Disabling the alignment in this view will disable this feature across all the views because it's a workspace preference.
diff --git a/doc/org.eclipse.tracecompass.doc.user/doc/images/pin_view.gif b/doc/org.eclipse.tracecompass.doc.user/doc/images/pin_view.gif
new file mode 100644 (file)
index 0000000..ec50b70
Binary files /dev/null and b/doc/org.eclipse.tracecompass.doc.user/doc/images/pin_view.gif differ
This page took 0.028 seconds and 5 git commands to generate.