Commit | Line | Data |
---|---|---|
6e512b93 ASL |
1 | /******************************************************************************* |
2 | * Copyright (c) 2009, 2010 Ericsson | |
3 | * | |
4 | * All rights reserved. This program and the accompanying materials are made | |
5 | * 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: Alvaro Sanchez-Leon - Initial implementation | |
10 | *******************************************************************************/ | |
11 | package org.eclipse.linuxtools.lttng.ui.views.resources; | |
12 | ||
13 | import org.eclipse.jface.action.Action; | |
14 | import org.eclipse.jface.action.IMenuListener; | |
15 | import org.eclipse.jface.action.IMenuManager; | |
16 | import org.eclipse.jface.action.IToolBarManager; | |
17 | import org.eclipse.jface.action.MenuManager; | |
18 | import org.eclipse.jface.action.Separator; | |
19 | import org.eclipse.linuxtools.lttng.request.ILttngSyntEventRequest; | |
20 | import org.eclipse.linuxtools.lttng.state.evProcessor.ITransEventProcessor; | |
21 | import org.eclipse.linuxtools.lttng.ui.TraceDebug; | |
22 | import org.eclipse.linuxtools.lttng.ui.model.trange.ItemContainer; | |
23 | import org.eclipse.linuxtools.lttng.ui.model.trange.TimeRangeViewerProvider; | |
24 | import org.eclipse.linuxtools.lttng.ui.views.common.AbsTimeUpdateView; | |
25 | import org.eclipse.linuxtools.lttng.ui.views.common.ParamsUpdater; | |
26 | import org.eclipse.linuxtools.lttng.ui.views.resources.evProcessor.ResourcesEventToHandlerFactory; | |
27 | import org.eclipse.linuxtools.lttng.ui.views.resources.model.ResourceModelFactory; | |
28 | import org.eclipse.linuxtools.tmf.event.TmfEvent; | |
29 | import org.eclipse.linuxtools.tmf.event.TmfTimeRange; | |
30 | import org.eclipse.linuxtools.tmf.experiment.TmfExperiment; | |
31 | import org.eclipse.linuxtools.tmf.signal.TmfExperimentSelectedSignal; | |
32 | import org.eclipse.linuxtools.tmf.signal.TmfRangeSynchSignal; | |
33 | import org.eclipse.linuxtools.tmf.signal.TmfSignalHandler; | |
34 | import org.eclipse.linuxtools.tmf.signal.TmfTimeSynchSignal; | |
35 | import org.eclipse.linuxtools.tmf.ui.viewers.TmfViewerFactory; | |
36 | import org.eclipse.linuxtools.tmf.ui.viewers.timeAnalysis.ITmfTimeScaleSelectionListener; | |
37 | import org.eclipse.linuxtools.tmf.ui.viewers.timeAnalysis.ITmfTimeSelectionListener; | |
38 | import org.eclipse.linuxtools.tmf.ui.viewers.timeAnalysis.TmfTimeScaleSelectionEvent; | |
39 | import org.eclipse.linuxtools.tmf.ui.viewers.timeAnalysis.TmfTimeSelectionEvent; | |
40 | import org.eclipse.linuxtools.tmf.ui.viewers.timeAnalysis.model.ITmfTimeAnalysisEntry; | |
41 | import org.eclipse.swt.SWT; | |
42 | import org.eclipse.swt.layout.FillLayout; | |
43 | import org.eclipse.swt.widgets.Composite; | |
44 | import org.eclipse.swt.widgets.Display; | |
45 | import org.eclipse.swt.widgets.Menu; | |
46 | import org.eclipse.ui.IActionBars; | |
47 | import org.eclipse.ui.IWorkbenchActionConstants; | |
48 | import org.eclipse.ui.PlatformUI; | |
49 | import org.eclipse.ui.plugin.AbstractUIPlugin; | |
50 | ||
51 | /** | |
52 | * @author alvaro | |
53 | * | |
54 | */ | |
55 | public class ResourcesView extends AbsTimeUpdateView implements | |
56 | ITmfTimeSelectionListener, ITmfTimeScaleSelectionListener { | |
57 | ||
58 | // ======================================================================== | |
59 | // Data | |
60 | // ======================================================================== | |
61 | public static final String ID = "org.eclipse.linuxtools.lttng.ui.views.resources"; | |
62 | ||
63 | // private int totalNumItems = 0; | |
64 | // Actions | |
65 | private Action resetScale; | |
66 | private Action nextEvent; | |
67 | private Action prevEvent; | |
68 | private Action nextTrace; | |
69 | private Action prevTrace; | |
70 | private Action showLegend; | |
71 | private Action filterTraces; | |
72 | private Action zoomIn; | |
73 | private Action zoomOut; | |
74 | private Action zoomFilter; | |
75 | private Composite top; | |
76 | ||
77 | // private static SimpleDateFormat stimeformat = new SimpleDateFormat( | |
78 | // "yy/MM/dd HH:mm:ss"); | |
79 | ||
80 | // private TraceModelImplFactory fact; | |
81 | ||
82 | // ======================================================================== | |
83 | // Constructor | |
84 | // ======================================================================== | |
85 | ||
86 | /** | |
87 | * The constructor. | |
88 | */ | |
89 | public ResourcesView() { | |
90 | super(ID); | |
91 | } | |
92 | ||
93 | // ======================================================================== | |
94 | // Methods | |
95 | // ======================================================================== | |
96 | ||
97 | /** | |
98 | * This is a callback that will allow us to create the viewer and initialize | |
99 | * it. | |
100 | */ | |
101 | @Override | |
102 | public void createPartControl(Composite parent) { | |
103 | top = new Composite(parent, SWT.BORDER); | |
104 | ||
105 | top.setLayout(new FillLayout()); | |
106 | tsfviewer = TmfViewerFactory.createViewer(top, | |
107 | new TimeRangeViewerProvider()); | |
108 | ||
109 | tsfviewer.addWidgetSelectionListner(this); | |
110 | tsfviewer.addWidgetTimeScaleSelectionListner(this); | |
111 | ||
112 | // Traces shall not be grouped to allow synchronisation | |
113 | tsfviewer.groupTraces(true); | |
114 | tsfviewer.setAcceptSelectionAPIcalls(true); | |
115 | ||
116 | // Viewer to notify selection to this class | |
117 | // This class will synchronise selections with table. | |
118 | tsfviewer.addWidgetSelectionListner(this); | |
119 | tsfviewer.addWidgetTimeScaleSelectionListner(this); | |
120 | ||
121 | // Create the help context id for the viewer's control | |
122 | // TODO: Associate with help system | |
123 | PlatformUI.getWorkbench().getHelpSystem().setHelp( | |
124 | tsfviewer.getControl(), | |
125 | "org.eclipse.linuxtools.lttng.ui.views.resource.view"); //$NON-NLS-1$ | |
126 | ||
127 | makeActions(); | |
128 | hookContextMenu(); | |
129 | contributeToActionBars(); | |
130 | ||
131 | // Read relevant values | |
132 | int timeSpaceWidth = tsfviewer.getTimeSpace(); | |
133 | if (timeSpaceWidth < 0) { | |
134 | timeSpaceWidth = -timeSpaceWidth; | |
135 | } | |
136 | ||
137 | TmfExperiment<?> experiment = TmfExperiment.getCurrentExperiment(); | |
138 | if (experiment != null) { | |
139 | TmfTimeRange experimentTRange = experiment.getTimeRange(); | |
140 | if (experimentTRange != null) { | |
141 | long time0 = experimentTRange.getStartTime().getValue(); | |
142 | long time1 = experimentTRange.getEndTime().getValue(); | |
143 | ParamsUpdater paramUpdater = getParamsUpdater(); | |
144 | paramUpdater.update(time0, time1, timeSpaceWidth); | |
145 | } | |
146 | // send the initial request and obtained the adjusted time used | |
147 | TmfTimeRange adjustedTimeRange = initialExperimentDataRequest(this, experimentTRange); | |
148 | ||
149 | // initialize widget time boundaries and filtering parameters | |
150 | ModelUpdateInit(experimentTRange, adjustedTimeRange, this); | |
151 | } else { | |
152 | TraceDebug.debug("No selected experiment information available"); | |
153 | } | |
154 | } | |
155 | ||
156 | private void hookContextMenu() { | |
157 | MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$ | |
158 | menuMgr.setRemoveAllWhenShown(true); | |
159 | menuMgr.addMenuListener(new IMenuListener() { | |
160 | public void menuAboutToShow(IMenuManager manager) { | |
161 | ResourcesView.this.fillContextMenu(manager); | |
162 | } | |
163 | }); | |
164 | ||
165 | Menu menu = menuMgr.createContextMenu(tsfviewer.getControl()); | |
166 | tsfviewer.getControl().setMenu(menu); | |
167 | getSite() | |
168 | .registerContextMenu(menuMgr, tsfviewer.getSelectionProvider()); | |
169 | } | |
170 | ||
171 | private void contributeToActionBars() { | |
172 | IActionBars bars = getViewSite().getActionBars(); | |
173 | fillLocalPullDown(bars.getMenuManager()); | |
174 | fillLocalToolBar(bars.getToolBarManager()); | |
175 | } | |
176 | ||
177 | private void fillLocalPullDown(IMenuManager manager) { | |
178 | manager.add(new Separator()); | |
179 | // manager.add(showLegend); | |
180 | manager.add(new Separator()); | |
181 | manager.add(resetScale); | |
182 | manager.add(nextEvent); | |
183 | manager.add(prevEvent); | |
184 | manager.add(nextTrace); | |
185 | manager.add(prevTrace); | |
186 | // manager.add(filterTraces); | |
187 | manager.add(zoomIn); | |
188 | manager.add(zoomOut); | |
189 | manager.add(zoomFilter); | |
190 | manager.add(new Separator()); | |
191 | } | |
192 | ||
193 | private void fillContextMenu(IMenuManager manager) { | |
194 | // manager.add(showLegend); | |
195 | manager.add(new Separator()); | |
196 | manager.add(resetScale); | |
197 | manager.add(nextEvent); | |
198 | manager.add(prevEvent); | |
199 | manager.add(nextTrace); | |
200 | manager.add(prevTrace); | |
201 | // manager.add(showLegend); | |
202 | // manager.add(filterTraces); | |
203 | manager.add(zoomIn); | |
204 | manager.add(zoomOut); | |
205 | manager.add(zoomFilter); | |
206 | manager.add(new Separator()); | |
207 | manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); | |
208 | } | |
209 | ||
210 | private void fillLocalToolBar(IToolBarManager manager) { | |
211 | // manager.add(showLegend); | |
212 | manager.add(new Separator()); | |
213 | manager.add(resetScale); | |
214 | manager.add(nextEvent); | |
215 | manager.add(prevEvent); | |
216 | manager.add(nextTrace); | |
217 | manager.add(prevTrace); | |
218 | // manager.add(filterTraces); | |
219 | manager.add(zoomIn); | |
220 | manager.add(zoomOut); | |
221 | manager.add(zoomFilter); | |
222 | manager.add(new Separator()); | |
223 | } | |
224 | ||
225 | private void makeActions() { | |
226 | // action4 | |
227 | resetScale = new Action() { | |
228 | @Override | |
229 | public void run() { | |
230 | if (tsfviewer != null) { | |
231 | tsfviewer.resetStartFinishTime(); | |
232 | } | |
233 | ||
234 | } | |
235 | }; | |
236 | resetScale.setText(Messages.getString("ResourcesView.Action.Reset")); //$NON-NLS-1$ | |
237 | resetScale.setToolTipText(Messages | |
238 | .getString("ResourcesView.Action.Reset.ToolTip")); //$NON-NLS-1$ | |
239 | resetScale.setImageDescriptor(AbstractUIPlugin | |
240 | .imageDescriptorFromPlugin(Messages | |
241 | .getString("ResourcesView.tmf.UI"), | |
242 | "icons/home_nav.gif")); | |
243 | ||
244 | // action5 | |
245 | nextEvent = new Action() { | |
246 | @Override | |
247 | public void run() { | |
248 | if (tsfviewer != null) { | |
249 | tsfviewer.selectNextEvent(); | |
250 | } | |
251 | } | |
252 | }; | |
253 | nextEvent.setText(Messages.getString("ResourcesView.Action.NextEvent")); //$NON-NLS-1$ | |
254 | nextEvent.setToolTipText(Messages | |
255 | .getString("ResourcesView.Action.NextEvent.Tooltip")); //$NON-NLS-1$ | |
256 | nextEvent.setImageDescriptor(AbstractUIPlugin | |
257 | .imageDescriptorFromPlugin(Messages | |
258 | .getString("ResourcesView.tmf.UI"), | |
259 | "icons/next_event.gif")); | |
260 | ||
261 | // action6 | |
262 | prevEvent = new Action() { | |
263 | @Override | |
264 | public void run() { | |
265 | if (tsfviewer != null) { | |
266 | tsfviewer.selectPrevEvent(); | |
267 | } | |
268 | } | |
269 | }; | |
270 | prevEvent.setText(Messages.getString("ResourcesView.Action.PrevEvent")); //$NON-NLS-1$ | |
271 | prevEvent.setToolTipText(Messages | |
272 | .getString("ResourcesView.Action.PrevEvent.Tooltip")); //$NON-NLS-1$ | |
273 | prevEvent.setImageDescriptor(AbstractUIPlugin | |
274 | .imageDescriptorFromPlugin(Messages | |
275 | .getString("ResourcesView.tmf.UI"), | |
276 | "icons/prev_event.gif")); | |
277 | ||
278 | // action7 | |
279 | nextTrace = new Action() { | |
280 | @Override | |
281 | public void run() { | |
282 | if (tsfviewer != null) { | |
283 | tsfviewer.selectNextTrace(); | |
284 | } | |
285 | } | |
286 | }; | |
287 | nextTrace.setText(Messages | |
288 | .getString("ResourcesView.Action.NextResource")); //$NON-NLS-1$ | |
289 | nextTrace.setToolTipText(Messages | |
290 | .getString("ResourcesView.Action.NextResource.ToolTip")); //$NON-NLS-1$ | |
291 | nextTrace.setImageDescriptor(AbstractUIPlugin | |
292 | .imageDescriptorFromPlugin(Messages | |
293 | .getString("ResourcesView.tmf.UI"), | |
294 | "icons/next_item.gif")); | |
295 | ||
296 | // action8 | |
297 | prevTrace = new Action() { | |
298 | @Override | |
299 | public void run() { | |
300 | if (tsfviewer != null) { | |
301 | tsfviewer.selectPrevTrace(); | |
302 | } | |
303 | } | |
304 | }; | |
305 | prevTrace.setText(Messages | |
306 | .getString("ResourcesView.Action.PreviousResource")); //$NON-NLS-1$ | |
307 | prevTrace.setToolTipText(Messages | |
308 | .getString("ResourcesView.Action.PreviousResource.Tooltip")); //$NON-NLS-1$ | |
309 | prevTrace.setImageDescriptor(AbstractUIPlugin | |
310 | .imageDescriptorFromPlugin(Messages | |
311 | .getString("ResourcesView.tmf.UI"), | |
312 | "icons/prev_item.gif")); | |
313 | ||
314 | // action9 | |
315 | showLegend = new Action() { | |
316 | @Override | |
317 | public void run() { | |
318 | if (tsfviewer != null) { | |
319 | tsfviewer.showLegend(); | |
320 | } | |
321 | } | |
322 | }; | |
323 | showLegend.setText(Messages.getString("ResourcesView.Action.Legend")); //$NON-NLS-1$ | |
324 | showLegend.setToolTipText(Messages | |
325 | .getString("ResourcesView.Action.Legend.ToolTip")); //$NON-NLS-1$ | |
326 | ||
327 | // action10 | |
328 | filterTraces = new Action() { | |
329 | @Override | |
330 | public void run() { | |
331 | if (tsfviewer != null) { | |
332 | tsfviewer.filterTraces(); | |
333 | } | |
334 | } | |
335 | }; | |
336 | filterTraces.setText(Messages.getString("ResourcesView.Action.Filter")); //$NON-NLS-1$ | |
337 | filterTraces.setToolTipText(Messages | |
338 | .getString("ResourcesView.Action.Filter.ToolTip")); //$NON-NLS-1$ | |
339 | filterTraces.setImageDescriptor(AbstractUIPlugin | |
340 | .imageDescriptorFromPlugin(Messages | |
341 | .getString("ResourcesView.tmf.UI"), | |
342 | "icons/filter_items.gif")); | |
343 | ||
344 | // action10 | |
345 | zoomIn = new Action() { | |
346 | @Override | |
347 | public void run() { | |
348 | if (tsfviewer != null) { | |
349 | tsfviewer.zoomIn(); | |
350 | } | |
351 | } | |
352 | }; | |
353 | zoomIn.setText(Messages.getString("ResourcesView.Action.ZoomIn")); //$NON-NLS-1$ | |
354 | zoomIn.setToolTipText(Messages | |
355 | .getString("ResourcesView.Action.ZoomIn.Tooltip")); //$NON-NLS-1$ | |
356 | zoomIn.setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin( | |
357 | Messages.getString("ResourcesView.tmf.UI"), | |
358 | "icons/zoomin_nav.gif")); | |
359 | ||
360 | // action10 | |
361 | zoomOut = new Action() { | |
362 | @Override | |
363 | public void run() { | |
364 | if (tsfviewer != null) { | |
365 | tsfviewer.zoomOut(); | |
366 | } | |
367 | } | |
368 | }; | |
369 | zoomOut.setText(Messages.getString("ResourcesView.Action.ZoomOut")); //$NON-NLS-1$ | |
370 | zoomOut.setToolTipText(Messages | |
371 | .getString("ResourcesView.Action.ZoomOut.tooltip")); //$NON-NLS-1$ | |
372 | zoomOut.setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin( | |
373 | Messages.getString("ResourcesView.tmf.UI"), | |
374 | "icons/zoomout_nav.gif")); | |
375 | ||
376 | // zoomFilter | |
377 | zoomFilter = new Action() { | |
378 | @Override | |
379 | public void run() { | |
380 | // Nothing to do, however the selection status is needed by the | |
381 | // application | |
382 | } | |
383 | }; | |
384 | ||
385 | zoomFilter.setText(Messages.getString("ResourcesView.Action.ZoomFilter")); //$NON-NLS-1$ | |
386 | zoomFilter.setToolTipText(Messages.getString("ResourcesView.Action.ZoomFilter.tooltip")); //$NON-NLS-1$ | |
387 | zoomFilter.setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(Messages | |
388 | .getString("ResourcesView.tmf.UI"), "icons/filter_items.gif")); | |
389 | zoomFilter.setChecked(false); | |
390 | ||
391 | // PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_ELCL_SYNCED); | |
392 | } | |
393 | ||
394 | /** | |
395 | * Passing the focus request to the viewer's control. | |
396 | */ | |
397 | @Override | |
398 | public void setFocus() { | |
399 | tsfviewer.getControl().setFocus(); | |
400 | } | |
401 | ||
402 | /* | |
403 | * (non-Javadoc) | |
404 | * | |
405 | * @see org.eclipse.linuxtools.lttng.ui.views.common.AbsTimeUpdateView# | |
406 | * tsfTmProcessSelEvent | |
407 | * (org.eclipse.linuxtools.tmf.ui.viewers.timeAnalysis.TmfTimeSelectionEvent | |
408 | * ) | |
409 | */ | |
9aae0442 | 410 | @Override |
6e512b93 ASL |
411 | public void tsfTmProcessSelEvent(TmfTimeSelectionEvent event) { |
412 | // common implementation | |
413 | super.tsfTmProcessSelEvent(event); | |
414 | } | |
415 | ||
416 | /* | |
417 | * (non-Javadoc) | |
418 | * | |
419 | * @seeorg.eclipse.linuxtools.tmf.ui.viewers.timeAnalysis. | |
420 | * ITmfTimeScaleSelectionListener | |
421 | * #tsfTmProcessTimeScaleEvent(org.eclipse.linuxtools | |
422 | * .tmf.ui.viewers.timeAnalysis.TmfTimeScaleSelectionEvent) | |
423 | */ | |
9aae0442 | 424 | @Override |
6e512b93 ASL |
425 | public void tsfTmProcessTimeScaleEvent(TmfTimeScaleSelectionEvent event) { |
426 | super.tsfTmProcessTimeScaleEvent(event); | |
427 | } | |
428 | ||
429 | /* | |
430 | * (non-Javadoc) | |
431 | * | |
432 | * @see | |
433 | * org.eclipse.linuxtools.lttng.ui.views.common.AbsTimeUpdateView#displayModel | |
434 | * (org.eclipse.linuxtools.tmf.ui.viewers.timeAnalysis.model. | |
435 | * ITmfTimeAnalysisEntry[], long, long, boolean, long, long, | |
436 | * java.lang.Object) | |
437 | */ | |
9aae0442 | 438 | @Override |
6e512b93 ASL |
439 | public void displayModel(final ITmfTimeAnalysisEntry[] items, final long startBoundTime, |
440 | final long endBoundTime, final boolean updateTimeBounds, final long startVisibleWindow, | |
441 | final long endVisibleWindow, final Object source) { | |
442 | ||
443 | Display display = tsfviewer.getControl().getDisplay(); | |
444 | display.asyncExec(new Runnable() { | |
445 | ||
446 | public void run() { | |
447 | tsfviewer.display(items, startBoundTime, endBoundTime, updateTimeBounds); | |
448 | // validate visible boundaries | |
449 | if (startVisibleWindow > -1 && endVisibleWindow > -1) { | |
450 | tsfviewer.setSelectVisTimeWindow(startVisibleWindow, endVisibleWindow, source); | |
451 | } | |
452 | tsfviewer.resizeControls(); | |
453 | } | |
454 | }); | |
455 | } | |
456 | ||
457 | @Override | |
458 | public void dispose() { | |
459 | // dispose parent resources | |
460 | super.dispose(); | |
461 | ||
462 | tsfviewer.removeWidgetSelectionListner(this); | |
463 | tsfviewer.removeWidgetTimeScaleSelectionListner(this); | |
464 | tsfviewer = null; | |
465 | } | |
466 | ||
467 | /** | |
468 | * Registers as listener of time selection from other tmf views | |
469 | * | |
470 | * @param signal | |
471 | */ | |
9aae0442 | 472 | @Override |
6e512b93 ASL |
473 | @TmfSignalHandler |
474 | public void synchToTime(TmfTimeSynchSignal signal) { | |
475 | super.synchToTime(signal); | |
476 | } | |
477 | ||
478 | /** | |
479 | * Annotation Registers as listener of time range selection from other views | |
480 | * The implementation handles the entry of the signal. | |
481 | * | |
482 | * @param signal | |
483 | */ | |
484 | @TmfSignalHandler | |
485 | public void synchToTimeRange(TmfRangeSynchSignal signal) { | |
486 | if (zoomFilter != null) { | |
487 | synchToTimeRange(signal, zoomFilter.isChecked()); | |
488 | } | |
489 | } | |
490 | ||
491 | @Override | |
492 | public void modelIncomplete(ILttngSyntEventRequest request) { | |
493 | // Nothing to do | |
494 | // The data will be refreshed on the next request | |
495 | } | |
496 | ||
497 | /* | |
498 | * (non-Javadoc) | |
499 | * | |
500 | * @see org.eclipse.linuxtools.lttng.ui.views.common.AbsTimeUpdateView# | |
501 | * getEventProcessor() | |
502 | */ | |
503 | @Override | |
504 | public ITransEventProcessor getEventProcessor() { | |
505 | return ResourcesEventToHandlerFactory.getInstance(); | |
506 | } | |
507 | ||
508 | /** | |
509 | * @param signal | |
510 | */ | |
511 | @TmfSignalHandler | |
512 | public void experimentSelected(TmfExperimentSelectedSignal<? extends TmfEvent> signal) { | |
513 | if (signal != null) { | |
514 | TmfTimeRange experimentTRange = signal.getExperiment().getTimeRange(); | |
515 | ||
516 | // prepare time intervals in widget | |
517 | ModelUpdateInit(experimentTRange, experimentTRange, signal.getSource()); | |
518 | ||
519 | // request initial data | |
520 | initialExperimentDataRequest(signal.getSource(), experimentTRange); | |
521 | } | |
522 | } | |
523 | ||
524 | /** | |
525 | * @param source | |
526 | * @param experimentTRange | |
527 | * @return Adjusted time window used for the request (smaller window to | |
528 | * initialize view) | |
529 | */ | |
530 | private TmfTimeRange initialExperimentDataRequest(Object source, TmfTimeRange experimentTRange) { | |
531 | // Adjust the initial time window to a shorter interval to allow | |
532 | // user to select the interesting area based on the perspective | |
533 | TmfTimeRange initTimeWindow = getInitTRange(experimentTRange); | |
534 | ||
535 | dataRequest(initTimeWindow, experimentTRange, true); | |
536 | if (TraceDebug.isDEBUG()) { | |
537 | TraceDebug.debug("Initialization request time range is: " + initTimeWindow.getStartTime().toString() + "-" | |
538 | + initTimeWindow.getEndTime().toString()); | |
539 | } | |
540 | ||
541 | return initTimeWindow; | |
542 | } | |
543 | ||
544 | /* | |
545 | * (non-Javadoc) | |
546 | * | |
547 | * @see org.eclipse.linuxtools.lttng.ui.views.common.AbsTimeUpdateView# | |
548 | * getParamsUpdater() | |
549 | */ | |
9aae0442 | 550 | @Override |
6e512b93 ASL |
551 | protected ParamsUpdater getParamsUpdater() { |
552 | return ResourceModelFactory.getParamsUpdater(); | |
553 | } | |
554 | ||
555 | /* | |
556 | * (non-Javadoc) | |
557 | * | |
558 | * @see org.eclipse.linuxtools.lttng.ui.views.common.AbsTimeUpdateView# | |
559 | * getItemContainer() | |
560 | */ | |
561 | @Override | |
562 | protected ItemContainer<?> getItemContainer() { | |
563 | return ResourceModelFactory.getResourceContainer(); | |
564 | } | |
565 | } |