1 /*******************************************************************************
2 * Copyright (c) 2012, 2013 Ericsson, École Polytechnique de Montréal
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Patrick Tasse - Initial API and implementation
11 * Bernd Hufmann - Updated signal handling
12 * Geneviève Bastien - Move code to provide base classes for time graph view
13 * Marc-Andre Laperle - Add time zone preference
14 * Geneviève Bastien - Add event links between entries
15 *******************************************************************************/
17 package org
.eclipse
.linuxtools
.tmf
.ui
.views
.timegraph
;
19 import java
.util
.ArrayList
;
20 import java
.util
.Arrays
;
21 import java
.util
.Collections
;
22 import java
.util
.Comparator
;
23 import java
.util
.HashMap
;
24 import java
.util
.List
;
27 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
28 import org
.eclipse
.core
.runtime
.NullProgressMonitor
;
29 import org
.eclipse
.jface
.action
.Action
;
30 import org
.eclipse
.jface
.action
.IStatusLineManager
;
31 import org
.eclipse
.jface
.action
.IToolBarManager
;
32 import org
.eclipse
.jface
.action
.Separator
;
33 import org
.eclipse
.jface
.viewers
.ILabelProviderListener
;
34 import org
.eclipse
.jface
.viewers
.ITableLabelProvider
;
35 import org
.eclipse
.jface
.viewers
.ITreeContentProvider
;
36 import org
.eclipse
.jface
.viewers
.Viewer
;
37 import org
.eclipse
.linuxtools
.tmf
.core
.signal
.TmfRangeSynchSignal
;
38 import org
.eclipse
.linuxtools
.tmf
.core
.signal
.TmfSignalHandler
;
39 import org
.eclipse
.linuxtools
.tmf
.core
.signal
.TmfTimeSynchSignal
;
40 import org
.eclipse
.linuxtools
.tmf
.core
.signal
.TmfTimestampFormatUpdateSignal
;
41 import org
.eclipse
.linuxtools
.tmf
.core
.signal
.TmfTraceClosedSignal
;
42 import org
.eclipse
.linuxtools
.tmf
.core
.signal
.TmfTraceOpenedSignal
;
43 import org
.eclipse
.linuxtools
.tmf
.core
.signal
.TmfTraceSelectedSignal
;
44 import org
.eclipse
.linuxtools
.tmf
.core
.timestamp
.ITmfTimestamp
;
45 import org
.eclipse
.linuxtools
.tmf
.core
.timestamp
.TmfNanoTimestamp
;
46 import org
.eclipse
.linuxtools
.tmf
.core
.timestamp
.TmfTimeRange
;
47 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.ITmfTrace
;
48 import org
.eclipse
.linuxtools
.tmf
.ui
.views
.TmfView
;
49 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.ITimeGraphRangeListener
;
50 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.ITimeGraphSelectionListener
;
51 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.ITimeGraphTimeListener
;
52 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.TimeGraphCombo
;
53 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.TimeGraphPresentationProvider
;
54 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.TimeGraphRangeUpdateEvent
;
55 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.TimeGraphSelectionEvent
;
56 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.TimeGraphTimeEvent
;
57 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.model
.ILinkEvent
;
58 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.model
.ITimeEvent
;
59 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.model
.ITimeGraphEntry
;
60 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.model
.TimeGraphEntry
;
61 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.widgets
.Utils
.TimeFormat
;
62 import org
.eclipse
.swt
.SWT
;
63 import org
.eclipse
.swt
.graphics
.Image
;
64 import org
.eclipse
.swt
.widgets
.Composite
;
65 import org
.eclipse
.swt
.widgets
.Display
;
66 import org
.eclipse
.swt
.widgets
.TreeColumn
;
67 import org
.eclipse
.ui
.IActionBars
;
70 * An abstract view all time graph views can inherit
72 * This view contains a time graph combo, divided between a treeview on the
73 * left, showing entries and a canvas on the right to draw something for these
78 public abstract class AbstractTimeGraphView
extends TmfView
{
80 private final String
[] fColumns
;
81 private final String
[] fFilterColumns
;
90 // ------------------------------------------------------------------------
92 // ------------------------------------------------------------------------
94 /** The timegraph combo */
95 private TimeGraphCombo fTimeGraphCombo
;
97 /** The selected trace */
98 private ITmfTrace fTrace
;
100 /** The timegraph entry list */
101 private List
<TimeGraphEntry
> fEntryList
;
103 /** The trace to entry list hash map */
104 private final Map
<ITmfTrace
, List
<TimeGraphEntry
>> fEntryListMap
= new HashMap
<ITmfTrace
, List
<TimeGraphEntry
>>();
106 /* The trace to build thread hash map */
107 private final Map
<ITmfTrace
, BuildThread
> fBuildThreadMap
= new HashMap
<ITmfTrace
, BuildThread
>();
109 /** The start time */
110 private long fStartTime
;
113 private long fEndTime
;
115 /** The display width */
116 private final int fDisplayWidth
;
118 /** The zoom thread */
119 private ZoomThread fZoomThread
;
121 /** The next resource action */
122 private Action fNextResourceAction
;
124 /** The previous resource action */
125 private Action fPreviousResourceAction
;
127 /** The relative weight of the sash */
128 private int[] fWeight
= { 1, 1 };
130 /** A comparator class */
131 private Comparator
<ITimeGraphEntry
> fEntryComparator
= null;
133 /** The redraw state used to prevent unnecessary queuing of display runnables */
134 private State fRedrawState
= State
.IDLE
;
136 /** The redraw synchronization object */
137 private final Object fSyncObj
= new Object();
139 /** The presentation provider for this view */
140 private final TimeGraphPresentationProvider fPresentation
;
142 private TreeLabelProvider fLabelProvider
= new TreeLabelProvider();
144 // ------------------------------------------------------------------------
145 // Getters and setters
146 // ------------------------------------------------------------------------
149 * Getter for the time graph combo
151 * @return The Time graph combo
153 protected TimeGraphCombo
getTimeGraphCombo() {
154 return fTimeGraphCombo
;
158 * Sets the tree label provider
161 * The tree label provider
163 protected void setTreeLabelProvider(final TreeLabelProvider tlp
) {
164 fLabelProvider
= tlp
;
168 * Sets the relative weight of each part of the time graph combo
171 * The array of relative weights of each part of the combo
173 protected void setWeight(final int[] weights
) {
178 * Gets the display width
180 * @return the display width
182 protected int getDisplayWidth() {
183 return fDisplayWidth
;
187 * Gets the comparator for the entries
189 * @return The entry comparator
191 protected Comparator
<ITimeGraphEntry
> getEntryComparator() {
192 return fEntryComparator
;
196 * Sets the comparator class for the entries * Gets the display width
199 * A comparator object
201 protected void setEntryComparator(final Comparator
<ITimeGraphEntry
> comparator
) {
202 fEntryComparator
= comparator
;
206 * Gets the trace displayed in the view
210 protected ITmfTrace
getTrace() {
215 * Sets the trace to display
220 protected void setTrace(final ITmfTrace trace
) {
225 * Gets the start time
227 * @return The start time
229 protected long getStartTime() {
234 * Sets the start time
239 protected void setStartTime(long time
) {
246 * @return The end time
248 protected long getEndTime() {
258 protected void setEndTime(long time
) {
263 * Gets the entry list map
265 * @return the entry list map
267 protected Map
<ITmfTrace
, List
<TimeGraphEntry
>> getEntryListMap() {
268 return Collections
.unmodifiableMap(fEntryListMap
);
272 * Adds an entry to the entry list
277 * The list of time graph entries
280 protected void putEntryList(ITmfTrace trace
, List
<TimeGraphEntry
> list
) {
281 synchronized(fEntryListMap
) {
282 fEntryListMap
.put(trace
, list
);
287 * Text for the "next" button
289 * @return The "next" button text
291 protected String
getNextText() {
292 return Messages
.AbstractTimeGraphtView_NextText
;
296 * Tooltip for the "next" button
298 * @return Tooltip for the "next" button
300 protected String
getNextTooltip() {
301 return Messages
.AbstractTimeGraphView_NextTooltip
;
305 * Text for the "Previous" button
307 * @return The "Previous" button text
309 protected String
getPrevText() {
310 return Messages
.AbstractTimeGraphView_PreviousText
;
314 * Tooltip for the "previous" button
316 * @return Tooltip for the "previous" button
318 protected String
getPrevTooltip() {
319 return Messages
.AbstractTimeGraphView_PreviousTooltip
;
322 // ------------------------------------------------------------------------
324 // ------------------------------------------------------------------------
326 private class TreeContentProvider
implements ITreeContentProvider
{
329 public void dispose() {
333 public void inputChanged(Viewer viewer
, Object oldInput
, Object newInput
) {
337 public Object
[] getElements(Object inputElement
) {
338 return (ITimeGraphEntry
[]) inputElement
;
342 public Object
[] getChildren(Object parentElement
) {
343 ITimeGraphEntry entry
= (ITimeGraphEntry
) parentElement
;
344 List
<?
extends ITimeGraphEntry
> children
= entry
.getChildren();
345 return children
.toArray(new ITimeGraphEntry
[children
.size()]);
349 public Object
getParent(Object element
) {
350 ITimeGraphEntry entry
= (ITimeGraphEntry
) element
;
351 return entry
.getParent();
355 public boolean hasChildren(Object element
) {
356 ITimeGraphEntry entry
= (ITimeGraphEntry
) element
;
357 return entry
.hasChildren();
363 * Base class to provide the labels for the left tree view entry. Views
364 * extending this class typically need to override the getColumnText method
365 * if they have more than one column to display
367 protected static class TreeLabelProvider
implements ITableLabelProvider
{
370 public void addListener(ILabelProviderListener listener
) {
374 public void dispose() {
378 public boolean isLabelProperty(Object element
, String property
) {
383 public void removeListener(ILabelProviderListener listener
) {
387 public Image
getColumnImage(Object element
, int columnIndex
) {
392 public String
getColumnText(Object element
, int columnIndex
) {
393 TimeGraphEntry entry
= (TimeGraphEntry
) element
;
394 if (columnIndex
== 0) {
395 return entry
.getName();
402 private class BuildThread
extends Thread
{
403 private final ITmfTrace fBuildTrace
;
404 private final IProgressMonitor fMonitor
;
406 public BuildThread(final ITmfTrace trace
, final String name
) {
407 super(name
+ " build"); //$NON-NLS-1$
409 fMonitor
= new NullProgressMonitor();
414 buildEventList(fBuildTrace
, fMonitor
);
415 synchronized (fBuildThreadMap
) {
416 fBuildThreadMap
.remove(this);
420 public void cancel() {
421 fMonitor
.setCanceled(true);
425 private class ZoomThread
extends Thread
{
426 private final List
<TimeGraphEntry
> fZoomEntryList
;
427 private final long fZoomStartTime
;
428 private final long fZoomEndTime
;
429 private final long fResolution
;
430 private final IProgressMonitor fMonitor
;
432 public ZoomThread(List
<TimeGraphEntry
> entryList
, long startTime
, long endTime
, String name
) {
433 super(name
+ " zoom"); //$NON-NLS-1$
434 fZoomEntryList
= entryList
;
435 fZoomStartTime
= startTime
;
436 fZoomEndTime
= endTime
;
437 fResolution
= Math
.max(1, (fZoomEndTime
- fZoomStartTime
) / fDisplayWidth
);
438 fMonitor
= new NullProgressMonitor();
443 if (fZoomEntryList
== null) {
446 for (TimeGraphEntry entry
: fZoomEntryList
) {
447 if (fMonitor
.isCanceled()) {
450 zoom(entry
, fMonitor
);
452 /* Refresh the arrows when zooming */
453 List
<ILinkEvent
> events
= getLinkList(fZoomStartTime
, fZoomEndTime
, fResolution
, fMonitor
);
454 if (events
!= null) {
455 fTimeGraphCombo
.setLinks(events
);
460 private void zoom(TimeGraphEntry entry
, IProgressMonitor monitor
) {
461 if (fZoomStartTime
<= fStartTime
&& fZoomEndTime
>= fEndTime
) {
462 entry
.setZoomedEventList(null);
464 List
<ITimeEvent
> zoomedEventList
= getEventList(entry
, fZoomStartTime
, fZoomEndTime
, fResolution
, monitor
);
465 if (zoomedEventList
!= null) {
466 entry
.setZoomedEventList(zoomedEventList
);
470 for (TimeGraphEntry child
: entry
.getChildren()) {
471 if (fMonitor
.isCanceled()) {
474 zoom(child
, monitor
);
478 public void cancel() {
479 fMonitor
.setCanceled(true);
483 // ------------------------------------------------------------------------
485 // ------------------------------------------------------------------------
493 * The columns to display in the tree view on the left
495 * The columns list to filter the view
497 * The presentation provider
499 public AbstractTimeGraphView(String id
, String
[] cols
, String
[] filterCols
,
500 TimeGraphPresentationProvider pres
) {
503 fFilterColumns
= filterCols
;
504 fPresentation
= pres
;
505 fDisplayWidth
= Display
.getDefault().getBounds().width
;
508 // ------------------------------------------------------------------------
510 // ------------------------------------------------------------------------
513 public void createPartControl(Composite parent
) {
514 fTimeGraphCombo
= new TimeGraphCombo(parent
, SWT
.NONE
, fWeight
);
516 fTimeGraphCombo
.setTreeContentProvider(new TreeContentProvider());
518 fTimeGraphCombo
.setTreeLabelProvider(fLabelProvider
);
520 fTimeGraphCombo
.setTimeGraphProvider(fPresentation
);
522 fTimeGraphCombo
.setTreeColumns(fColumns
);
524 fTimeGraphCombo
.setFilterContentProvider(new TreeContentProvider());
526 fTimeGraphCombo
.setFilterLabelProvider(new TreeLabelProvider());
528 fTimeGraphCombo
.setFilterColumns(fFilterColumns
);
530 fTimeGraphCombo
.getTimeGraphViewer().addRangeListener(new ITimeGraphRangeListener() {
532 public void timeRangeUpdated(TimeGraphRangeUpdateEvent event
) {
533 final long startTime
= event
.getStartTime();
534 final long endTime
= event
.getEndTime();
535 TmfTimeRange range
= new TmfTimeRange(new TmfNanoTimestamp(startTime
), new TmfNanoTimestamp(endTime
));
536 broadcast(new TmfRangeSynchSignal(AbstractTimeGraphView
.this, range
));
537 if (fZoomThread
!= null) {
538 fZoomThread
.cancel();
540 startZoomThread(startTime
, endTime
);
544 fTimeGraphCombo
.getTimeGraphViewer().addTimeListener(new ITimeGraphTimeListener() {
546 public void timeSelected(TimeGraphTimeEvent event
) {
547 TmfNanoTimestamp startTime
= new TmfNanoTimestamp(event
.getBeginTime());
548 TmfNanoTimestamp endTime
= new TmfNanoTimestamp(event
.getEndTime());
549 broadcast(new TmfTimeSynchSignal(AbstractTimeGraphView
.this, startTime
, endTime
));
553 fTimeGraphCombo
.addSelectionListener(new ITimeGraphSelectionListener() {
555 public void selectionChanged(TimeGraphSelectionEvent event
) {
556 // ITimeGraphEntry selection = event.getSelection();
560 fTimeGraphCombo
.getTimeGraphViewer().setTimeFormat(TimeFormat
.CALENDAR
);
562 IStatusLineManager statusLineManager
= getViewSite().getActionBars().getStatusLineManager();
563 fTimeGraphCombo
.getTimeGraphViewer().getTimeGraphControl().setStatusLineManager(statusLineManager
);
565 // View Action Handling
567 contributeToActionBars();
569 ITmfTrace trace
= getActiveTrace();
571 traceSelected(new TmfTraceSelectedSignal(this, trace
));
574 // make selection available to other views
575 getSite().setSelectionProvider(fTimeGraphCombo
.getTreeViewer());
579 public void setFocus() {
580 fTimeGraphCombo
.setFocus();
583 // ------------------------------------------------------------------------
585 // ------------------------------------------------------------------------
588 * Handler for the trace opened signal.
591 * The incoming signal
595 public void traceOpened(TmfTraceOpenedSignal signal
) {
596 fTrace
= signal
.getTrace();
601 * Handler for the trace selected signal
604 * The incoming signal
607 public void traceSelected(final TmfTraceSelectedSignal signal
) {
608 if (signal
.getTrace() == fTrace
) {
611 fTrace
= signal
.getTrace();
617 * Trace is closed: clear the data structures and the view
620 * the signal received
623 public void traceClosed(final TmfTraceClosedSignal signal
) {
624 synchronized (fBuildThreadMap
) {
625 BuildThread buildThread
= fBuildThreadMap
.remove(signal
.getTrace());
626 if (buildThread
!= null) {
627 buildThread
.cancel();
630 synchronized (fEntryListMap
) {
631 fEntryListMap
.remove(signal
.getTrace());
633 if (signal
.getTrace() == fTrace
) {
637 if (fZoomThread
!= null) {
638 fZoomThread
.cancel();
645 * Handler for the time synch signal
648 * The signal that's received
651 public void synchToTime(final TmfTimeSynchSignal signal
) {
652 if (signal
.getSource() == this || fTrace
== null) {
655 final long beginTime
= signal
.getBeginTime().normalize(0, ITmfTimestamp
.NANOSECOND_SCALE
).getValue();
656 final long endTime
= signal
.getEndTime().normalize(0, ITmfTimestamp
.NANOSECOND_SCALE
).getValue();
658 Display
.getDefault().asyncExec(new Runnable() {
661 if (fTimeGraphCombo
.isDisposed()) {
664 if (beginTime
== endTime
) {
665 fTimeGraphCombo
.getTimeGraphViewer().setSelectedTime(beginTime
, true);
667 fTimeGraphCombo
.getTimeGraphViewer().setSelectionRange(beginTime
, endTime
);
669 startZoomThread(fTimeGraphCombo
.getTimeGraphViewer().getTime0(), fTimeGraphCombo
.getTimeGraphViewer().getTime1());
671 synchingToTime(beginTime
);
677 * Handler for the range synch signal
680 * The signal that's received
683 public void synchToRange(final TmfRangeSynchSignal signal
) {
684 if (signal
.getSource() == this || fTrace
== null) {
687 if (signal
.getCurrentRange().getIntersection(fTrace
.getTimeRange()) == null) {
690 final long startTime
= signal
.getCurrentRange().getStartTime().normalize(0, ITmfTimestamp
.NANOSECOND_SCALE
).getValue();
691 final long endTime
= signal
.getCurrentRange().getEndTime().normalize(0, ITmfTimestamp
.NANOSECOND_SCALE
).getValue();
692 Display
.getDefault().asyncExec(new Runnable() {
695 if (fTimeGraphCombo
.isDisposed()) {
698 fTimeGraphCombo
.getTimeGraphViewer().setStartFinishTime(startTime
, endTime
);
699 startZoomThread(startTime
, endTime
);
705 * @param signal the format of the timestamps was updated.
709 public void updateTimeFormat( final TmfTimestampFormatUpdateSignal signal
){
710 this.fTimeGraphCombo
.refresh();
713 // ------------------------------------------------------------------------
715 // ------------------------------------------------------------------------
717 private void loadTrace() {
718 synchronized (fEntryListMap
) {
719 fEntryList
= fEntryListMap
.get(fTrace
);
720 if (fEntryList
== null) {
721 synchronized (fBuildThreadMap
) {
722 BuildThread buildThread
= new BuildThread(fTrace
, this.getName());
723 fBuildThreadMap
.put(fTrace
, buildThread
);
727 fStartTime
= fTrace
.getStartTime().normalize(0, ITmfTimestamp
.NANOSECOND_SCALE
).getValue();
728 fEndTime
= fTrace
.getEndTime().normalize(0, ITmfTimestamp
.NANOSECOND_SCALE
).getValue();
735 * Method called when synching to a given timestamp. Inheriting classes can
736 * perform actions here to update the view at the given timestamp.
739 * The currently selected time
741 protected void synchingToTime(long time
) {
746 * Build the entries list to show in this time graph
748 * Called from the BuildThread
751 * The trace being built
753 * The progress monitor object
755 protected abstract void buildEventList(final ITmfTrace trace
, IProgressMonitor monitor
);
758 * Gets the list of event for an entry in a given timerange
761 * The entry to get events for
763 * Start of the time range
765 * End of the time range
769 * The progress monitor object
770 * @return The list of events for the entry
772 protected abstract List
<ITimeEvent
> getEventList(TimeGraphEntry entry
,
773 long startTime
, long endTime
, long resolution
,
774 IProgressMonitor monitor
);
777 * Gets the list of links (displayed as arrows) for a trace in a given
778 * timerange. Default implementation returns an empty list.
781 * Start of the time range
783 * End of the time range
787 * The progress monitor object
788 * @return The list of link events
791 protected List
<ILinkEvent
> getLinkList(long startTime
, long endTime
,
792 long resolution
, IProgressMonitor monitor
) {
793 return new ArrayList
<ILinkEvent
>();
798 * Refresh the display
800 protected void refresh() {
801 Display
.getDefault().asyncExec(new Runnable() {
804 if (fTimeGraphCombo
.isDisposed()) {
807 ITimeGraphEntry
[] entries
= null;
808 synchronized (fEntryListMap
) {
809 fEntryList
= fEntryListMap
.get(fTrace
);
810 if (fEntryList
== null) {
811 fEntryList
= new ArrayList
<TimeGraphEntry
>();
813 entries
= fEntryList
.toArray(new ITimeGraphEntry
[0]);
815 if (fEntryComparator
!= null) {
816 Arrays
.sort(entries
, fEntryComparator
);
818 fTimeGraphCombo
.setInput(entries
);
819 fTimeGraphCombo
.getTimeGraphViewer().setTimeBounds(fStartTime
, fEndTime
);
821 long selectionBeginTime
= fTrace
== null ?
0 : fTraceManager
.getSelectionBeginTime().normalize(0, ITmfTimestamp
.NANOSECOND_SCALE
).getValue();
822 long selectionEndTime
= fTrace
== null ?
0 : fTraceManager
.getSelectionEndTime().normalize(0, ITmfTimestamp
.NANOSECOND_SCALE
).getValue();
823 long startTime
= fTrace
== null ?
0 : fTraceManager
.getCurrentRange().getStartTime().normalize(0, ITmfTimestamp
.NANOSECOND_SCALE
).getValue();
824 long endTime
= fTrace
== null ?
0 : fTraceManager
.getCurrentRange().getEndTime().normalize(0, ITmfTimestamp
.NANOSECOND_SCALE
).getValue();
825 startTime
= Math
.max(startTime
, fStartTime
);
826 endTime
= Math
.min(endTime
, fEndTime
);
827 fTimeGraphCombo
.getTimeGraphViewer().setSelectionRange(selectionBeginTime
, selectionEndTime
);
828 fTimeGraphCombo
.getTimeGraphViewer().setStartFinishTime(startTime
, endTime
);
830 for (TreeColumn column
: fTimeGraphCombo
.getTreeViewer().getTree().getColumns()) {
834 startZoomThread(startTime
, endTime
);
842 protected void redraw() {
843 synchronized (fSyncObj
) {
844 if (fRedrawState
== State
.IDLE
) {
845 fRedrawState
= State
.BUSY
;
847 fRedrawState
= State
.PENDING
;
851 Display
.getDefault().asyncExec(new Runnable() {
854 if (fTimeGraphCombo
.isDisposed()) {
857 fTimeGraphCombo
.redraw();
858 fTimeGraphCombo
.update();
859 synchronized (fSyncObj
) {
860 if (fRedrawState
== State
.PENDING
) {
861 fRedrawState
= State
.IDLE
;
864 fRedrawState
= State
.IDLE
;
871 private void startZoomThread(long startTime
, long endTime
) {
872 if (fZoomThread
!= null) {
873 fZoomThread
.cancel();
875 fZoomThread
= new ZoomThread(fEntryList
, startTime
, endTime
, getName());
879 private void makeActions() {
880 fPreviousResourceAction
= fTimeGraphCombo
.getTimeGraphViewer().getPreviousItemAction();
881 fPreviousResourceAction
.setText(getPrevText());
882 fPreviousResourceAction
.setToolTipText(getPrevTooltip());
883 fNextResourceAction
= fTimeGraphCombo
.getTimeGraphViewer().getNextItemAction();
884 fNextResourceAction
.setText(getNextText());
885 fNextResourceAction
.setToolTipText(getNextTooltip());
888 private void contributeToActionBars() {
889 IActionBars bars
= getViewSite().getActionBars();
890 fillLocalToolBar(bars
.getToolBarManager());
894 * Add actions to local tool bar manager
896 * @param manager the tool bar manager
898 protected void fillLocalToolBar(IToolBarManager manager
) {
899 if (fFilterColumns
.length
> 0) {
900 manager
.add(fTimeGraphCombo
.getShowFilterAction());
902 manager
.add(fTimeGraphCombo
.getTimeGraphViewer().getShowLegendAction());
903 manager
.add(new Separator());
904 manager
.add(fTimeGraphCombo
.getTimeGraphViewer().getResetScaleAction());
905 manager
.add(fTimeGraphCombo
.getTimeGraphViewer().getPreviousEventAction());
906 manager
.add(fTimeGraphCombo
.getTimeGraphViewer().getNextEventAction());
907 manager
.add(fPreviousResourceAction
);
908 manager
.add(fNextResourceAction
);
909 manager
.add(fTimeGraphCombo
.getTimeGraphViewer().getZoomInAction());
910 manager
.add(fTimeGraphCombo
.getTimeGraphViewer().getZoomOutAction());
911 manager
.add(new Separator());