1 /*******************************************************************************
2 * Copyright (c) 2012 Ericsson
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 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.internal
.lttng2
.kernel
.ui
.views
.resources
;
15 import java
.util
.ArrayList
;
16 import java
.util
.Arrays
;
17 import java
.util
.Comparator
;
18 import java
.util
.Iterator
;
19 import java
.util
.List
;
21 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
22 import org
.eclipse
.core
.runtime
.NullProgressMonitor
;
23 import org
.eclipse
.jface
.action
.Action
;
24 import org
.eclipse
.jface
.action
.IToolBarManager
;
25 import org
.eclipse
.jface
.action
.Separator
;
26 import org
.eclipse
.linuxtools
.internal
.lttng2
.kernel
.core
.Attributes
;
27 import org
.eclipse
.linuxtools
.internal
.lttng2
.kernel
.ui
.Messages
;
28 import org
.eclipse
.linuxtools
.internal
.lttng2
.kernel
.ui
.views
.resources
.ResourcesEntry
.Type
;
29 import org
.eclipse
.linuxtools
.lttng2
.kernel
.core
.trace
.CtfKernelTrace
;
30 import org
.eclipse
.linuxtools
.tmf
.core
.ctfadaptor
.CtfTmfTimestamp
;
31 import org
.eclipse
.linuxtools
.tmf
.core
.event
.TmfTimeRange
;
32 import org
.eclipse
.linuxtools
.tmf
.core
.event
.TmfTimestamp
;
33 import org
.eclipse
.linuxtools
.tmf
.core
.exceptions
.AttributeNotFoundException
;
34 import org
.eclipse
.linuxtools
.tmf
.core
.exceptions
.StateValueTypeException
;
35 import org
.eclipse
.linuxtools
.tmf
.core
.exceptions
.TimeRangeException
;
36 import org
.eclipse
.linuxtools
.tmf
.core
.interval
.ITmfStateInterval
;
37 import org
.eclipse
.linuxtools
.tmf
.core
.signal
.TmfExperimentSelectedSignal
;
38 import org
.eclipse
.linuxtools
.tmf
.core
.signal
.TmfRangeSynchSignal
;
39 import org
.eclipse
.linuxtools
.tmf
.core
.signal
.TmfSignalHandler
;
40 import org
.eclipse
.linuxtools
.tmf
.core
.signal
.TmfStateSystemBuildCompleted
;
41 import org
.eclipse
.linuxtools
.tmf
.core
.signal
.TmfTimeSynchSignal
;
42 import org
.eclipse
.linuxtools
.tmf
.core
.statesystem
.IStateSystemQuerier
;
43 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.ITmfTrace
;
44 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.TmfExperiment
;
45 import org
.eclipse
.linuxtools
.tmf
.ui
.views
.TmfView
;
46 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.ITimeGraphRangeListener
;
47 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.ITimeGraphTimeListener
;
48 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.TimeGraphRangeUpdateEvent
;
49 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.TimeGraphTimeEvent
;
50 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.TimeGraphViewer
;
51 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.model
.ITimeEvent
;
52 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.model
.ITimeGraphEntry
;
53 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.model
.TimeEvent
;
54 import org
.eclipse
.swt
.SWT
;
55 import org
.eclipse
.swt
.widgets
.Composite
;
56 import org
.eclipse
.swt
.widgets
.Display
;
57 import org
.eclipse
.ui
.IActionBars
;
60 * Main implementation for the LTTng 2.0 kernel Resource view
62 * @author Patrick Tasse
64 public class ResourcesView
extends TmfView
{
66 // ------------------------------------------------------------------------
68 // ------------------------------------------------------------------------
71 public static final String ID
= "org.eclipse.linuxtools.lttng2.kernel.ui.views.resources"; //$NON-NLS-1$
73 /** Initial time range */
74 private static final long INITIAL_WINDOW_OFFSET
= (1L * 100 * 1000 * 1000); // .1sec
79 private enum State
{ IDLE
, BUSY
, PENDING
}
81 // ------------------------------------------------------------------------
83 // ------------------------------------------------------------------------
85 // The time graph viewer
86 TimeGraphViewer fTimeGraphViewer
;
88 // The selected experiment
89 private TmfExperiment fSelectedExperiment
;
91 // The time graph entry list
92 private ArrayList
<TraceEntry
> fEntryList
;
94 // The time graph entry list synchronization object
95 final private Object fEntryListSyncObj
= new Object();
98 private long fStartTime
;
101 private long fEndTime
;
104 private final int fDisplayWidth
;
106 // The next resource action
107 private Action fNextResourceAction
;
109 // The previous resource action
110 private Action fPreviousResourceAction
;
113 private ZoomThread fZoomThread
;
115 // The redraw state used to prevent unnecessary queuing of display runnables
116 private State fRedrawState
= State
.IDLE
;
118 // The redraw synchronization object
119 final private Object fSyncObj
= new Object();
121 // ------------------------------------------------------------------------
123 // ------------------------------------------------------------------------
125 private class TraceEntry
implements ITimeGraphEntry
{
127 private final CtfKernelTrace fTrace
;
129 private final long fTraceStartTime
;
131 private final long fTraceEndTime
;
132 // The children of the entry
133 private final ArrayList
<ResourcesEntry
> fChildren
;
135 private final String fName
;
137 public TraceEntry(CtfKernelTrace trace
, String name
, long startTime
, long endTime
) {
139 fChildren
= new ArrayList
<ResourcesEntry
>();
141 fTraceStartTime
= startTime
;
142 fTraceEndTime
= endTime
;
146 public ITimeGraphEntry
getParent() {
151 public boolean hasChildren() {
152 return fChildren
!= null && fChildren
.size() > 0;
156 public ResourcesEntry
[] getChildren() {
157 return fChildren
.toArray(new ResourcesEntry
[0]);
161 public String
getName() {
166 public long getStartTime() {
167 return fTraceStartTime
;
171 public long getEndTime() {
172 return fTraceEndTime
;
176 public boolean hasTimeEvents() {
181 public Iterator
<ITimeEvent
> getTimeEventsIterator() {
186 public <T
extends ITimeEvent
> Iterator
<T
> getTimeEventsIterator(long startTime
, long stopTime
, long visibleDuration
) {
190 public CtfKernelTrace
getTrace() {
194 public void addChild(ResourcesEntry entry
) {
196 for (index
= 0; index
< fChildren
.size(); index
++) {
197 ResourcesEntry other
= fChildren
.get(index
);
198 if (entry
.getType().compareTo(other
.getType()) < 0) {
200 } else if (entry
.getType().equals(other
.getType())) {
201 if (entry
.getId() < other
.getId()) {
206 entry
.setParent(this);
207 fChildren
.add(index
, entry
);
211 private static class TraceEntryComparator
implements Comparator
<ITimeGraphEntry
> {
213 public int compare(ITimeGraphEntry o1
, ITimeGraphEntry o2
) {
214 int result
= o1
.getStartTime() < o2
.getStartTime() ?
-1 : o1
.getStartTime() > o2
.getStartTime() ?
1 : 0;
216 result
= o1
.getName().compareTo(o2
.getName());
222 private class ZoomThread
extends Thread
{
223 private final long fZoomStartTime
;
224 private final long fZoomEndTime
;
225 private final IProgressMonitor fMonitor
;
227 public ZoomThread(long startTime
, long endTime
) {
228 super("ResourcesView zoom"); //$NON-NLS-1$
229 fZoomStartTime
= startTime
;
230 fZoomEndTime
= endTime
;
231 fMonitor
= new NullProgressMonitor();
236 ArrayList
<TraceEntry
> entryList
= null;
237 synchronized (fEntryListSyncObj
) {
238 entryList
= fEntryList
;
240 if (entryList
== null) {
243 long resolution
= Math
.max(1, (fZoomEndTime
- fZoomStartTime
) / fDisplayWidth
);
244 for (TraceEntry traceEntry
: entryList
) {
245 for (ITimeGraphEntry child
: traceEntry
.getChildren()) {
246 if (fMonitor
.isCanceled()) {
249 ResourcesEntry entry
= (ResourcesEntry
) child
;
250 if (fZoomStartTime
<= fStartTime
&& fZoomEndTime
>= fEndTime
) {
251 entry
.setZoomedEventList(null);
253 List
<ITimeEvent
> zoomedEventList
= getEventList(entry
, fZoomStartTime
, fZoomEndTime
, resolution
, true, fMonitor
);
254 if (zoomedEventList
!= null) {
255 entry
.setZoomedEventList(zoomedEventList
);
263 public void cancel() {
264 fMonitor
.setCanceled(true);
268 // ------------------------------------------------------------------------
270 // ------------------------------------------------------------------------
273 * Default constructor
275 public ResourcesView() {
277 fDisplayWidth
= Display
.getDefault().getBounds().width
;
280 // ------------------------------------------------------------------------
282 // ------------------------------------------------------------------------
285 * @see org.eclipse.linuxtools.tmf.ui.views.TmfView#createPartControl(org.eclipse.swt.widgets.Composite)
288 public void createPartControl(Composite parent
) {
289 fTimeGraphViewer
= new TimeGraphViewer(parent
, SWT
.NONE
);
291 fTimeGraphViewer
.setTimeGraphProvider(new ResourcesPresentationProvider());
293 fTimeGraphViewer
.setTimeCalendarFormat(true);
295 fTimeGraphViewer
.addRangeListener(new ITimeGraphRangeListener() {
297 public void timeRangeUpdated(TimeGraphRangeUpdateEvent event
) {
298 long startTime
= event
.getStartTime();
299 long endTime
= event
.getEndTime();
300 TmfTimeRange range
= new TmfTimeRange(new CtfTmfTimestamp(startTime
), new CtfTmfTimestamp(endTime
));
301 TmfTimestamp time
= new CtfTmfTimestamp(fTimeGraphViewer
.getSelectedTime());
302 broadcast(new TmfRangeSynchSignal(ResourcesView
.this, range
, time
));
303 startZoomThread(startTime
, endTime
);
307 fTimeGraphViewer
.addTimeListener(new ITimeGraphTimeListener() {
309 public void timeSelected(TimeGraphTimeEvent event
) {
310 long time
= event
.getTime();
311 broadcast(new TmfTimeSynchSignal(ResourcesView
.this, new CtfTmfTimestamp(time
)));
315 final Thread thread
= new Thread("ResourcesView build") { //$NON-NLS-1$
318 if (TmfExperiment
.getCurrentExperiment() != null) {
319 selectExperiment(TmfExperiment
.getCurrentExperiment());
325 // View Action Handling
327 contributeToActionBars();
331 * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
334 public void setFocus() {
335 fTimeGraphViewer
.setFocus();
338 // ------------------------------------------------------------------------
340 // ------------------------------------------------------------------------
343 * Handler for the ExperimentSelected signal
346 * The incoming signal
349 public void experimentSelected(final TmfExperimentSelectedSignal signal
) {
350 if (signal
.getExperiment().equals(fSelectedExperiment
)) {
354 final Thread thread
= new Thread("ResourcesView build") { //$NON-NLS-1$
357 selectExperiment(signal
.getExperiment());
364 * Handler for the TimeSynch signal
367 * The incoming signal
370 public void synchToTime(final TmfTimeSynchSignal signal
) {
371 if (signal
.getSource() == this || fSelectedExperiment
== null) {
374 final long time
= signal
.getCurrentTime().normalize(0, -9).getValue();
375 Display
.getDefault().asyncExec(new Runnable() {
378 if (fTimeGraphViewer
.getControl().isDisposed()) {
381 fTimeGraphViewer
.setSelectedTime(time
, true);
382 startZoomThread(fTimeGraphViewer
.getTime0(), fTimeGraphViewer
.getTime1());
388 * Handler for the RangeSynch signal
391 * The incoming signal
394 public void synchToRange(final TmfRangeSynchSignal signal
) {
395 if (signal
.getSource() == this || fSelectedExperiment
== null) {
398 final long startTime
= signal
.getCurrentRange().getStartTime().normalize(0, -9).getValue();
399 final long endTime
= signal
.getCurrentRange().getEndTime().normalize(0, -9).getValue();
400 final long time
= signal
.getCurrentTime().normalize(0, -9).getValue();
401 Display
.getDefault().asyncExec(new Runnable() {
404 if (fTimeGraphViewer
.getControl().isDisposed()) {
407 fTimeGraphViewer
.setStartFinishTime(startTime
, endTime
);
408 fTimeGraphViewer
.setSelectedTime(time
, false);
409 startZoomThread(startTime
, endTime
);
415 * Handler for the StatesystemBuildCompleted signal
418 * The incoming signal
421 public void stateSystemBuildCompleted (final TmfStateSystemBuildCompleted signal
) {
422 final TmfExperiment selectedExperiment
= fSelectedExperiment
;
423 if (selectedExperiment
== null || selectedExperiment
.getTraces() == null) {
426 for (ITmfTrace trace
: selectedExperiment
.getTraces()) {
427 if (trace
== signal
.getTrace() && trace
instanceof CtfKernelTrace
) {
428 final Thread thread
= new Thread("ResourcesView build") { //$NON-NLS-1$
432 selectExperiment(selectedExperiment
);
440 // ------------------------------------------------------------------------
442 // ------------------------------------------------------------------------
444 private void selectExperiment(TmfExperiment experiment
) {
445 fStartTime
= Long
.MAX_VALUE
;
446 fEndTime
= Long
.MIN_VALUE
;
447 fSelectedExperiment
= experiment
;
448 ArrayList
<TraceEntry
> entryList
= new ArrayList
<TraceEntry
>();
449 for (ITmfTrace trace
: experiment
.getTraces()) {
450 if (trace
instanceof CtfKernelTrace
) {
451 CtfKernelTrace ctfKernelTrace
= (CtfKernelTrace
) trace
;
452 IStateSystemQuerier ssq
= ctfKernelTrace
.getStateSystem();
453 long startTime
= ssq
.getStartTime();
454 long endTime
= ssq
.getCurrentEndTime() + 1;
455 TraceEntry groupEntry
= new TraceEntry(ctfKernelTrace
, trace
.getName(), startTime
, endTime
);
456 entryList
.add(groupEntry
);
457 fStartTime
= Math
.min(fStartTime
, startTime
);
458 fEndTime
= Math
.max(fEndTime
, endTime
);
459 List
<Integer
> cpuQuarks
= ssq
.getQuarks(Attributes
.CPUS
, "*"); //$NON-NLS-1$
460 ResourcesEntry
[] cpuEntries
= new ResourcesEntry
[cpuQuarks
.size()];
461 for (int i
= 0; i
< cpuQuarks
.size(); i
++) {
462 int cpuQuark
= cpuQuarks
.get(i
);
463 int cpu
= Integer
.parseInt(ssq
.getAttributeName(cpuQuark
));
464 ResourcesEntry entry
= new ResourcesEntry(cpuQuark
, ctfKernelTrace
, Type
.CPU
, cpu
);
465 groupEntry
.addChild(entry
);
466 cpuEntries
[i
] = entry
;
468 List
<Integer
> irqQuarks
= ssq
.getQuarks(Attributes
.RESOURCES
, Attributes
.IRQS
, "*"); //$NON-NLS-1$
469 ResourcesEntry
[] irqEntries
= new ResourcesEntry
[irqQuarks
.size()];
470 for (int i
= 0; i
< irqQuarks
.size(); i
++) {
471 int irqQuark
= irqQuarks
.get(i
);
472 int irq
= Integer
.parseInt(ssq
.getAttributeName(irqQuark
));
473 ResourcesEntry entry
= new ResourcesEntry(irqQuark
, ctfKernelTrace
, Type
.IRQ
, irq
);
474 groupEntry
.addChild(entry
);
475 irqEntries
[i
] = entry
;
477 List
<Integer
> softIrqQuarks
= ssq
.getQuarks(Attributes
.RESOURCES
, Attributes
.SOFT_IRQS
, "*"); //$NON-NLS-1$
478 ResourcesEntry
[] softIrqEntries
= new ResourcesEntry
[softIrqQuarks
.size()];
479 for (int i
= 0; i
< softIrqQuarks
.size(); i
++) {
480 int softIrqQuark
= softIrqQuarks
.get(i
);
481 int softIrq
= Integer
.parseInt(ssq
.getAttributeName(softIrqQuark
));
482 ResourcesEntry entry
= new ResourcesEntry(softIrqQuark
, ctfKernelTrace
, Type
.SOFT_IRQ
, softIrq
);
483 groupEntry
.addChild(entry
);
484 softIrqEntries
[i
] = entry
;
488 synchronized (fEntryListSyncObj
) {
489 fEntryList
= (ArrayList
<TraceEntry
>) entryList
.clone();
491 refresh(INITIAL_WINDOW_OFFSET
);
492 for (TraceEntry traceEntry
: entryList
) {
493 CtfKernelTrace ctfKernelTrace
= traceEntry
.getTrace();
494 IStateSystemQuerier ssq
= ctfKernelTrace
.getStateSystem();
495 long startTime
= ssq
.getStartTime();
496 long endTime
= ssq
.getCurrentEndTime() + 1;
497 long resolution
= (endTime
- startTime
) / fDisplayWidth
;
498 for (ResourcesEntry entry
: traceEntry
.getChildren()) {
499 List
<ITimeEvent
> eventList
= getEventList(entry
, startTime
, endTime
, resolution
, false, new NullProgressMonitor());
500 entry
.setEventList(eventList
);
506 private static List
<ITimeEvent
> getEventList(ResourcesEntry entry
,
507 long startTime
, long endTime
, long resolution
, boolean includeNull
,
508 IProgressMonitor monitor
) {
509 IStateSystemQuerier ssq
= entry
.getTrace().getStateSystem();
510 startTime
= Math
.max(startTime
, ssq
.getStartTime());
511 endTime
= Math
.min(endTime
, ssq
.getCurrentEndTime() + 1);
512 if (endTime
<= startTime
) {
515 List
<ITimeEvent
> eventList
= null;
516 int quark
= entry
.getQuark();
518 if (entry
.getType().equals(Type
.CPU
)) {
519 int statusQuark
= ssq
.getQuarkRelative(quark
, Attributes
.STATUS
);
520 List
<ITmfStateInterval
> statusIntervals
= ssq
.queryHistoryRange(statusQuark
, startTime
, endTime
- 1, resolution
, monitor
);
521 eventList
= new ArrayList
<ITimeEvent
>(statusIntervals
.size());
522 long lastEndTime
= -1;
523 for (ITmfStateInterval statusInterval
: statusIntervals
) {
524 if (monitor
.isCanceled()) {
527 int status
= statusInterval
.getStateValue().unboxInt();
528 long time
= statusInterval
.getStartTime();
529 long duration
= statusInterval
.getEndTime() - time
+ 1;
530 if (!statusInterval
.getStateValue().isNull()) {
531 if (lastEndTime
!= time
&& lastEndTime
!= -1) {
532 eventList
.add(new TimeEvent(entry
, lastEndTime
, time
- lastEndTime
));
534 eventList
.add(new ResourcesEvent(entry
, time
, duration
, status
));
535 lastEndTime
= time
+ duration
;
538 eventList
.add(new ResourcesEvent(entry
, time
, duration
));
542 } else if (entry
.getType().equals(Type
.IRQ
)) {
543 List
<ITmfStateInterval
> irqIntervals
= ssq
.queryHistoryRange(quark
, startTime
, endTime
- 1, resolution
, monitor
);
544 eventList
= new ArrayList
<ITimeEvent
>(irqIntervals
.size());
545 long lastEndTime
= -1;
546 boolean lastIsNull
= true;
547 for (ITmfStateInterval irqInterval
: irqIntervals
) {
548 if (monitor
.isCanceled()) {
551 long time
= irqInterval
.getStartTime();
552 long duration
= irqInterval
.getEndTime() - time
+ 1;
553 if (!irqInterval
.getStateValue().isNull()) {
554 int cpu
= irqInterval
.getStateValue().unboxInt();
555 eventList
.add(new ResourcesEvent(entry
, time
, duration
, cpu
));
558 if (lastEndTime
!= time
&& lastEndTime
!= -1 && lastIsNull
) {
559 eventList
.add(new ResourcesEvent(entry
, lastEndTime
, time
- lastEndTime
, -1));
562 eventList
.add(new ResourcesEvent(entry
, time
, duration
));
566 lastEndTime
= time
+ duration
;
568 } else if (entry
.getType().equals(Type
.SOFT_IRQ
)) {
569 List
<ITmfStateInterval
> softIrqIntervals
= ssq
.queryHistoryRange(quark
, startTime
, endTime
- 1, resolution
, monitor
);
570 eventList
= new ArrayList
<ITimeEvent
>(softIrqIntervals
.size());
571 long lastEndTime
= -1;
572 boolean lastIsNull
= true;
573 for (ITmfStateInterval softIrqInterval
: softIrqIntervals
) {
574 if (monitor
.isCanceled()) {
577 long time
= softIrqInterval
.getStartTime();
578 long duration
= softIrqInterval
.getEndTime() - time
+ 1;
579 if (!softIrqInterval
.getStateValue().isNull()) {
580 int cpu
= softIrqInterval
.getStateValue().unboxInt();
581 eventList
.add(new ResourcesEvent(entry
, time
, duration
, cpu
));
583 if (lastEndTime
!= time
&& lastEndTime
!= -1 && lastIsNull
) {
584 eventList
.add(new ResourcesEvent(entry
, lastEndTime
, time
- lastEndTime
, -1));
587 eventList
.add(new ResourcesEvent(entry
, time
, duration
));
591 lastEndTime
= time
+ duration
;
594 } catch (AttributeNotFoundException e
) {
596 } catch (TimeRangeException e
) {
598 } catch (StateValueTypeException e
) {
604 private void refresh(final long windowRange
) {
605 Display
.getDefault().asyncExec(new Runnable() {
608 if (fTimeGraphViewer
.getControl().isDisposed()) {
611 ITimeGraphEntry
[] entries
= null;
612 synchronized (fEntryListSyncObj
) {
613 entries
= fEntryList
.toArray(new ITimeGraphEntry
[0]);
615 Arrays
.sort(entries
, new TraceEntryComparator());
616 fTimeGraphViewer
.setInput(entries
);
617 fTimeGraphViewer
.setTimeBounds(fStartTime
, fEndTime
);
619 long endTime
= fStartTime
+ windowRange
;
621 if (fEndTime
< endTime
) {
624 fTimeGraphViewer
.setStartFinishTime(fStartTime
, endTime
);
626 startZoomThread(fStartTime
, endTime
);
632 private void redraw() {
633 synchronized (fSyncObj
) {
634 if (fRedrawState
== State
.IDLE
) {
635 fRedrawState
= State
.BUSY
;
637 fRedrawState
= State
.PENDING
;
641 Display
.getDefault().asyncExec(new Runnable() {
644 if (fTimeGraphViewer
.getControl().isDisposed()) {
647 fTimeGraphViewer
.getControl().redraw();
648 fTimeGraphViewer
.getControl().update();
649 synchronized (fSyncObj
) {
650 if (fRedrawState
== State
.PENDING
) {
651 fRedrawState
= State
.IDLE
;
654 fRedrawState
= State
.IDLE
;
661 private void startZoomThread(long startTime
, long endTime
) {
662 if (fZoomThread
!= null) {
663 fZoomThread
.cancel();
665 fZoomThread
= new ZoomThread(startTime
, endTime
);
669 private void makeActions() {
670 fPreviousResourceAction
= fTimeGraphViewer
.getPreviousItemAction();
671 fPreviousResourceAction
.setText(Messages
.ResourcesView_previousResourceActionNameText
);
672 fPreviousResourceAction
.setToolTipText(Messages
.ResourcesView_previousResourceActionToolTipText
);
673 fNextResourceAction
= fTimeGraphViewer
.getNextItemAction();
674 fNextResourceAction
.setText(Messages
.ResourcesView_nextResourceActionNameText
);
675 fNextResourceAction
.setToolTipText(Messages
.ResourcesView_previousResourceActionToolTipText
);
678 private void contributeToActionBars() {
679 IActionBars bars
= getViewSite().getActionBars();
680 fillLocalToolBar(bars
.getToolBarManager());
683 private void fillLocalToolBar(IToolBarManager manager
) {
684 manager
.add(fTimeGraphViewer
.getShowLegendAction());
685 manager
.add(new Separator());
686 manager
.add(fTimeGraphViewer
.getResetScaleAction());
687 manager
.add(fTimeGraphViewer
.getPreviousEventAction());
688 manager
.add(fTimeGraphViewer
.getNextEventAction());
689 manager
.add(fPreviousResourceAction
);
690 manager
.add(fNextResourceAction
);
691 manager
.add(fTimeGraphViewer
.getZoomInAction());
692 manager
.add(fTimeGraphViewer
.getZoomOutAction());
693 manager
.add(new Separator());