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 fTimeGraphCombo
.setLinks(events
);
458 private void zoom(TimeGraphEntry entry
, IProgressMonitor monitor
) {
459 if (fZoomStartTime
<= fStartTime
&& fZoomEndTime
>= fEndTime
) {
460 entry
.setZoomedEventList(null);
462 List
<ITimeEvent
> zoomedEventList
= getEventList(entry
, fZoomStartTime
, fZoomEndTime
, fResolution
, monitor
);
463 if (zoomedEventList
!= null) {
464 entry
.setZoomedEventList(zoomedEventList
);
468 for (TimeGraphEntry child
: entry
.getChildren()) {
469 if (fMonitor
.isCanceled()) {
472 zoom(child
, monitor
);
476 public void cancel() {
477 fMonitor
.setCanceled(true);
481 // ------------------------------------------------------------------------
483 // ------------------------------------------------------------------------
491 * The columns to display in the tree view on the left
493 * The columns list to filter the view
495 * The presentation provider
497 public AbstractTimeGraphView(String id
, String
[] cols
, String
[] filterCols
,
498 TimeGraphPresentationProvider pres
) {
501 fFilterColumns
= filterCols
;
502 fPresentation
= pres
;
503 fDisplayWidth
= Display
.getDefault().getBounds().width
;
506 // ------------------------------------------------------------------------
508 // ------------------------------------------------------------------------
511 public void createPartControl(Composite parent
) {
512 fTimeGraphCombo
= new TimeGraphCombo(parent
, SWT
.NONE
, fWeight
);
514 fTimeGraphCombo
.setTreeContentProvider(new TreeContentProvider());
516 fTimeGraphCombo
.setTreeLabelProvider(fLabelProvider
);
518 fTimeGraphCombo
.setTimeGraphProvider(fPresentation
);
520 fTimeGraphCombo
.setTreeColumns(fColumns
);
522 fTimeGraphCombo
.setFilterContentProvider(new TreeContentProvider());
524 fTimeGraphCombo
.setFilterLabelProvider(new TreeLabelProvider());
526 fTimeGraphCombo
.setFilterColumns(fFilterColumns
);
528 fTimeGraphCombo
.getTimeGraphViewer().addRangeListener(new ITimeGraphRangeListener() {
530 public void timeRangeUpdated(TimeGraphRangeUpdateEvent event
) {
531 final long startTime
= event
.getStartTime();
532 final long endTime
= event
.getEndTime();
533 TmfTimeRange range
= new TmfTimeRange(new TmfNanoTimestamp(startTime
), new TmfNanoTimestamp(endTime
));
534 broadcast(new TmfRangeSynchSignal(AbstractTimeGraphView
.this, range
));
535 if (fZoomThread
!= null) {
536 fZoomThread
.cancel();
538 startZoomThread(startTime
, endTime
);
542 fTimeGraphCombo
.getTimeGraphViewer().addTimeListener(new ITimeGraphTimeListener() {
544 public void timeSelected(TimeGraphTimeEvent event
) {
545 TmfNanoTimestamp startTime
= new TmfNanoTimestamp(event
.getBeginTime());
546 TmfNanoTimestamp endTime
= new TmfNanoTimestamp(event
.getEndTime());
547 broadcast(new TmfTimeSynchSignal(AbstractTimeGraphView
.this, startTime
, endTime
));
551 fTimeGraphCombo
.addSelectionListener(new ITimeGraphSelectionListener() {
553 public void selectionChanged(TimeGraphSelectionEvent event
) {
554 // ITimeGraphEntry selection = event.getSelection();
558 fTimeGraphCombo
.getTimeGraphViewer().setTimeFormat(TimeFormat
.CALENDAR
);
560 IStatusLineManager statusLineManager
= getViewSite().getActionBars().getStatusLineManager();
561 fTimeGraphCombo
.getTimeGraphViewer().getTimeGraphControl().setStatusLineManager(statusLineManager
);
563 // View Action Handling
565 contributeToActionBars();
567 ITmfTrace trace
= getActiveTrace();
569 traceSelected(new TmfTraceSelectedSignal(this, trace
));
572 // make selection available to other views
573 getSite().setSelectionProvider(fTimeGraphCombo
.getTreeViewer());
577 public void setFocus() {
578 fTimeGraphCombo
.setFocus();
581 // ------------------------------------------------------------------------
583 // ------------------------------------------------------------------------
586 * Handler for the trace opened signal.
589 * The incoming signal
593 public void traceOpened(TmfTraceOpenedSignal signal
) {
594 fTrace
= signal
.getTrace();
599 * Handler for the trace selected signal
602 * The incoming signal
605 public void traceSelected(final TmfTraceSelectedSignal signal
) {
606 if (signal
.getTrace() == fTrace
) {
609 fTrace
= signal
.getTrace();
615 * Trace is closed: clear the data structures and the view
618 * the signal received
621 public void traceClosed(final TmfTraceClosedSignal signal
) {
622 synchronized (fBuildThreadMap
) {
623 BuildThread buildThread
= fBuildThreadMap
.remove(signal
.getTrace());
624 if (buildThread
!= null) {
625 buildThread
.cancel();
628 synchronized (fEntryListMap
) {
629 fEntryListMap
.remove(signal
.getTrace());
631 if (signal
.getTrace() == fTrace
) {
635 if (fZoomThread
!= null) {
636 fZoomThread
.cancel();
643 * Handler for the time synch signal
646 * The signal that's received
649 public void synchToTime(final TmfTimeSynchSignal signal
) {
650 if (signal
.getSource() == this || fTrace
== null) {
653 final long beginTime
= signal
.getBeginTime().normalize(0, ITmfTimestamp
.NANOSECOND_SCALE
).getValue();
654 final long endTime
= signal
.getEndTime().normalize(0, ITmfTimestamp
.NANOSECOND_SCALE
).getValue();
656 Display
.getDefault().asyncExec(new Runnable() {
659 if (fTimeGraphCombo
.isDisposed()) {
662 if (beginTime
== endTime
) {
663 fTimeGraphCombo
.getTimeGraphViewer().setSelectedTime(beginTime
, true);
665 fTimeGraphCombo
.getTimeGraphViewer().setSelectionRange(beginTime
, endTime
);
667 startZoomThread(fTimeGraphCombo
.getTimeGraphViewer().getTime0(), fTimeGraphCombo
.getTimeGraphViewer().getTime1());
669 synchingToTime(beginTime
);
675 * Handler for the range synch signal
678 * The signal that's received
681 public void synchToRange(final TmfRangeSynchSignal signal
) {
682 if (signal
.getSource() == this || fTrace
== null) {
685 if (signal
.getCurrentRange().getIntersection(fTrace
.getTimeRange()) == null) {
688 final long startTime
= signal
.getCurrentRange().getStartTime().normalize(0, ITmfTimestamp
.NANOSECOND_SCALE
).getValue();
689 final long endTime
= signal
.getCurrentRange().getEndTime().normalize(0, ITmfTimestamp
.NANOSECOND_SCALE
).getValue();
690 Display
.getDefault().asyncExec(new Runnable() {
693 if (fTimeGraphCombo
.isDisposed()) {
696 fTimeGraphCombo
.getTimeGraphViewer().setStartFinishTime(startTime
, endTime
);
697 startZoomThread(startTime
, endTime
);
703 * @param signal the format of the timestamps was updated.
707 public void updateTimeFormat( final TmfTimestampFormatUpdateSignal signal
){
708 this.fTimeGraphCombo
.refresh();
711 // ------------------------------------------------------------------------
713 // ------------------------------------------------------------------------
715 private void loadTrace() {
716 synchronized (fEntryListMap
) {
717 fEntryList
= fEntryListMap
.get(fTrace
);
718 if (fEntryList
== null) {
719 synchronized (fBuildThreadMap
) {
720 BuildThread buildThread
= new BuildThread(fTrace
, this.getName());
721 fBuildThreadMap
.put(fTrace
, buildThread
);
725 fStartTime
= fTrace
.getStartTime().normalize(0, ITmfTimestamp
.NANOSECOND_SCALE
).getValue();
726 fEndTime
= fTrace
.getEndTime().normalize(0, ITmfTimestamp
.NANOSECOND_SCALE
).getValue();
733 * Method called when synching to a given timestamp. Inheriting classes can
734 * perform actions here to update the view at the given timestamp.
737 * The currently selected time
739 protected void synchingToTime(long time
) {
744 * Build the entries list to show in this time graph
746 * Called from the BuildThread
749 * The trace being built
751 * The progress monitor object
753 protected abstract void buildEventList(final ITmfTrace trace
, IProgressMonitor monitor
);
756 * Gets the list of event for an entry in a given timerange
759 * The entry to get events for
761 * Start of the time range
763 * End of the time range
767 * The progress monitor object
768 * @return The list of events for the entry
770 protected abstract List
<ITimeEvent
> getEventList(TimeGraphEntry entry
,
771 long startTime
, long endTime
, long resolution
,
772 IProgressMonitor monitor
);
775 * Gets the list of links (displayed as arrows) for a trace in a given
776 * timerange. Default implementation returns an empty list.
779 * Start of the time range
781 * End of the time range
785 * The progress monitor object
786 * @return The list of link events
789 protected List
<ILinkEvent
> getLinkList(long startTime
, long endTime
,
790 long resolution
, IProgressMonitor monitor
) {
791 return new ArrayList
<ILinkEvent
>();
796 * Refresh the display
798 protected void refresh() {
799 Display
.getDefault().asyncExec(new Runnable() {
802 if (fTimeGraphCombo
.isDisposed()) {
805 ITimeGraphEntry
[] entries
= null;
806 synchronized (fEntryListMap
) {
807 fEntryList
= fEntryListMap
.get(fTrace
);
808 if (fEntryList
== null) {
809 fEntryList
= new ArrayList
<TimeGraphEntry
>();
811 entries
= fEntryList
.toArray(new ITimeGraphEntry
[0]);
813 if (fEntryComparator
!= null) {
814 Arrays
.sort(entries
, fEntryComparator
);
816 fTimeGraphCombo
.setInput(entries
);
817 fTimeGraphCombo
.getTimeGraphViewer().setTimeBounds(fStartTime
, fEndTime
);
819 long selectionBeginTime
= fTrace
== null ?
0 : fTraceManager
.getSelectionBeginTime().normalize(0, ITmfTimestamp
.NANOSECOND_SCALE
).getValue();
820 long selectionEndTime
= fTrace
== null ?
0 : fTraceManager
.getSelectionEndTime().normalize(0, ITmfTimestamp
.NANOSECOND_SCALE
).getValue();
821 long startTime
= fTrace
== null ?
0 : fTraceManager
.getCurrentRange().getStartTime().normalize(0, ITmfTimestamp
.NANOSECOND_SCALE
).getValue();
822 long endTime
= fTrace
== null ?
0 : fTraceManager
.getCurrentRange().getEndTime().normalize(0, ITmfTimestamp
.NANOSECOND_SCALE
).getValue();
823 startTime
= Math
.max(startTime
, fStartTime
);
824 endTime
= Math
.min(endTime
, fEndTime
);
825 fTimeGraphCombo
.getTimeGraphViewer().setSelectionRange(selectionBeginTime
, selectionEndTime
);
826 fTimeGraphCombo
.getTimeGraphViewer().setStartFinishTime(startTime
, endTime
);
828 for (TreeColumn column
: fTimeGraphCombo
.getTreeViewer().getTree().getColumns()) {
832 startZoomThread(startTime
, endTime
);
840 protected void redraw() {
841 synchronized (fSyncObj
) {
842 if (fRedrawState
== State
.IDLE
) {
843 fRedrawState
= State
.BUSY
;
845 fRedrawState
= State
.PENDING
;
849 Display
.getDefault().asyncExec(new Runnable() {
852 if (fTimeGraphCombo
.isDisposed()) {
855 fTimeGraphCombo
.redraw();
856 fTimeGraphCombo
.update();
857 synchronized (fSyncObj
) {
858 if (fRedrawState
== State
.PENDING
) {
859 fRedrawState
= State
.IDLE
;
862 fRedrawState
= State
.IDLE
;
869 private void startZoomThread(long startTime
, long endTime
) {
870 if (fZoomThread
!= null) {
871 fZoomThread
.cancel();
873 fZoomThread
= new ZoomThread(fEntryList
, startTime
, endTime
, getName());
877 private void makeActions() {
878 fPreviousResourceAction
= fTimeGraphCombo
.getTimeGraphViewer().getPreviousItemAction();
879 fPreviousResourceAction
.setText(getPrevText());
880 fPreviousResourceAction
.setToolTipText(getPrevTooltip());
881 fNextResourceAction
= fTimeGraphCombo
.getTimeGraphViewer().getNextItemAction();
882 fNextResourceAction
.setText(getNextText());
883 fNextResourceAction
.setToolTipText(getNextTooltip());
886 private void contributeToActionBars() {
887 IActionBars bars
= getViewSite().getActionBars();
888 fillLocalToolBar(bars
.getToolBarManager());
891 private void fillLocalToolBar(IToolBarManager manager
) {
892 if (fFilterColumns
.length
> 0) {
893 manager
.add(fTimeGraphCombo
.getShowFilterAction());
895 manager
.add(fTimeGraphCombo
.getTimeGraphViewer().getShowLegendAction());
896 manager
.add(new Separator());
897 manager
.add(fTimeGraphCombo
.getTimeGraphViewer().getResetScaleAction());
898 manager
.add(fTimeGraphCombo
.getTimeGraphViewer().getPreviousEventAction());
899 manager
.add(fTimeGraphCombo
.getTimeGraphViewer().getNextEventAction());
900 manager
.add(fPreviousResourceAction
);
901 manager
.add(fNextResourceAction
);
902 manager
.add(fTimeGraphCombo
.getTimeGraphViewer().getZoomInAction());
903 manager
.add(fTimeGraphCombo
.getTimeGraphViewer().getZoomOutAction());
904 manager
.add(new Separator());