Bug 378402: Implementation of ControlFlow view and Resources view for
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.kernel.ui / src / org / eclipse / linuxtools / internal / lttng2 / kernel / ui / views / resources / ResourcesView.java
1 /*******************************************************************************
2 * Copyright (c) 2012 Ericsson
3 *
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
8 *
9 * Contributors:
10 * Patrick Tasse - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.resources;
14
15 import java.util.ArrayList;
16 import java.util.Arrays;
17 import java.util.HashMap;
18 import java.util.Iterator;
19 import java.util.List;
20 import java.util.Map;
21
22 import org.eclipse.jface.action.Action;
23 import org.eclipse.jface.action.IToolBarManager;
24 import org.eclipse.jface.action.Separator;
25 import org.eclipse.linuxtools.internal.lttng2.kernel.ui.Messages;
26 import org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.resources.ResourcesEntry.Type;
27 import org.eclipse.linuxtools.lttng2.kernel.core.trace.Attributes;
28 import org.eclipse.linuxtools.lttng2.kernel.core.trace.CtfKernelTrace;
29 import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTimestamp;
30 import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
31 import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
32 import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange;
33 import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
34 import org.eclipse.linuxtools.tmf.core.exceptions.AttributeNotFoundException;
35 import org.eclipse.linuxtools.tmf.core.exceptions.StateValueTypeException;
36 import org.eclipse.linuxtools.tmf.core.exceptions.TimeRangeException;
37 import org.eclipse.linuxtools.tmf.core.experiment.TmfExperiment;
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.TmfTimeSynchSignal;
43 import org.eclipse.linuxtools.tmf.core.statesystem.IStateSystemQuerier;
44 import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
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.StateItem;
49 import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.TimeGraphPresentationProvider;
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.graphics.RGB;
58 import org.eclipse.swt.widgets.Composite;
59 import org.eclipse.swt.widgets.Display;
60 import org.eclipse.ui.IActionBars;
61
62 public class ResourcesView extends TmfView {
63
64 // ------------------------------------------------------------------------
65 // Constants
66 // ------------------------------------------------------------------------
67
68 /**
69 * View ID.
70 */
71 public static final String ID = "org.eclipse.linuxtools.lttng2.kernel.ui.views.resources"; //$NON-NLS-1$
72
73 // ------------------------------------------------------------------------
74 // Fields
75 // ------------------------------------------------------------------------
76
77 // The time graph viewer
78 TimeGraphViewer fTimeGraphViewer;
79
80 // The selected experiment
81 private TmfExperiment<ITmfEvent> fSelectedExperiment;
82
83 // The time graph entry list
84 private ArrayList<TraceEntry> fEntryList;
85
86 // The start time
87 private long fStartTime;
88
89 // The end time
90 private long fEndTime;
91
92 // The display width
93 private int fDisplayWidth;
94
95 // The next resource action
96 private Action fNextResourceAction;
97
98 // The previous resource action
99 private Action fPreviousResourceAction;
100
101
102 // The zoom thread
103 private ZoomThread fZoomThread;
104
105 // ------------------------------------------------------------------------
106 // Classes
107 // ------------------------------------------------------------------------
108
109 private class TraceEntry implements ITimeGraphEntry {
110 private CtfKernelTrace fTrace;
111 public ArrayList<ResourcesEntry> fChildren;
112 public String fName;
113
114 public TraceEntry(CtfKernelTrace trace, String name) {
115 fTrace = trace;
116 fChildren = new ArrayList<ResourcesEntry>();
117 fName = name;
118 }
119
120 @Override
121 public ITimeGraphEntry getParent() {
122 return null;
123 }
124
125 @Override
126 public boolean hasChildren() {
127 return fChildren != null && fChildren.size() > 0;
128 }
129
130 @Override
131 public ResourcesEntry[] getChildren() {
132 return fChildren.toArray(new ResourcesEntry[0]);
133 }
134
135 @Override
136 public String getName() {
137 return fName;
138 }
139
140 @Override
141 public long getStartTime() {
142 return -1;
143 }
144
145 @Override
146 public long getEndTime() {
147 return -1;
148 }
149
150 @Override
151 public Iterator<ITimeEvent> getTimeEventsIterator() {
152 return null;
153 }
154
155 @Override
156 public <T extends ITimeEvent> Iterator<T> getTimeEventsIterator(long startTime, long stopTime, long visibleDuration) {
157 return null;
158 }
159
160 public CtfKernelTrace getTrace() {
161 return fTrace;
162 }
163
164 public void addChild(ResourcesEntry entry) {
165 int index;
166 for (index = 0; index < fChildren.size(); index++) {
167 ResourcesEntry other = fChildren.get(index);
168 if (entry.getType().compareTo(other.getType()) < 0) {
169 break;
170 } else if (entry.getType().equals(other.getType())) {
171 if (entry.getId() < other.getId()) {
172 break;
173 }
174 }
175 }
176 entry.setParent(this);
177 fChildren.add(index, entry);
178 }
179 }
180
181 private class ZoomThread extends Thread {
182 private long fStartTime;
183 private long fEndTime;
184 private boolean fCancelled = false;
185
186 public ZoomThread(long startTime, long endTime) {
187 super("ResourcesView zoom"); //$NON-NLS-1$
188 fStartTime = startTime;
189 fEndTime = endTime;
190 }
191
192 @Override
193 public void run() {
194 if (fEntryList == null) {
195 return;
196 }
197 long resolution = Math.max(1, (fEndTime - fStartTime) / fDisplayWidth);
198 for (TraceEntry traceEntry : fEntryList) {
199 for (ITimeGraphEntry child : traceEntry.getChildren()) {
200 ResourcesEntry entry = (ResourcesEntry) child;
201 if (fCancelled) {
202 break;
203 }
204 List<ITimeEvent> zoomedEventList = getEventList(entry, fStartTime, fEndTime, resolution, true);
205 entry.setZoomedEventList(zoomedEventList);
206 redraw();
207 }
208 }
209 }
210
211 public void cancel() {
212 fCancelled = true;
213 }
214 }
215
216 // ------------------------------------------------------------------------
217 // Constructors
218 // ------------------------------------------------------------------------
219
220 public ResourcesView() {
221 super(ID);
222 fDisplayWidth = Display.getDefault().getBounds().width;
223 }
224
225 // ------------------------------------------------------------------------
226 // ViewPart
227 // ------------------------------------------------------------------------
228
229 /* (non-Javadoc)
230 * @see org.eclipse.linuxtools.tmf.ui.views.TmfView#createPartControl(org.eclipse.swt.widgets.Composite)
231 */
232 @Override
233 public void createPartControl(Composite parent) {
234 fTimeGraphViewer = new TimeGraphViewer(parent, SWT.NONE);
235
236 fTimeGraphViewer.setTimeGraphProvider(new TimeGraphPresentationProvider() {
237 private static final String UNKNOWN = "UNKNOWN"; //$NON-NLS-1$
238 private static final String IDLE = "IDLE"; //$NON-NLS-1$
239 private static final String BUSY = "BUSY"; //$NON-NLS-1$
240 private static final String INTERRUPTED = "INTERRUPTED"; //$NON-NLS-1$
241 private static final String RAISED = "RAISED"; //$NON-NLS-1$
242 private static final String ACTIVE = "ACTIVE"; //$NON-NLS-1$
243
244 @Override
245 public String getStateTypeName() {
246 return Messages.ResourcesView_stateTypeName;
247 }
248
249 @Override
250 public String getEventName(ITimeEvent event) {
251 if (event instanceof ResourcesEvent) {
252 ResourcesEvent resourcesEvent = (ResourcesEvent) event;
253 if (resourcesEvent.getType() == Type.CPU) {
254 int currentThread = resourcesEvent.getValue();
255 if (currentThread == 0) {
256 return IDLE;
257 } else {
258 return BUSY;
259 }
260 } else if (resourcesEvent.getType() == Type.IRQ || resourcesEvent.getType() == Type.SOFT_IRQ) {
261 int cpu = resourcesEvent.getValue();
262 if (cpu == Attributes.SOFT_IRQ_RAISED) {
263 return RAISED;
264 }
265 return ACTIVE;
266 } else {
267 return null;
268 }
269 }
270 return UNKNOWN;
271 }
272
273 @Override
274 public Map<String, String> getEventHoverToolTipInfo(ITimeEvent event) {
275 return new HashMap<String, String>();
276 }
277
278 @Override
279 public StateItem[] getStateTable() {
280 return new StateItem[] {
281 new StateItem(new RGB(100, 100, 100), UNKNOWN),
282 new StateItem(new RGB(200, 200, 200), IDLE),
283 new StateItem(new RGB(0, 200, 0), BUSY),
284 new StateItem(new RGB(200, 100, 100), INTERRUPTED),
285 new StateItem(new RGB(200, 200, 0), RAISED),
286 new StateItem(new RGB(200, 100, 100), ACTIVE)
287 };
288 }
289
290 @Override
291 public int getEventTableIndex(ITimeEvent event) {
292 if (event instanceof ResourcesEvent) {
293 ResourcesEvent resourcesEvent = (ResourcesEvent) event;
294 if (resourcesEvent.getType() == Type.CPU) {
295 int currentThread = resourcesEvent.getValue();
296 if (currentThread == 0) {
297 return 1; // IDLE
298 } else {
299 return 2; // BUSY
300 }
301 } else if (resourcesEvent.getType() == Type.IRQ || resourcesEvent.getType() == Type.SOFT_IRQ) {
302 int cpu = resourcesEvent.getValue();
303 if (cpu == Attributes.SOFT_IRQ_RAISED) {
304 return 4; // RAISED
305 }
306 return 5; // ACTIVE
307 } else {
308 return -1; // NULL
309 }
310 }
311 return 0; // UNKNOWN
312 }
313 });
314
315 fTimeGraphViewer.setTimeCalendarFormat(true);
316
317 fTimeGraphViewer.addRangeListener(new ITimeGraphRangeListener() {
318 @Override
319 public void timeRangeUpdated(TimeGraphRangeUpdateEvent event) {
320 long startTime = event.getStartTime();
321 long endTime = event.getEndTime();
322 TmfTimeRange range = new TmfTimeRange(new CtfTmfTimestamp(startTime), new CtfTmfTimestamp(endTime));
323 TmfTimestamp time = new CtfTmfTimestamp(fTimeGraphViewer.getSelectedTime());
324 broadcast(new TmfRangeSynchSignal(ResourcesView.this, range, time));
325 if (fZoomThread != null) {
326 fZoomThread.cancel();
327 }
328 fZoomThread = new ZoomThread(startTime, endTime);
329 fZoomThread.start();
330 }
331 });
332
333 fTimeGraphViewer.addTimeListener(new ITimeGraphTimeListener() {
334 @Override
335 public void timeSelected(TimeGraphTimeEvent event) {
336 long time = event.getTime();
337 broadcast(new TmfTimeSynchSignal(ResourcesView.this, new CtfTmfTimestamp(time)));
338 }
339 });
340
341 final Thread thread = new Thread("ResourcesView build") { //$NON-NLS-1$
342 @Override
343 public void run() {
344 if (TmfExperiment.getCurrentExperiment() != null) {
345 selectExperiment(TmfExperiment.getCurrentExperiment());
346 }
347 }
348 };
349 thread.start();
350
351 // View Action Handling
352 makeActions();
353 contributeToActionBars();
354 }
355
356 /* (non-Javadoc)
357 * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
358 */
359 @Override
360 public void setFocus() {
361 fTimeGraphViewer.setFocus();
362 }
363
364 // ------------------------------------------------------------------------
365 // Signal handlers
366 // ------------------------------------------------------------------------
367
368 @TmfSignalHandler
369 public void experimentSelected(final TmfExperimentSelectedSignal<? extends TmfEvent> signal) {
370 if (signal.getExperiment().equals(fSelectedExperiment)) {
371 return;
372 }
373
374 final Thread thread = new Thread("ResourcesView build") { //$NON-NLS-1$
375 @Override
376 public void run() {
377 selectExperiment(signal.getExperiment());
378 }};
379 thread.start();
380 }
381
382 @TmfSignalHandler
383 public void synchToTime(final TmfTimeSynchSignal signal) {
384 if (signal.getSource() == this) {
385 return;
386 }
387 final long time = signal.getCurrentTime().normalize(0, -9).getValue();
388 Display.getDefault().asyncExec(new Runnable() {
389 @Override
390 public void run() {
391 if (fTimeGraphViewer.getControl().isDisposed()) {
392 return;
393 }
394 fTimeGraphViewer.setSelectedTime(time, true, signal.getSource());
395 }
396 });
397 }
398
399 @TmfSignalHandler
400 public void synchToRange(final TmfRangeSynchSignal signal) {
401 if (signal.getSource() == this) {
402 return;
403 }
404 final long startTime = signal.getCurrentRange().getStartTime().normalize(0, -9).getValue();
405 final long endTime = signal.getCurrentRange().getEndTime().normalize(0, -9).getValue();
406 final long time = signal.getCurrentTime().normalize(0, -9).getValue();
407 Display.getDefault().asyncExec(new Runnable() {
408 @Override
409 public void run() {
410 if (fTimeGraphViewer.getControl().isDisposed()) {
411 return;
412 }
413 fTimeGraphViewer.setStartFinishTime(startTime, endTime);
414 fTimeGraphViewer.setSelectedTime(time, false, signal.getSource());
415 }
416 });
417 }
418
419 // ------------------------------------------------------------------------
420 // Internal
421 // ------------------------------------------------------------------------
422
423 @SuppressWarnings("unchecked")
424 private void selectExperiment(TmfExperiment<?> experiment) {
425 fStartTime = Long.MAX_VALUE;
426 fEndTime = Long.MIN_VALUE;
427 fSelectedExperiment = (TmfExperiment<ITmfEvent>) experiment;
428 fEntryList = new ArrayList<TraceEntry>();
429 for (ITmfTrace<?> trace : experiment.getTraces()) {
430 if (trace instanceof CtfKernelTrace) {
431 CtfKernelTrace ctfKernelTrace = (CtfKernelTrace) trace;
432 TraceEntry groupEntry = new TraceEntry(ctfKernelTrace, trace.getName());
433 fEntryList.add(groupEntry);
434 IStateSystemQuerier ssq = ctfKernelTrace.getStateSystem();
435 long startTime = ssq.getStartTime();
436 long endTime = ssq.getCurrentEndTime() + 1;
437 fStartTime = Math.min(fStartTime, startTime);
438 fEndTime = Math.max(fEndTime, endTime);
439 List<Integer> cpuQuarks = ssq.getQuarks(Attributes.CPUS, "*"); //$NON-NLS-1$
440 ResourcesEntry[] cpuEntries = new ResourcesEntry[cpuQuarks.size()];
441 for (int i = 0; i < cpuQuarks.size(); i++) {
442 int cpuQuark = cpuQuarks.get(i);
443 int cpu = Integer.parseInt(ssq.getAttributeName(cpuQuark));
444 ResourcesEntry entry = new ResourcesEntry(cpuQuark, ctfKernelTrace, Type.CPU, cpu);
445 groupEntry.addChild(entry);
446 cpuEntries[i] = entry;
447 }
448 List<Integer> irqQuarks = ssq.getQuarks(Attributes.RESOURCES, Attributes.IRQS, "*"); //$NON-NLS-1$
449 ResourcesEntry[] irqEntries = new ResourcesEntry[irqQuarks.size()];
450 for (int i = 0; i < irqQuarks.size(); i++) {
451 int irqQuark = irqQuarks.get(i);
452 int irq = Integer.parseInt(ssq.getAttributeName(irqQuark));
453 ResourcesEntry entry = new ResourcesEntry(irqQuark, ctfKernelTrace, Type.IRQ, irq);
454 groupEntry.addChild(entry);
455 irqEntries[i] = entry;
456 }
457 List<Integer> softIrqQuarks = ssq.getQuarks(Attributes.RESOURCES, Attributes.SOFT_IRQS, "*"); //$NON-NLS-1$
458 ResourcesEntry[] softIrqEntries = new ResourcesEntry[softIrqQuarks.size()];
459 for (int i = 0; i < softIrqQuarks.size(); i++) {
460 int softIrqQuark = softIrqQuarks.get(i);
461 int softIrq = Integer.parseInt(ssq.getAttributeName(softIrqQuark));
462 ResourcesEntry entry = new ResourcesEntry(softIrqQuark, ctfKernelTrace, Type.SOFT_IRQ, softIrq);
463 groupEntry.addChild(entry);
464 softIrqEntries[i] = entry;
465 }
466 }
467 }
468 refresh();
469 for (TraceEntry traceEntry : fEntryList) {
470 CtfKernelTrace ctfKernelTrace = ((TraceEntry) traceEntry).getTrace();
471 IStateSystemQuerier ssq = ctfKernelTrace.getStateSystem();
472 long startTime = ssq.getStartTime();
473 long endTime = ssq.getCurrentEndTime() + 1;
474 long resolution = (endTime - startTime) / fDisplayWidth;
475 for (ResourcesEntry entry : traceEntry.getChildren()) {
476 List<ITimeEvent> eventList = getEventList(entry, startTime, endTime, resolution, false);
477 entry.setEventList(eventList);
478 redraw();
479 }
480 }
481 }
482
483 private List<ITimeEvent> getEventList(ResourcesEntry entry, long startTime, long endTime, long resolution, boolean includeNull) {
484 IStateSystemQuerier ssq = entry.getTrace().getStateSystem();
485 List<ITimeEvent> eventList = null;
486 int quark = entry.getQuark();
487 try {
488 if (entry.getType().equals(Type.CPU)) {
489 int currentThreadQuark = ssq.getQuarkRelative(quark, Attributes.CURRENT_THREAD);
490 List<ITmfStateInterval> currentThreadIntervals = ssq.queryHistoryRange(currentThreadQuark, startTime, endTime - 1, resolution);
491 eventList = new ArrayList<ITimeEvent>(currentThreadIntervals.size());
492 long lastEndTime = -1;
493 for (ITmfStateInterval currentThreadInterval : currentThreadIntervals) {
494 if (!currentThreadInterval.getStateValue().isNull()) {
495 int currentThread = currentThreadInterval.getStateValue().unboxInt();
496 long time = currentThreadInterval.getStartTime();
497 long duration = currentThreadInterval.getEndTime() - time + 1;
498 if (lastEndTime != time && lastEndTime != -1) {
499 eventList.add(new TimeEvent(entry, lastEndTime, time - lastEndTime));
500 }
501 eventList.add(new ResourcesEvent(entry, time, duration, currentThread));
502 lastEndTime = time + duration;
503 }
504 }
505 } else if (entry.getType().equals(Type.IRQ)) {
506 List<ITmfStateInterval> irqIntervals = ssq.queryHistoryRange(quark, startTime, endTime - 1, resolution);
507 eventList = new ArrayList<ITimeEvent>(irqIntervals.size());
508 long lastEndTime = -1;
509 boolean lastIsNull = true;
510 for (ITmfStateInterval irqInterval : irqIntervals) {
511 long time = irqInterval.getStartTime();
512 long duration = irqInterval.getEndTime() - time + 1;
513 if (!irqInterval.getStateValue().isNull()) {
514 int cpu = irqInterval.getStateValue().unboxInt();
515 eventList.add(new ResourcesEvent(entry, time, duration, cpu));
516 lastIsNull = false;
517 } else {
518 if (lastEndTime != time && lastEndTime != -1 && lastIsNull) {
519 eventList.add(new ResourcesEvent(entry, lastEndTime, time - lastEndTime, -1));
520 }
521 if (includeNull) {
522 eventList.add(new ResourcesEvent(entry, time, duration));
523 }
524 lastIsNull = true;
525 }
526 lastEndTime = time + duration;
527 }
528 } else if (entry.getType().equals(Type.SOFT_IRQ)) {
529 List<ITmfStateInterval> softIrqIntervals = ssq.queryHistoryRange(quark, startTime, endTime - 1, resolution);
530 eventList = new ArrayList<ITimeEvent>(softIrqIntervals.size());
531 long lastEndTime = -1;
532 boolean lastIsNull = true;
533 for (ITmfStateInterval softIrqInterval : softIrqIntervals) {
534 long time = softIrqInterval.getStartTime();
535 long duration = softIrqInterval.getEndTime() - time + 1;
536 if (!softIrqInterval.getStateValue().isNull()) {
537 int cpu = softIrqInterval.getStateValue().unboxInt();
538 eventList.add(new ResourcesEvent(entry, time, duration, cpu));
539 } else {
540 if (lastEndTime != time && lastEndTime != -1 && lastIsNull) {
541 eventList.add(new ResourcesEvent(entry, lastEndTime, time - lastEndTime, -1));
542 }
543 if (includeNull) {
544 eventList.add(new ResourcesEvent(entry, time, duration));
545 }
546 lastIsNull = true;
547 }
548 lastEndTime = time + duration;
549 }
550 }
551 } catch (AttributeNotFoundException e) {
552 e.printStackTrace();
553 } catch (TimeRangeException e) {
554 e.printStackTrace();
555 } catch (StateValueTypeException e) {
556 e.printStackTrace();
557 }
558 return eventList;
559 }
560
561 private void refresh() {
562 Display.getDefault().asyncExec(new Runnable() {
563 @Override
564 public void run() {
565 if (fTimeGraphViewer.getControl().isDisposed()) {
566 return;
567 }
568 ITimeGraphEntry[] entries = fEntryList.toArray(new ITimeGraphEntry[0]);
569 Arrays.sort(entries);
570 fTimeGraphViewer.setInput(entries);
571 fTimeGraphViewer.setTimeBounds(fStartTime, fEndTime);
572 fTimeGraphViewer.setStartFinishTime(fStartTime, fEndTime);
573 }
574 });
575 }
576
577
578 private void redraw() {
579 Display.getDefault().asyncExec(new Runnable() {
580 @Override
581 public void run() {
582 if (fTimeGraphViewer.getControl().isDisposed()) {
583 return;
584 }
585 fTimeGraphViewer.getControl().redraw();
586 fTimeGraphViewer.getControl().update();
587 }
588 });
589 }
590
591 private void makeActions() {
592 fPreviousResourceAction = fTimeGraphViewer.getPreviousItemAction();
593 fPreviousResourceAction.setText(Messages.ResourcesView_previousResourceActionNameText);
594 fPreviousResourceAction.setToolTipText(Messages.ResourcesView_previousResourceActionToolTipText);
595 fNextResourceAction = fTimeGraphViewer.getNextItemAction();
596 fNextResourceAction.setText(Messages.ResourcesView_nextResourceActionNameText);
597 fNextResourceAction.setToolTipText(Messages.ResourcesView_previousResourceActionToolTipText);
598 }
599
600 private void contributeToActionBars() {
601 IActionBars bars = getViewSite().getActionBars();
602 fillLocalToolBar(bars.getToolBarManager());
603 }
604
605 private void fillLocalToolBar(IToolBarManager manager) {
606 manager.add(fTimeGraphViewer.getShowLegendAction());
607 manager.add(new Separator());
608 manager.add(fTimeGraphViewer.getResetScaleAction());
609 manager.add(fTimeGraphViewer.getPreviousEventAction());
610 manager.add(fTimeGraphViewer.getNextEventAction());
611 manager.add(fPreviousResourceAction);
612 manager.add(fNextResourceAction);
613 manager.add(fTimeGraphViewer.getZoomInAction());
614 manager.add(fTimeGraphViewer.getZoomOutAction());
615 manager.add(new Separator());
616 }
617 }
This page took 0.049708 seconds and 6 git commands to generate.