1 /*******************************************************************************
2 * Copyright (c) 2010, 2014 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 * Geneviève Bastien - Experiment instantiated with experiment type
12 *******************************************************************************/
14 package org
.eclipse
.linuxtools
.tmf
.ui
.editors
;
16 import java
.lang
.reflect
.Constructor
;
17 import java
.lang
.reflect
.InvocationTargetException
;
19 import org
.eclipse
.core
.resources
.IFile
;
20 import org
.eclipse
.core
.resources
.IMarker
;
21 import org
.eclipse
.core
.resources
.IMarkerDelta
;
22 import org
.eclipse
.core
.resources
.IResource
;
23 import org
.eclipse
.core
.resources
.IResourceChangeEvent
;
24 import org
.eclipse
.core
.resources
.IResourceChangeListener
;
25 import org
.eclipse
.core
.resources
.IResourceDelta
;
26 import org
.eclipse
.core
.resources
.ResourcesPlugin
;
27 import org
.eclipse
.core
.runtime
.CoreException
;
28 import org
.eclipse
.core
.runtime
.IConfigurationElement
;
29 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
30 import org
.eclipse
.core
.runtime
.InvalidRegistryObjectException
;
31 import org
.eclipse
.core
.runtime
.ListenerList
;
32 import org
.eclipse
.core
.runtime
.Platform
;
33 import org
.eclipse
.jface
.action
.IStatusLineManager
;
34 import org
.eclipse
.jface
.util
.SafeRunnable
;
35 import org
.eclipse
.jface
.viewers
.ISelection
;
36 import org
.eclipse
.jface
.viewers
.ISelectionChangedListener
;
37 import org
.eclipse
.jface
.viewers
.ISelectionProvider
;
38 import org
.eclipse
.jface
.viewers
.SelectionChangedEvent
;
39 import org
.eclipse
.jface
.viewers
.StructuredSelection
;
40 import org
.eclipse
.linuxtools
.internal
.tmf
.ui
.Activator
;
41 import org
.eclipse
.linuxtools
.internal
.tmf
.ui
.parsers
.custom
.CustomEventsTable
;
42 import org
.eclipse
.linuxtools
.tmf
.core
.TmfCommonConstants
;
43 import org
.eclipse
.linuxtools
.tmf
.core
.parsers
.custom
.CustomTxtTrace
;
44 import org
.eclipse
.linuxtools
.tmf
.core
.parsers
.custom
.CustomXmlTrace
;
45 import org
.eclipse
.linuxtools
.tmf
.core
.project
.model
.TmfTraceType
.TraceElementType
;
46 import org
.eclipse
.linuxtools
.tmf
.core
.signal
.TmfSignalHandler
;
47 import org
.eclipse
.linuxtools
.tmf
.core
.signal
.TmfTimestampFormatUpdateSignal
;
48 import org
.eclipse
.linuxtools
.tmf
.core
.signal
.TmfTraceClosedSignal
;
49 import org
.eclipse
.linuxtools
.tmf
.core
.signal
.TmfTraceOpenedSignal
;
50 import org
.eclipse
.linuxtools
.tmf
.core
.signal
.TmfTraceSelectedSignal
;
51 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.ITmfContext
;
52 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.ITmfTrace
;
53 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.TmfExperiment
;
54 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.TmfTrace
;
55 import org
.eclipse
.linuxtools
.tmf
.ui
.project
.model
.ITmfProjectModelElement
;
56 import org
.eclipse
.linuxtools
.tmf
.ui
.project
.model
.Messages
;
57 import org
.eclipse
.linuxtools
.tmf
.ui
.project
.model
.TmfExperimentElement
;
58 import org
.eclipse
.linuxtools
.tmf
.ui
.project
.model
.TmfOpenTraceHelper
;
59 import org
.eclipse
.linuxtools
.tmf
.ui
.project
.model
.TmfProjectElement
;
60 import org
.eclipse
.linuxtools
.tmf
.ui
.project
.model
.TmfProjectRegistry
;
61 import org
.eclipse
.linuxtools
.tmf
.ui
.project
.model
.TmfTraceElement
;
62 import org
.eclipse
.linuxtools
.tmf
.ui
.project
.model
.TmfTraceTypeUIUtils
;
63 import org
.eclipse
.linuxtools
.tmf
.ui
.viewers
.events
.TmfEventsTable
;
64 import org
.eclipse
.swt
.widgets
.Composite
;
65 import org
.eclipse
.swt
.widgets
.Display
;
66 import org
.eclipse
.ui
.IEditorInput
;
67 import org
.eclipse
.ui
.IEditorPart
;
68 import org
.eclipse
.ui
.IEditorSite
;
69 import org
.eclipse
.ui
.IFileEditorInput
;
70 import org
.eclipse
.ui
.IPartListener
;
71 import org
.eclipse
.ui
.IPropertyListener
;
72 import org
.eclipse
.ui
.IReusableEditor
;
73 import org
.eclipse
.ui
.IWorkbenchPart
;
74 import org
.eclipse
.ui
.PartInitException
;
75 import org
.eclipse
.ui
.ide
.IGotoMarker
;
76 import org
.eclipse
.ui
.part
.FileEditorInput
;
77 import org
.eclipse
.ui
.views
.properties
.IPropertySheetPage
;
78 import org
.osgi
.framework
.Bundle
;
81 * Editor for TMF events
84 * @author Patrick Tasse
87 public class TmfEventsEditor
extends TmfEditor
implements ITmfTraceEditor
, IReusableEditor
, IPropertyListener
, IResourceChangeListener
, ISelectionProvider
, ISelectionChangedListener
, IPartListener
, IGotoMarker
{
89 /** ID for this class */
90 public static final String ID
= "org.eclipse.linuxtools.tmf.ui.editors.events"; //$NON-NLS-1$
92 private TmfEventsTable fEventsTable
;
94 private ITmfTrace fTrace
;
95 private Composite fParent
;
96 private ListenerList fSelectionChangedListeners
= new ListenerList();
97 private boolean fTraceSelected
;
98 private IMarker fPendingGotoMarker
;
101 public void doSave(final IProgressMonitor monitor
) {
105 public void doSaveAs() {
109 public void init(final IEditorSite site
, IEditorInput input
) throws PartInitException
{
110 IFileEditorInput fileEditorInput
;
111 if (input
instanceof TmfEditorInput
) {
112 fFile
= ((TmfEditorInput
) input
).getFile();
113 fTrace
= ((TmfEditorInput
) input
).getTrace();
114 /* change the input to a FileEditorInput to allow open handlers to find this editor */
115 fileEditorInput
= new FileEditorInput(fFile
);
116 } else if (input
instanceof IFileEditorInput
) {
117 fileEditorInput
= (IFileEditorInput
) input
;
118 fFile
= fileEditorInput
.getFile();
120 throw new PartInitException("Invalid IFileEditorInput: " + fileEditorInput
); //$NON-NLS-1$
123 final String traceTypeId
= fFile
.getPersistentProperty(TmfCommonConstants
.TRACETYPE
);
124 if (traceTypeId
== null) {
125 throw new PartInitException(Messages
.TmfOpenTraceHelper_NoTraceType
);
127 if (traceTypeId
.equals(TmfExperiment
.class.getCanonicalName())) {
128 // Special case: experiment bookmark resource
129 final TmfProjectElement project
= TmfProjectRegistry
.getProject(fFile
.getProject(), true);
130 if (project
== null) {
131 throw new PartInitException(Messages
.TmfOpenTraceHelper_NoTraceType
);
133 for (final ITmfProjectModelElement projectElement
: project
.getExperimentsFolder().getChildren()) {
134 final String traceName
= fFile
.getParent().getName();
135 if (projectElement
.getName().equals(traceName
)) {
136 final TmfExperimentElement experimentElement
= (TmfExperimentElement
) projectElement
;
137 setPartName(experimentElement
.getName());
139 super.setInput(fileEditorInput
);
140 TmfOpenTraceHelper
.reopenTraceFromElement(experimentElement
, this);
144 } else if (traceTypeId
.equals(TmfTrace
.class.getCanonicalName())) {
145 // Special case: trace bookmark resource
146 final TmfProjectElement project
= TmfProjectRegistry
.getProject(fFile
.getProject(), true);
147 for (final ITmfProjectModelElement projectElement
: project
.getTracesFolder().getChildren()) {
148 final String traceName
= fFile
.getParent().getName();
149 if (projectElement
.getName().equals(traceName
)) {
150 final TmfTraceElement traceElement
= (TmfTraceElement
) projectElement
;
151 setPartName(traceElement
.getName());
153 super.setInput(fileEditorInput
);
154 TmfOpenTraceHelper
.reopenTraceFromElement(traceElement
, this);
159 final TmfProjectElement project
= TmfProjectRegistry
.getProject(fFile
.getProject(), true);
160 for (final ITmfProjectModelElement projectElement
: project
.getTracesFolder().getChildren()) {
161 if (projectElement
.getResource().equals(fFile
)) {
162 final TmfTraceElement traceElement
= (TmfTraceElement
) projectElement
;
163 setPartName(traceElement
.getName());
165 super.setInput(fileEditorInput
);
166 TmfOpenTraceHelper
.reopenTraceFromElement(traceElement
, this);
171 } catch (final PartInitException e
) {
173 } catch (final InvalidRegistryObjectException e
) {
174 Activator
.getDefault().logError("Error initializing TmfEventsEditor", e
); //$NON-NLS-1$
175 } catch (final CoreException e
) {
176 Activator
.getDefault().logError("Error initializing TmfEventsEditor", e
); //$NON-NLS-1$
179 throw new PartInitException("Invalid IEditorInput: " + input
.getClass()); //$NON-NLS-1$
181 if (fTrace
== null) {
182 throw new PartInitException("Invalid IEditorInput: " + fFile
.getName()); //$NON-NLS-1$
185 super.setInput(fileEditorInput
);
189 public boolean isDirty() {
194 public boolean isSaveAsAllowed() {
199 public void setInput(final IEditorInput input
) {
200 super.setInput(input
);
201 firePropertyChange(IEditorPart
.PROP_INPUT
);
205 public void propertyChanged(final Object source
, final int propId
) {
206 if (propId
== IEditorPart
.PROP_INPUT
&& getEditorInput() instanceof TmfEditorInput
) {
207 if (fTrace
!= null) {
208 broadcast(new TmfTraceClosedSignal(this, fTrace
));
210 fTraceSelected
= false;
211 fFile
= ((TmfEditorInput
) getEditorInput()).getFile();
212 fTrace
= ((TmfEditorInput
) getEditorInput()).getTrace();
213 /* change the input to a FileEditorInput to allow open handlers to find this editor */
214 super.setInput(new FileEditorInput(fFile
));
215 fEventsTable
.dispose();
216 if (fTrace
!= null) {
217 setPartName(fTrace
.getName());
218 fEventsTable
= createEventsTable(fParent
, fTrace
.getCacheSize());
219 fEventsTable
.addSelectionChangedListener(this);
220 fEventsTable
.setTrace(fTrace
, true);
221 fEventsTable
.refreshBookmarks(fFile
);
222 if (fPendingGotoMarker
!= null) {
223 fEventsTable
.gotoMarker(fPendingGotoMarker
);
224 fPendingGotoMarker
= null;
227 /* ensure start time is set */
228 final ITmfContext context
= fTrace
.seekEvent(0);
229 fTrace
.getNext(context
);
232 broadcast(new TmfTraceOpenedSignal(this, fTrace
, fFile
));
234 setPartName(getEditorInput().getName());
235 fEventsTable
= new TmfEventsTable(fParent
, 0);
236 fEventsTable
.addSelectionChangedListener(this);
243 public void createPartControl(final Composite parent
) {
245 if (fTrace
!= null) {
246 setPartName(fTrace
.getName());
247 fEventsTable
= createEventsTable(parent
, fTrace
.getCacheSize());
248 fEventsTable
.addSelectionChangedListener(this);
249 fEventsTable
.setTrace(fTrace
, true);
250 fEventsTable
.refreshBookmarks(fFile
);
252 /* ensure start time is set */
253 final ITmfContext context
= fTrace
.seekEvent(0);
254 fTrace
.getNext(context
);
257 broadcast(new TmfTraceOpenedSignal(this, fTrace
, fFile
));
259 fEventsTable
= new TmfEventsTable(parent
, 0);
260 fEventsTable
.addSelectionChangedListener(this);
262 IStatusLineManager statusLineManager
= getEditorSite().getActionBars().getStatusLineManager();
263 fEventsTable
.setStatusLineManager(statusLineManager
);
264 addPropertyListener(this);
265 ResourcesPlugin
.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent
.POST_CHANGE
);
266 // we need to wrap the ISelectionProvider interface in the editor because
267 // the events table can be replaced later while the selection changed listener
268 // is only added once by the platform to the selection provider set here
269 getSite().setSelectionProvider(this);
270 getSite().getPage().addPartListener(this);
274 public void dispose() {
275 if (getSite() != null) {
276 getSite().getPage().removePartListener(this);
278 ResourcesPlugin
.getWorkspace().removeResourceChangeListener(this);
279 removePropertyListener(this);
280 if (fTrace
!= null) {
281 broadcast(new TmfTraceClosedSignal(this, fTrace
));
283 if (fEventsTable
!= null) {
284 fEventsTable
.dispose();
290 * Create the events table
292 * @param parent the parent composite
293 * @param cacheSize the cache size
294 * @return an events table instance
296 protected TmfEventsTable
createEventsTable(final Composite parent
, final int cacheSize
) {
297 TmfEventsTable eventsTable
= getEventsTable(parent
, cacheSize
);
298 if (eventsTable
== null) {
299 eventsTable
= new TmfEventsTable(parent
, cacheSize
);
304 private TmfEventsTable
getEventsTable(final Composite parent
, final int cacheSize
) {
305 TmfEventsTable eventsTable
= null;
307 if (fTrace
.getResource() == null) {
310 final String traceType
= fTrace
.getResource().getPersistentProperty(TmfCommonConstants
.TRACETYPE
);
311 if (traceType
== null) {
314 if (traceType
.startsWith(CustomTxtTrace
.class.getCanonicalName())) {
315 return new CustomEventsTable(((CustomTxtTrace
) fTrace
).getDefinition(), parent
, cacheSize
);
317 if (traceType
.startsWith(CustomXmlTrace
.class.getCanonicalName())) {
318 return new CustomEventsTable(((CustomXmlTrace
) fTrace
).getDefinition(), parent
, cacheSize
);
320 TraceElementType type
= TraceElementType
.TRACE
;
321 if (fTrace
instanceof TmfExperiment
) {
322 type
= TraceElementType
.EXPERIMENT
;
324 for (final IConfigurationElement ce
: TmfTraceTypeUIUtils
.getTypeUIElements(type
)) {
325 if (ce
.getAttribute(TmfTraceTypeUIUtils
.TRACETYPE_ATTR
).equals(traceType
)) {
326 final IConfigurationElement
[] eventsTableTypeCE
= ce
.getChildren(TmfTraceTypeUIUtils
.EVENTS_TABLE_TYPE_ELEM
);
328 if (eventsTableTypeCE
.length
!= 1) {
331 final String eventsTableType
= eventsTableTypeCE
[0].getAttribute(TmfTraceTypeUIUtils
.CLASS_ATTR
);
332 if ((eventsTableType
== null) || (eventsTableType
.length() == 0)) {
335 final Bundle bundle
= Platform
.getBundle(ce
.getContributor().getName());
336 final Class
<?
> c
= bundle
.loadClass(eventsTableType
);
337 final Class
<?
>[] constructorArgs
= new Class
[] { Composite
.class, int.class };
338 final Constructor
<?
> constructor
= c
.getConstructor(constructorArgs
);
339 final Object
[] args
= new Object
[] { parent
, cacheSize
};
340 eventsTable
= (TmfEventsTable
) constructor
.newInstance(args
);
344 if (fTrace
instanceof TmfExperiment
&& (eventsTable
== null)) {
345 eventsTable
= getExperimentEventsTable((TmfExperiment
) fTrace
, parent
, cacheSize
);
347 } catch (final InvalidRegistryObjectException e
) {
348 Activator
.getDefault().logError("Error getting TmfEventsTable", e
); //$NON-NLS-1$
349 } catch (final CoreException e
) {
350 Activator
.getDefault().logError("Error getting TmfEventsTable", e
); //$NON-NLS-1$
351 } catch (final ClassNotFoundException e
) {
352 Activator
.getDefault().logError("Error getting TmfEventsTable", e
); //$NON-NLS-1$
353 } catch (final SecurityException e
) {
354 Activator
.getDefault().logError("Error getting TmfEventsTable", e
); //$NON-NLS-1$
355 } catch (final NoSuchMethodException e
) {
356 Activator
.getDefault().logError("Error getting TmfEventsTable", e
); //$NON-NLS-1$
357 } catch (final IllegalArgumentException e
) {
358 Activator
.getDefault().logError("Error getting TmfEventsTable", e
); //$NON-NLS-1$
359 } catch (final InstantiationException e
) {
360 Activator
.getDefault().logError("Error getting TmfEventsTable", e
); //$NON-NLS-1$
361 } catch (final IllegalAccessException e
) {
362 Activator
.getDefault().logError("Error getting TmfEventsTable", e
); //$NON-NLS-1$
363 } catch (final InvocationTargetException e
) {
364 Activator
.getDefault().logError("Error getting TmfEventsTable", e
); //$NON-NLS-1$
370 * Get the events table for an experiment. If all traces in the experiment
371 * are of the same type, use the extension point specified event table
376 * the parent Composite
378 * the event table cache size
379 * @return an events table of the appropriate type
381 private static TmfEventsTable
getExperimentEventsTable(
382 final TmfExperiment experiment
, final Composite parent
,
383 final int cacheSize
) {
384 TmfEventsTable eventsTable
= null;
385 String commonTraceType
= null;
387 for (final ITmfTrace trace
: experiment
.getTraces()) {
388 final IResource resource
= trace
.getResource();
389 if (resource
== null) {
392 final String traceType
= resource
.getPersistentProperty(TmfCommonConstants
.TRACETYPE
);
393 if ((commonTraceType
!= null) && !commonTraceType
.equals(traceType
)) {
396 commonTraceType
= traceType
;
398 if (commonTraceType
== null) {
401 if (commonTraceType
.startsWith(CustomTxtTrace
.class.getCanonicalName())) {
402 return new CustomEventsTable(((CustomTxtTrace
) experiment
.getTraces()[0]).getDefinition(), parent
, cacheSize
);
404 if (commonTraceType
.startsWith(CustomXmlTrace
.class.getCanonicalName())) {
405 return new CustomEventsTable(((CustomXmlTrace
) experiment
.getTraces()[0]).getDefinition(), parent
, cacheSize
);
407 for (final IConfigurationElement ce
: TmfTraceTypeUIUtils
.getTypeUIElements(TraceElementType
.TRACE
)) {
408 if (ce
.getAttribute(TmfTraceTypeUIUtils
.TRACETYPE_ATTR
).equals(commonTraceType
)) {
409 final IConfigurationElement
[] eventsTableTypeCE
= ce
.getChildren(TmfTraceTypeUIUtils
.EVENTS_TABLE_TYPE_ELEM
);
410 if (eventsTableTypeCE
.length
!= 1) {
413 final String eventsTableType
= eventsTableTypeCE
[0].getAttribute(TmfTraceTypeUIUtils
.CLASS_ATTR
);
414 if ((eventsTableType
== null) || (eventsTableType
.length() == 0)) {
417 final Bundle bundle
= Platform
.getBundle(ce
.getContributor().getName());
418 final Class
<?
> c
= bundle
.loadClass(eventsTableType
);
419 final Class
<?
>[] constructorArgs
= new Class
[] { Composite
.class, int.class };
420 final Constructor
<?
> constructor
= c
.getConstructor(constructorArgs
);
421 final Object
[] args
= new Object
[] { parent
, cacheSize
};
422 eventsTable
= (TmfEventsTable
) constructor
.newInstance(args
);
426 } catch (final CoreException e
) {
427 Activator
.getDefault().logError("Error getting TmfEventsTable for experiment", e
); //$NON-NLS-1$
428 } catch (final InvalidRegistryObjectException e
) {
429 Activator
.getDefault().logError("Error getting TmfEventsTable for experiment", e
); //$NON-NLS-1$
430 } catch (final SecurityException e
) {
431 Activator
.getDefault().logError("Error getting TmfEventsTable for experiment", e
); //$NON-NLS-1$
432 } catch (final IllegalArgumentException e
) {
433 Activator
.getDefault().logError("Error getting TmfEventsTable for experiment", e
); //$NON-NLS-1$
434 } catch (final ClassNotFoundException e
) {
435 Activator
.getDefault().logError("Error getting TmfEventsTable for experiment", e
); //$NON-NLS-1$
436 } catch (final NoSuchMethodException e
) {
437 Activator
.getDefault().logError("Error getting TmfEventsTable for experiment", e
); //$NON-NLS-1$
438 } catch (final InstantiationException e
) {
439 Activator
.getDefault().logError("Error getting TmfEventsTable for experiment", e
); //$NON-NLS-1$
440 } catch (final IllegalAccessException e
) {
441 Activator
.getDefault().logError("Error getting TmfEventsTable for experiment", e
); //$NON-NLS-1$
442 } catch (final InvocationTargetException e
) {
443 Activator
.getDefault().logError("Error getting TmfEventsTable for experiment", e
); //$NON-NLS-1$
449 public ITmfTrace
getTrace() {
454 public void setFocus() {
455 fEventsTable
.setFocus();
459 public Object
getAdapter(final Class adapter
) {
460 if (IGotoMarker
.class.equals(adapter
)) {
461 if (fTrace
== null || fEventsTable
== null) {
465 } else if (IPropertySheetPage
.class.equals(adapter
)) {
466 return new UnsortedPropertySheetPage();
468 return super.getAdapter(adapter
);
475 public void gotoMarker(IMarker marker
) {
476 if (fTrace
== null || fEventsTable
== null) {
477 fPendingGotoMarker
= marker
;
479 fEventsTable
.gotoMarker(marker
);
484 public void resourceChanged(final IResourceChangeEvent event
) {
485 for (final IMarkerDelta delta
: event
.findMarkerDeltas(IMarker
.BOOKMARK
, false)) {
486 if (delta
.getResource().equals(fFile
)) {
487 if (delta
.getKind() == IResourceDelta
.REMOVED
) {
488 final IMarker bookmark
= delta
.getMarker();
489 Display
.getDefault().asyncExec(new Runnable() {
492 fEventsTable
.removeBookmark(bookmark
);
495 } else if (delta
.getKind() == IResourceDelta
.CHANGED
) {
496 Display
.getDefault().asyncExec(new Runnable() {
499 fEventsTable
.getTable().refresh();
507 // ------------------------------------------------------------------------
508 // ISelectionProvider
509 // ------------------------------------------------------------------------
515 public void addSelectionChangedListener(ISelectionChangedListener listener
) {
516 fSelectionChangedListeners
.add(listener
);
523 public ISelection
getSelection() {
524 if (fEventsTable
== null) {
525 return StructuredSelection
.EMPTY
;
527 return fEventsTable
.getSelection();
534 public void removeSelectionChangedListener(ISelectionChangedListener listener
) {
535 fSelectionChangedListeners
.remove(listener
);
542 public void setSelection(ISelection selection
) {
547 * Notifies any selection changed listeners that the viewer's selection has changed.
548 * Only listeners registered at the time this method is called are notified.
550 * @param event a selection changed event
552 * @see ISelectionChangedListener#selectionChanged
555 protected void fireSelectionChanged(final SelectionChangedEvent event
) {
556 Object
[] listeners
= fSelectionChangedListeners
.getListeners();
557 for (int i
= 0; i
< listeners
.length
; ++i
) {
558 final ISelectionChangedListener l
= (ISelectionChangedListener
) listeners
[i
];
559 SafeRunnable
.run(new SafeRunnable() {
562 l
.selectionChanged(event
);
568 // ------------------------------------------------------------------------
569 // ISelectionChangedListener
570 // ------------------------------------------------------------------------
576 public void selectionChanged(SelectionChangedEvent event
) {
577 fireSelectionChanged(event
);
580 // ------------------------------------------------------------------------
582 // ------------------------------------------------------------------------
588 public void partActivated(IWorkbenchPart part
) {
589 if (part
== this && fTrace
!= null) {
590 if (fTraceSelected
) {
593 fTraceSelected
= true;
594 broadcast(new TmfTraceSelectedSignal(this, fTrace
));
602 public void partBroughtToTop(IWorkbenchPart part
) {
603 if (part
== this && fTrace
!= null) {
604 if (fTraceSelected
) {
607 fTraceSelected
= true;
608 broadcast(new TmfTraceSelectedSignal(this, fTrace
));
616 public void partClosed(IWorkbenchPart part
) {
623 public void partDeactivated(IWorkbenchPart part
) {
630 public void partOpened(IWorkbenchPart part
) {
633 // ------------------------------------------------------------------------
635 // ------------------------------------------------------------------------
640 public void addBookmark() {
641 fEventsTable
.addBookmark(fFile
);
645 // ------------------------------------------------------------------------
647 // ------------------------------------------------------------------------
650 * Handler for the Trace Selected signal
652 * @param signal The incoming signal
655 public void traceSelected(final TmfTraceSelectedSignal signal
) {
656 if ((signal
.getSource() != this)) {
657 if (signal
.getTrace().equals(fTrace
)) {
658 getSite().getPage().bringToTop(this);
660 fTraceSelected
= false;
666 * Update the display to use the updated timestamp format
668 * @param signal the incoming signal
672 public void timestampFormatUpdated(TmfTimestampFormatUpdateSignal signal
) {
673 if (fEventsTable
!= null) {
674 fEventsTable
.refresh();