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
.ITmfEvent
;
32 import org
.eclipse
.linuxtools
.tmf
.core
.event
.TmfEvent
;
33 import org
.eclipse
.linuxtools
.tmf
.core
.event
.TmfTimeRange
;
34 import org
.eclipse
.linuxtools
.tmf
.core
.event
.TmfTimestamp
;
35 import org
.eclipse
.linuxtools
.tmf
.core
.exceptions
.AttributeNotFoundException
;
36 import org
.eclipse
.linuxtools
.tmf
.core
.exceptions
.StateValueTypeException
;
37 import org
.eclipse
.linuxtools
.tmf
.core
.exceptions
.TimeRangeException
;
38 import org
.eclipse
.linuxtools
.tmf
.core
.interval
.ITmfStateInterval
;
39 import org
.eclipse
.linuxtools
.tmf
.core
.signal
.TmfExperimentSelectedSignal
;
40 import org
.eclipse
.linuxtools
.tmf
.core
.signal
.TmfRangeSynchSignal
;
41 import org
.eclipse
.linuxtools
.tmf
.core
.signal
.TmfSignalHandler
;
42 import org
.eclipse
.linuxtools
.tmf
.core
.signal
.TmfStateSystemBuildCompleted
;
43 import org
.eclipse
.linuxtools
.tmf
.core
.signal
.TmfTimeSynchSignal
;
44 import org
.eclipse
.linuxtools
.tmf
.core
.statesystem
.IStateSystemQuerier
;
45 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.ITmfTrace
;
46 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.TmfExperiment
;
47 import org
.eclipse
.linuxtools
.tmf
.ui
.views
.TmfView
;
48 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.ITimeGraphRangeListener
;
49 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.ITimeGraphTimeListener
;
50 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.TimeGraphRangeUpdateEvent
;
51 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.TimeGraphTimeEvent
;
52 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.TimeGraphViewer
;
53 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.model
.ITimeEvent
;
54 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.model
.ITimeGraphEntry
;
55 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.model
.TimeEvent
;
56 import org
.eclipse
.swt
.SWT
;
57 import org
.eclipse
.swt
.widgets
.Composite
;
58 import org
.eclipse
.swt
.widgets
.Display
;
59 import org
.eclipse
.ui
.IActionBars
;
62 * Main implementation for the LTTng 2.0 kernel Resource view
64 * @author Patrick Tasse
66 public class ResourcesView
extends TmfView
{
68 // ------------------------------------------------------------------------
70 // ------------------------------------------------------------------------
73 public static final String ID
= "org.eclipse.linuxtools.lttng2.kernel.ui.views.resources"; //$NON-NLS-1$
75 /** Initial time range */
76 private static final long INITIAL_WINDOW_OFFSET
= (1L * 100 * 1000 * 1000); // .1sec
81 private enum State
{ IDLE
, BUSY
, PENDING
};
83 // ------------------------------------------------------------------------
85 // ------------------------------------------------------------------------
87 // The time graph viewer
88 TimeGraphViewer fTimeGraphViewer
;
90 // The selected experiment
91 private TmfExperiment
<ITmfEvent
> fSelectedExperiment
;
93 // The time graph entry list
94 private ArrayList
<TraceEntry
> fEntryList
;
96 // The time graph entry list synchronization object
97 final private Object fEntryListSyncObj
= new Object();
100 private long fStartTime
;
103 private long fEndTime
;
106 private final int fDisplayWidth
;
108 // The next resource action
109 private Action fNextResourceAction
;
111 // The previous resource action
112 private Action fPreviousResourceAction
;
115 private ZoomThread fZoomThread
;
117 // The redraw state used to prevent unnecessary queuing of display runnables
118 private State fRedrawState
= State
.IDLE
;
120 // The redraw synchronization object
121 final private Object fSyncObj
= new Object();
123 // ------------------------------------------------------------------------
125 // ------------------------------------------------------------------------
127 private class TraceEntry
implements ITimeGraphEntry
{
129 private final CtfKernelTrace fTrace
;
131 private final long fTraceStartTime
;
133 private final long fTraceEndTime
;
134 // The children of the entry
135 private final ArrayList
<ResourcesEntry
> fChildren
;
137 private final String fName
;
139 public TraceEntry(CtfKernelTrace trace
, String name
, long startTime
, long endTime
) {
141 fChildren
= new ArrayList
<ResourcesEntry
>();
143 fTraceStartTime
= startTime
;
144 fTraceEndTime
= endTime
;
148 public ITimeGraphEntry
getParent() {
153 public boolean hasChildren() {
154 return fChildren
!= null && fChildren
.size() > 0;
158 public ResourcesEntry
[] getChildren() {
159 return fChildren
.toArray(new ResourcesEntry
[0]);
163 public String
getName() {
168 public long getStartTime() {
169 return fTraceStartTime
;
173 public long getEndTime() {
174 return fTraceEndTime
;
178 public boolean hasTimeEvents() {
183 public Iterator
<ITimeEvent
> getTimeEventsIterator() {
188 public <T
extends ITimeEvent
> Iterator
<T
> getTimeEventsIterator(long startTime
, long stopTime
, long visibleDuration
) {
192 public CtfKernelTrace
getTrace() {
196 public void addChild(ResourcesEntry entry
) {
198 for (index
= 0; index
< fChildren
.size(); index
++) {
199 ResourcesEntry other
= fChildren
.get(index
);
200 if (entry
.getType().compareTo(other
.getType()) < 0) {
202 } else if (entry
.getType().equals(other
.getType())) {
203 if (entry
.getId() < other
.getId()) {
208 entry
.setParent(this);
209 fChildren
.add(index
, entry
);
213 private static class TraceEntryComparator
implements Comparator
<ITimeGraphEntry
> {
215 public int compare(ITimeGraphEntry o1
, ITimeGraphEntry o2
) {
216 int result
= o1
.getStartTime() < o2
.getStartTime() ?
-1 : o1
.getStartTime() > o2
.getStartTime() ?
1 : 0;
218 result
= o1
.getName().compareTo(o2
.getName());
224 private class ZoomThread
extends Thread
{
225 private final long fZoomStartTime
;
226 private final long fZoomEndTime
;
227 private final IProgressMonitor fMonitor
;
229 public ZoomThread(long startTime
, long endTime
) {
230 super("ResourcesView zoom"); //$NON-NLS-1$
231 fZoomStartTime
= startTime
;
232 fZoomEndTime
= endTime
;
233 fMonitor
= new NullProgressMonitor();
238 ArrayList
<TraceEntry
> entryList
= null;
239 synchronized (fEntryListSyncObj
) {
240 entryList
= fEntryList
;
242 if (entryList
== null) {
245 long resolution
= Math
.max(1, (fZoomEndTime
- fZoomStartTime
) / fDisplayWidth
);
246 for (TraceEntry traceEntry
: entryList
) {
247 for (ITimeGraphEntry child
: traceEntry
.getChildren()) {
248 if (fMonitor
.isCanceled()) {
251 ResourcesEntry entry
= (ResourcesEntry
) child
;
252 if (fZoomStartTime
<= fStartTime
&& fZoomEndTime
>= fEndTime
) {
253 entry
.setZoomedEventList(null);
255 List
<ITimeEvent
> zoomedEventList
= getEventList(entry
, fZoomStartTime
, fZoomEndTime
, resolution
, true, fMonitor
);
256 if (zoomedEventList
!= null) {
257 entry
.setZoomedEventList(zoomedEventList
);
265 public void cancel() {
266 fMonitor
.setCanceled(true);
270 // ------------------------------------------------------------------------
272 // ------------------------------------------------------------------------
275 * Default constructor
277 public ResourcesView() {
279 fDisplayWidth
= Display
.getDefault().getBounds().width
;
282 // ------------------------------------------------------------------------
284 // ------------------------------------------------------------------------
287 * @see org.eclipse.linuxtools.tmf.ui.views.TmfView#createPartControl(org.eclipse.swt.widgets.Composite)
290 public void createPartControl(Composite parent
) {
291 fTimeGraphViewer
= new TimeGraphViewer(parent
, SWT
.NONE
);
293 fTimeGraphViewer
.setTimeGraphProvider(new ResourcesPresentationProvider());
295 fTimeGraphViewer
.setTimeCalendarFormat(true);
297 fTimeGraphViewer
.addRangeListener(new ITimeGraphRangeListener() {
299 public void timeRangeUpdated(TimeGraphRangeUpdateEvent event
) {
300 long startTime
= event
.getStartTime();
301 long endTime
= event
.getEndTime();
302 TmfTimeRange range
= new TmfTimeRange(new CtfTmfTimestamp(startTime
), new CtfTmfTimestamp(endTime
));
303 TmfTimestamp time
= new CtfTmfTimestamp(fTimeGraphViewer
.getSelectedTime());
304 broadcast(new TmfRangeSynchSignal(ResourcesView
.this, range
, time
));
305 startZoomThread(startTime
, endTime
);
309 fTimeGraphViewer
.addTimeListener(new ITimeGraphTimeListener() {
311 public void timeSelected(TimeGraphTimeEvent event
) {
312 long time
= event
.getTime();
313 broadcast(new TmfTimeSynchSignal(ResourcesView
.this, new CtfTmfTimestamp(time
)));
317 final Thread thread
= new Thread("ResourcesView build") { //$NON-NLS-1$
320 if (TmfExperiment
.getCurrentExperiment() != null) {
321 selectExperiment(TmfExperiment
.getCurrentExperiment());
327 // View Action Handling
329 contributeToActionBars();
333 * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
336 public void setFocus() {
337 fTimeGraphViewer
.setFocus();
340 // ------------------------------------------------------------------------
342 // ------------------------------------------------------------------------
345 * Handler for the ExperimentSelected signal
348 * The incoming signal
351 public void experimentSelected(final TmfExperimentSelectedSignal
<?
extends TmfEvent
> signal
) {
352 if (signal
.getExperiment().equals(fSelectedExperiment
)) {
356 final Thread thread
= new Thread("ResourcesView build") { //$NON-NLS-1$
359 selectExperiment(signal
.getExperiment());
366 * Handler for the TimeSynch signal
369 * The incoming signal
372 public void synchToTime(final TmfTimeSynchSignal signal
) {
373 if (signal
.getSource() == this || fSelectedExperiment
== null) {
376 final long time
= signal
.getCurrentTime().normalize(0, -9).getValue();
377 Display
.getDefault().asyncExec(new Runnable() {
380 if (fTimeGraphViewer
.getControl().isDisposed()) {
383 fTimeGraphViewer
.setSelectedTime(time
, true);
384 startZoomThread(fTimeGraphViewer
.getTime0(), fTimeGraphViewer
.getTime1());
390 * Handler for the RangeSynch signal
393 * The incoming signal
396 public void synchToRange(final TmfRangeSynchSignal signal
) {
397 if (signal
.getSource() == this || fSelectedExperiment
== null) {
400 final long startTime
= signal
.getCurrentRange().getStartTime().normalize(0, -9).getValue();
401 final long endTime
= signal
.getCurrentRange().getEndTime().normalize(0, -9).getValue();
402 final long time
= signal
.getCurrentTime().normalize(0, -9).getValue();
403 Display
.getDefault().asyncExec(new Runnable() {
406 if (fTimeGraphViewer
.getControl().isDisposed()) {
409 fTimeGraphViewer
.setStartFinishTime(startTime
, endTime
);
410 fTimeGraphViewer
.setSelectedTime(time
, false);
411 startZoomThread(startTime
, endTime
);
417 * Handler for the StatesystemBuildCompleted signal
420 * The incoming signal
423 public void stateSystemBuildCompleted (final TmfStateSystemBuildCompleted signal
) {
424 final TmfExperiment
<?
> selectedExperiment
= fSelectedExperiment
;
425 if (selectedExperiment
== null) {
428 for (ITmfTrace
<?
> trace
: selectedExperiment
.getTraces()) {
429 if (trace
== signal
.getTrace() && trace
instanceof CtfKernelTrace
) {
430 final Thread thread
= new Thread("ResourcesView build") { //$NON-NLS-1$
434 selectExperiment(selectedExperiment
);
442 // ------------------------------------------------------------------------
444 // ------------------------------------------------------------------------
446 @SuppressWarnings("unchecked")
447 private void selectExperiment(TmfExperiment
<?
> experiment
) {
448 fStartTime
= Long
.MAX_VALUE
;
449 fEndTime
= Long
.MIN_VALUE
;
450 fSelectedExperiment
= (TmfExperiment
<ITmfEvent
>) experiment
;
451 ArrayList
<TraceEntry
> entryList
= new ArrayList
<TraceEntry
>();
452 for (ITmfTrace
<?
> trace
: experiment
.getTraces()) {
453 if (trace
instanceof CtfKernelTrace
) {
454 CtfKernelTrace ctfKernelTrace
= (CtfKernelTrace
) trace
;
455 IStateSystemQuerier ssq
= ctfKernelTrace
.getStateSystem();
456 long startTime
= ssq
.getStartTime();
457 long endTime
= ssq
.getCurrentEndTime() + 1;
458 TraceEntry groupEntry
= new TraceEntry(ctfKernelTrace
, trace
.getName(), startTime
, endTime
);
459 entryList
.add(groupEntry
);
460 fStartTime
= Math
.min(fStartTime
, startTime
);
461 fEndTime
= Math
.max(fEndTime
, endTime
);
462 List
<Integer
> cpuQuarks
= ssq
.getQuarks(Attributes
.CPUS
, "*"); //$NON-NLS-1$
463 ResourcesEntry
[] cpuEntries
= new ResourcesEntry
[cpuQuarks
.size()];
464 for (int i
= 0; i
< cpuQuarks
.size(); i
++) {
465 int cpuQuark
= cpuQuarks
.get(i
);
466 int cpu
= Integer
.parseInt(ssq
.getAttributeName(cpuQuark
));
467 ResourcesEntry entry
= new ResourcesEntry(cpuQuark
, ctfKernelTrace
, Type
.CPU
, cpu
);
468 groupEntry
.addChild(entry
);
469 cpuEntries
[i
] = entry
;
471 List
<Integer
> irqQuarks
= ssq
.getQuarks(Attributes
.RESOURCES
, Attributes
.IRQS
, "*"); //$NON-NLS-1$
472 ResourcesEntry
[] irqEntries
= new ResourcesEntry
[irqQuarks
.size()];
473 for (int i
= 0; i
< irqQuarks
.size(); i
++) {
474 int irqQuark
= irqQuarks
.get(i
);
475 int irq
= Integer
.parseInt(ssq
.getAttributeName(irqQuark
));
476 ResourcesEntry entry
= new ResourcesEntry(irqQuark
, ctfKernelTrace
, Type
.IRQ
, irq
);
477 groupEntry
.addChild(entry
);
478 irqEntries
[i
] = entry
;
480 List
<Integer
> softIrqQuarks
= ssq
.getQuarks(Attributes
.RESOURCES
, Attributes
.SOFT_IRQS
, "*"); //$NON-NLS-1$
481 ResourcesEntry
[] softIrqEntries
= new ResourcesEntry
[softIrqQuarks
.size()];
482 for (int i
= 0; i
< softIrqQuarks
.size(); i
++) {
483 int softIrqQuark
= softIrqQuarks
.get(i
);
484 int softIrq
= Integer
.parseInt(ssq
.getAttributeName(softIrqQuark
));
485 ResourcesEntry entry
= new ResourcesEntry(softIrqQuark
, ctfKernelTrace
, Type
.SOFT_IRQ
, softIrq
);
486 groupEntry
.addChild(entry
);
487 softIrqEntries
[i
] = entry
;
491 synchronized (fEntryListSyncObj
) {
492 fEntryList
= (ArrayList
<TraceEntry
>) entryList
.clone();
494 refresh(INITIAL_WINDOW_OFFSET
);
495 for (TraceEntry traceEntry
: entryList
) {
496 CtfKernelTrace ctfKernelTrace
= traceEntry
.getTrace();
497 IStateSystemQuerier ssq
= ctfKernelTrace
.getStateSystem();
498 long startTime
= ssq
.getStartTime();
499 long endTime
= ssq
.getCurrentEndTime() + 1;
500 long resolution
= (endTime
- startTime
) / fDisplayWidth
;
501 for (ResourcesEntry entry
: traceEntry
.getChildren()) {
502 List
<ITimeEvent
> eventList
= getEventList(entry
, startTime
, endTime
, resolution
, false, new NullProgressMonitor());
503 entry
.setEventList(eventList
);
509 private static List
<ITimeEvent
> getEventList(ResourcesEntry entry
,
510 long startTime
, long endTime
, long resolution
, boolean includeNull
,
511 IProgressMonitor monitor
) {
512 IStateSystemQuerier ssq
= entry
.getTrace().getStateSystem();
513 startTime
= Math
.max(startTime
, ssq
.getStartTime());
514 endTime
= Math
.min(endTime
, ssq
.getCurrentEndTime() + 1);
515 if (endTime
<= startTime
) {
518 List
<ITimeEvent
> eventList
= null;
519 int quark
= entry
.getQuark();
521 if (entry
.getType().equals(Type
.CPU
)) {
522 int statusQuark
= ssq
.getQuarkRelative(quark
, Attributes
.STATUS
);
523 List
<ITmfStateInterval
> statusIntervals
= ssq
.queryHistoryRange(statusQuark
, startTime
, endTime
- 1, resolution
, monitor
);
524 eventList
= new ArrayList
<ITimeEvent
>(statusIntervals
.size());
525 long lastEndTime
= -1;
526 for (ITmfStateInterval statusInterval
: statusIntervals
) {
527 if (monitor
.isCanceled()) {
530 int status
= statusInterval
.getStateValue().unboxInt();
531 long time
= statusInterval
.getStartTime();
532 long duration
= statusInterval
.getEndTime() - time
+ 1;
533 if (!statusInterval
.getStateValue().isNull()) {
534 if (lastEndTime
!= time
&& lastEndTime
!= -1) {
535 eventList
.add(new TimeEvent(entry
, lastEndTime
, time
- lastEndTime
));
537 eventList
.add(new ResourcesEvent(entry
, time
, duration
, status
));
538 lastEndTime
= time
+ duration
;
541 eventList
.add(new ResourcesEvent(entry
, time
, duration
));
545 } else if (entry
.getType().equals(Type
.IRQ
)) {
546 List
<ITmfStateInterval
> irqIntervals
= ssq
.queryHistoryRange(quark
, startTime
, endTime
- 1, resolution
, monitor
);
547 eventList
= new ArrayList
<ITimeEvent
>(irqIntervals
.size());
548 long lastEndTime
= -1;
549 boolean lastIsNull
= true;
550 for (ITmfStateInterval irqInterval
: irqIntervals
) {
551 if (monitor
.isCanceled()) {
554 long time
= irqInterval
.getStartTime();
555 long duration
= irqInterval
.getEndTime() - time
+ 1;
556 if (!irqInterval
.getStateValue().isNull()) {
557 int cpu
= irqInterval
.getStateValue().unboxInt();
558 eventList
.add(new ResourcesEvent(entry
, time
, duration
, cpu
));
561 if (lastEndTime
!= time
&& lastEndTime
!= -1 && lastIsNull
) {
562 eventList
.add(new ResourcesEvent(entry
, lastEndTime
, time
- lastEndTime
, -1));
565 eventList
.add(new ResourcesEvent(entry
, time
, duration
));
569 lastEndTime
= time
+ duration
;
571 } else if (entry
.getType().equals(Type
.SOFT_IRQ
)) {
572 List
<ITmfStateInterval
> softIrqIntervals
= ssq
.queryHistoryRange(quark
, startTime
, endTime
- 1, resolution
, monitor
);
573 eventList
= new ArrayList
<ITimeEvent
>(softIrqIntervals
.size());
574 long lastEndTime
= -1;
575 boolean lastIsNull
= true;
576 for (ITmfStateInterval softIrqInterval
: softIrqIntervals
) {
577 if (monitor
.isCanceled()) {
580 long time
= softIrqInterval
.getStartTime();
581 long duration
= softIrqInterval
.getEndTime() - time
+ 1;
582 if (!softIrqInterval
.getStateValue().isNull()) {
583 int cpu
= softIrqInterval
.getStateValue().unboxInt();
584 eventList
.add(new ResourcesEvent(entry
, time
, duration
, cpu
));
586 if (lastEndTime
!= time
&& lastEndTime
!= -1 && lastIsNull
) {
587 eventList
.add(new ResourcesEvent(entry
, lastEndTime
, time
- lastEndTime
, -1));
590 eventList
.add(new ResourcesEvent(entry
, time
, duration
));
594 lastEndTime
= time
+ duration
;
597 } catch (AttributeNotFoundException e
) {
599 } catch (TimeRangeException e
) {
601 } catch (StateValueTypeException e
) {
607 private void refresh(final long windowRange
) {
608 Display
.getDefault().asyncExec(new Runnable() {
611 if (fTimeGraphViewer
.getControl().isDisposed()) {
614 ITimeGraphEntry
[] entries
= null;
615 synchronized (fEntryListSyncObj
) {
616 entries
= fEntryList
.toArray(new ITimeGraphEntry
[0]);
618 Arrays
.sort(entries
, new TraceEntryComparator());
619 fTimeGraphViewer
.setInput(entries
);
620 fTimeGraphViewer
.setTimeBounds(fStartTime
, fEndTime
);
622 long endTime
= fStartTime
+ windowRange
;
624 if (fEndTime
< endTime
) {
627 fTimeGraphViewer
.setStartFinishTime(fStartTime
, endTime
);
629 startZoomThread(fStartTime
, endTime
);
635 private void redraw() {
636 synchronized (fSyncObj
) {
637 if (fRedrawState
== State
.IDLE
) {
638 fRedrawState
= State
.BUSY
;
640 fRedrawState
= State
.PENDING
;
644 Display
.getDefault().asyncExec(new Runnable() {
647 if (fTimeGraphViewer
.getControl().isDisposed()) {
650 fTimeGraphViewer
.getControl().redraw();
651 fTimeGraphViewer
.getControl().update();
652 synchronized (fSyncObj
) {
653 if (fRedrawState
== State
.PENDING
) {
654 fRedrawState
= State
.IDLE
;
657 fRedrawState
= State
.IDLE
;
664 private void startZoomThread(long startTime
, long endTime
) {
665 if (fZoomThread
!= null) {
666 fZoomThread
.cancel();
668 fZoomThread
= new ZoomThread(startTime
, endTime
);
672 private void makeActions() {
673 fPreviousResourceAction
= fTimeGraphViewer
.getPreviousItemAction();
674 fPreviousResourceAction
.setText(Messages
.ResourcesView_previousResourceActionNameText
);
675 fPreviousResourceAction
.setToolTipText(Messages
.ResourcesView_previousResourceActionToolTipText
);
676 fNextResourceAction
= fTimeGraphViewer
.getNextItemAction();
677 fNextResourceAction
.setText(Messages
.ResourcesView_nextResourceActionNameText
);
678 fNextResourceAction
.setToolTipText(Messages
.ResourcesView_previousResourceActionToolTipText
);
681 private void contributeToActionBars() {
682 IActionBars bars
= getViewSite().getActionBars();
683 fillLocalToolBar(bars
.getToolBarManager());
686 private void fillLocalToolBar(IToolBarManager manager
) {
687 manager
.add(fTimeGraphViewer
.getShowLegendAction());
688 manager
.add(new Separator());
689 manager
.add(fTimeGraphViewer
.getResetScaleAction());
690 manager
.add(fTimeGraphViewer
.getPreviousEventAction());
691 manager
.add(fTimeGraphViewer
.getNextEventAction());
692 manager
.add(fPreviousResourceAction
);
693 manager
.add(fNextResourceAction
);
694 manager
.add(fTimeGraphViewer
.getZoomInAction());
695 manager
.add(fTimeGraphViewer
.getZoomOutAction());
696 manager
.add(new Separator());