1 /*******************************************************************************
2 * Copyright (c) 2010, 2013 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 * Francois Chouinard - Initial API and implementation
11 * Bernd Hufmann - Added supplementary files handling
12 * Geneviève Bastien - Moved supplementary files handling to parent class,
13 * added code to copy trace
14 * Patrick Tasse - Close editors to release resources
15 * Jean-Christian Kouame - added trace properties to be shown into
17 *******************************************************************************/
19 package org
.eclipse
.linuxtools
.tmf
.ui
.project
.model
;
21 import java
.io
.ByteArrayInputStream
;
22 import java
.io
.InputStream
;
23 import java
.util
.ArrayList
;
24 import java
.util
.Arrays
;
25 import java
.util
.HashMap
;
26 import java
.util
.List
;
29 import org
.eclipse
.core
.resources
.IFile
;
30 import org
.eclipse
.core
.resources
.IFolder
;
31 import org
.eclipse
.core
.resources
.IResource
;
32 import org
.eclipse
.core
.resources
.ResourcesPlugin
;
33 import org
.eclipse
.core
.runtime
.CoreException
;
34 import org
.eclipse
.core
.runtime
.IConfigurationElement
;
35 import org
.eclipse
.core
.runtime
.IPath
;
36 import org
.eclipse
.core
.runtime
.Platform
;
37 import org
.eclipse
.linuxtools
.internal
.tmf
.ui
.Activator
;
38 import org
.eclipse
.linuxtools
.internal
.tmf
.ui
.parsers
.custom
.CustomTxtEvent
;
39 import org
.eclipse
.linuxtools
.internal
.tmf
.ui
.parsers
.custom
.CustomTxtTrace
;
40 import org
.eclipse
.linuxtools
.internal
.tmf
.ui
.parsers
.custom
.CustomTxtTraceDefinition
;
41 import org
.eclipse
.linuxtools
.internal
.tmf
.ui
.parsers
.custom
.CustomXmlEvent
;
42 import org
.eclipse
.linuxtools
.internal
.tmf
.ui
.parsers
.custom
.CustomXmlTrace
;
43 import org
.eclipse
.linuxtools
.internal
.tmf
.ui
.parsers
.custom
.CustomXmlTraceDefinition
;
44 import org
.eclipse
.linuxtools
.tmf
.core
.TmfCommonConstants
;
45 import org
.eclipse
.linuxtools
.tmf
.core
.analysis
.IAnalysisModuleHelper
;
46 import org
.eclipse
.linuxtools
.tmf
.core
.analysis
.TmfAnalysisManager
;
47 import org
.eclipse
.linuxtools
.tmf
.core
.event
.ITmfEvent
;
48 import org
.eclipse
.linuxtools
.tmf
.core
.signal
.TmfSignalHandler
;
49 import org
.eclipse
.linuxtools
.tmf
.core
.signal
.TmfSignalManager
;
50 import org
.eclipse
.linuxtools
.tmf
.core
.signal
.TmfTraceOpenedSignal
;
51 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.ITmfTrace
;
52 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.ITmfTraceProperties
;
53 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.TmfTrace
;
54 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.TmfTraceManager
;
55 import org
.eclipse
.linuxtools
.tmf
.ui
.editors
.TmfEventsEditor
;
56 import org
.eclipse
.linuxtools
.tmf
.ui
.properties
.ReadOnlyTextPropertyDescriptor
;
57 import org
.eclipse
.ui
.IActionFilter
;
58 import org
.eclipse
.ui
.IEditorReference
;
59 import org
.eclipse
.ui
.IWorkbench
;
60 import org
.eclipse
.ui
.IWorkbenchPage
;
61 import org
.eclipse
.ui
.IWorkbenchWindow
;
62 import org
.eclipse
.ui
.PartInitException
;
63 import org
.eclipse
.ui
.PlatformUI
;
64 import org
.eclipse
.ui
.part
.FileEditorInput
;
65 import org
.eclipse
.ui
.views
.properties
.IPropertyDescriptor
;
66 import org
.eclipse
.ui
.views
.properties
.IPropertySource2
;
69 * Implementation of trace model element representing a trace. It provides
70 * methods to instantiate <code>ITmfTrace</code> and <code>ITmfEvent</code> as
71 * well as editor ID from the trace type extension definition.
74 * @author Francois Chouinard
76 public class TmfTraceElement
extends TmfWithFolderElement
implements IActionFilter
, IPropertySource2
{
78 // ------------------------------------------------------------------------
80 // ------------------------------------------------------------------------
84 * Bundle attribute name
86 public static final String BUNDLE
= "bundle"; //$NON-NLS-1$
88 * IsLinked attribute name.
90 public static final String IS_LINKED
= "isLinked"; //$NON-NLS-1$
92 // Property View stuff
93 private static final String sfResourcePropertiesCategory
= Messages
.TmfTraceElement_ResourceProperties
;
94 private static final String sfName
= Messages
.TmfTraceElement_Name
;
95 private static final String sfPath
= Messages
.TmfTraceElement_Path
;
96 private static final String sfLocation
= Messages
.TmfTraceElement_Location
;
97 private static final String sfEventType
= Messages
.TmfTraceElement_EventType
;
98 private static final String sfIsLinked
= Messages
.TmfTraceElement_IsLinked
;
99 private static final String sfTracePropertiesCategory
= Messages
.TmfTraceElement_TraceProperties
;
101 private static final ReadOnlyTextPropertyDescriptor sfNameDescriptor
= new ReadOnlyTextPropertyDescriptor(sfName
, sfName
);
102 private static final ReadOnlyTextPropertyDescriptor sfPathDescriptor
= new ReadOnlyTextPropertyDescriptor(sfPath
, sfPath
);
103 private static final ReadOnlyTextPropertyDescriptor sfLocationDescriptor
= new ReadOnlyTextPropertyDescriptor(sfLocation
, sfLocation
);
104 private static final ReadOnlyTextPropertyDescriptor sfTypeDescriptor
= new ReadOnlyTextPropertyDescriptor(sfEventType
, sfEventType
);
105 private static final ReadOnlyTextPropertyDescriptor sfIsLinkedDescriptor
= new ReadOnlyTextPropertyDescriptor(sfIsLinked
, sfIsLinked
);
107 private static final IPropertyDescriptor
[] sfDescriptors
= { sfNameDescriptor
, sfPathDescriptor
, sfLocationDescriptor
,
108 sfTypeDescriptor
, sfIsLinkedDescriptor
};
111 sfNameDescriptor
.setCategory(sfResourcePropertiesCategory
);
112 sfPathDescriptor
.setCategory(sfResourcePropertiesCategory
);
113 sfLocationDescriptor
.setCategory(sfResourcePropertiesCategory
);
114 sfTypeDescriptor
.setCategory(sfResourcePropertiesCategory
);
115 sfIsLinkedDescriptor
.setCategory(sfResourcePropertiesCategory
);
118 private static final String BOOKMARKS_HIDDEN_FILE
= ".bookmarks"; //$NON-NLS-1$
120 // ------------------------------------------------------------------------
122 // ------------------------------------------------------------------------
124 // This trace type ID as defined in plugin.xml
125 private String fTraceTypeId
= null;
127 // ------------------------------------------------------------------------
128 // Static initialization
129 // ------------------------------------------------------------------------
131 // The mapping of available trace type IDs to their corresponding
132 // configuration element
133 private static final Map
<String
, IConfigurationElement
> sfTraceTypeAttributes
= new HashMap
<String
, IConfigurationElement
>();
134 private static final Map
<String
, IConfigurationElement
> sfTraceCategories
= new HashMap
<String
, IConfigurationElement
>();
137 * Initialize statically at startup by getting extensions from the platform
138 * extension registry.
140 public static void init() {
141 IConfigurationElement
[] config
= Platform
.getExtensionRegistry().getConfigurationElementsFor(TmfTraceType
.TMF_TRACE_TYPE_ID
);
142 for (IConfigurationElement ce
: config
) {
143 String elementName
= ce
.getName();
144 if (elementName
.equals(TmfTraceType
.TYPE_ELEM
)) {
145 String traceTypeId
= ce
.getAttribute(TmfTraceType
.ID_ATTR
);
146 sfTraceTypeAttributes
.put(traceTypeId
, ce
);
147 } else if (elementName
.equals(TmfTraceType
.CATEGORY_ELEM
)) {
148 String categoryId
= ce
.getAttribute(TmfTraceType
.ID_ATTR
);
149 sfTraceCategories
.put(categoryId
, ce
);
154 // ------------------------------------------------------------------------
156 // ------------------------------------------------------------------------
158 * Constructor. Creates trace model element under the trace folder.
163 * The trace resource.
165 * The parent element (trace folder)
167 public TmfTraceElement(String name
, IResource trace
, TmfTraceFolder parent
) {
168 this(name
, trace
, (TmfProjectModelElement
) parent
);
172 * Constructor. Creates trace model element under the experiment folder.
177 * The trace resource.
179 * The parent element (experiment folder)
181 public TmfTraceElement(String name
, IResource trace
, TmfExperimentElement parent
) {
182 this(name
, trace
, (TmfProjectModelElement
) parent
);
185 private TmfTraceElement(String name
, IResource trace
, TmfProjectModelElement parent
) {
186 super(name
, trace
, parent
);
187 parent
.addChild(this);
189 TmfSignalManager
.register(this);
192 // ------------------------------------------------------------------------
194 // ------------------------------------------------------------------------
196 * Returns the trace type ID.
198 * @return trace type ID.
200 public String
getTraceType() {
205 * Refreshes the trace type filed by reading the trace type persistent
206 * property of the resource referenece.
208 public void refreshTraceType() {
210 fTraceTypeId
= getResource().getPersistentProperty(TmfCommonConstants
.TRACETYPE
);
212 } catch (CoreException e
) {
213 Activator
.getDefault().logError("Error refreshing trace type pesistent property for trace " + getName(), e
); //$NON-NLS-1$
218 * Instantiate a <code>ITmfTrace</code> object based on the trace type and
219 * the corresponding extension.
221 * @return the <code>ITmfTrace</code> or <code>null</code> for an error
223 public ITmfTrace
instantiateTrace() {
226 // make sure that supplementary folder exists
227 refreshSupplementaryFolder();
229 if (fTraceTypeId
!= null) {
230 if (fTraceTypeId
.startsWith(CustomTxtTrace
.class.getCanonicalName())) {
231 for (CustomTxtTraceDefinition def
: CustomTxtTraceDefinition
.loadAll()) {
232 if (fTraceTypeId
.equals(CustomTxtTrace
.class.getCanonicalName() + ":" + def
.definitionName
)) { //$NON-NLS-1$
233 return new CustomTxtTrace(def
);
237 if (fTraceTypeId
.startsWith(CustomXmlTrace
.class.getCanonicalName())) {
238 for (CustomXmlTraceDefinition def
: CustomXmlTraceDefinition
.loadAll()) {
239 if (fTraceTypeId
.equals(CustomXmlTrace
.class.getCanonicalName() + ":" + def
.definitionName
)) { //$NON-NLS-1$
240 return new CustomXmlTrace(def
);
244 IConfigurationElement ce
= sfTraceTypeAttributes
.get(fTraceTypeId
);
248 ITmfTrace trace
= (ITmfTrace
) ce
.createExecutableExtension(TmfTraceType
.TRACE_TYPE_ATTR
);
251 } catch (CoreException e
) {
252 Activator
.getDefault().logError("Error instantiating ITmfTrace object for trace " + getName(), e
); //$NON-NLS-1$
258 * Instantiate a <code>ITmfEvent</code> object based on the trace type and
259 * the corresponding extension.
261 * @return the <code>ITmfEvent</code> or <code>null</code> for an error
263 public ITmfEvent
instantiateEvent() {
265 if (fTraceTypeId
!= null) {
266 if (fTraceTypeId
.startsWith(CustomTxtTrace
.class.getCanonicalName())) {
267 for (CustomTxtTraceDefinition def
: CustomTxtTraceDefinition
.loadAll()) {
268 if (fTraceTypeId
.equals(CustomTxtTrace
.class.getCanonicalName() + ":" + def
.definitionName
)) { //$NON-NLS-1$
269 return new CustomTxtEvent(def
);
273 if (fTraceTypeId
.startsWith(CustomXmlTrace
.class.getCanonicalName())) {
274 for (CustomXmlTraceDefinition def
: CustomXmlTraceDefinition
.loadAll()) {
275 if (fTraceTypeId
.equals(CustomXmlTrace
.class.getCanonicalName() + ":" + def
.definitionName
)) { //$NON-NLS-1$
276 return new CustomXmlEvent(def
);
280 IConfigurationElement ce
= sfTraceTypeAttributes
.get(fTraceTypeId
);
284 ITmfEvent event
= (ITmfEvent
) ce
.createExecutableExtension(TmfTraceType
.EVENT_TYPE_ATTR
);
287 } catch (CoreException e
) {
288 Activator
.getDefault().logError("Error instantiating ITmfEvent object for trace " + getName(), e
); //$NON-NLS-1$
294 * Returns the optional editor ID from the trace type extension.
296 * @return the editor ID or <code>null</code> if not defined.
298 public String
getEditorId() {
299 if (fTraceTypeId
!= null) {
300 if (fTraceTypeId
.startsWith(CustomTxtTrace
.class.getCanonicalName())) {
301 return TmfEventsEditor
.ID
;
303 if (fTraceTypeId
.startsWith(CustomXmlTrace
.class.getCanonicalName())) {
304 return TmfEventsEditor
.ID
;
306 IConfigurationElement ce
= sfTraceTypeAttributes
.get(fTraceTypeId
);
307 IConfigurationElement
[] defaultEditorCE
= ce
.getChildren(TmfTraceType
.DEFAULT_EDITOR_ELEM
);
308 if (defaultEditorCE
.length
== 1) {
309 return defaultEditorCE
[0].getAttribute(TmfTraceType
.ID_ATTR
);
316 * Returns the file resource used to store bookmarks after creating it if
317 * necessary. If the trace resource is a file, it is returned directly. If
318 * the trace resource is a folder, a linked file is returned. The file will
319 * be created if it does not exist.
321 * @return the bookmarks file
322 * @throws CoreException
323 * if the bookmarks file cannot be created
326 public IFile
createBookmarksFile() throws CoreException
{
327 IFile file
= getBookmarksFile();
328 if (fResource
instanceof IFolder
) {
329 if (!file
.exists()) {
330 final IFile bookmarksFile
= getProject().getTracesFolder().getResource().getFile(BOOKMARKS_HIDDEN_FILE
);
331 if (!bookmarksFile
.exists()) {
332 final InputStream source
= new ByteArrayInputStream(new byte[0]);
333 bookmarksFile
.create(source
, true, null);
335 bookmarksFile
.setHidden(true);
336 file
.createLink(bookmarksFile
.getLocation(), IResource
.REPLACE
, null);
337 file
.setHidden(true);
338 file
.setPersistentProperty(TmfCommonConstants
.TRACETYPE
, TmfTrace
.class.getCanonicalName());
345 * Returns the file resource used to store bookmarks. The file may not
348 * @return the bookmarks file
351 public IFile
getBookmarksFile() {
353 if (fResource
instanceof IFile
) {
354 file
= (IFile
) fResource
;
355 } else if (fResource
instanceof IFolder
) {
356 final IFolder folder
= (IFolder
) fResource
;
357 file
= folder
.getFile(getName() + '_');
363 * Returns the <code>TmfTraceElement</code> located under the
364 * <code>TmfTracesFolder</code>.
366 * @return <code>this</code> if this element is under the
367 * <code>TmfTracesFolder</code> else the corresponding
368 * <code>TmfTraceElement</code> if this element is under
369 * <code>TmfExperimentElement</code>.
371 public TmfTraceElement
getElementUnderTraceFolder() {
373 // If trace is under an experiment, return original trace from the
375 if (getParent() instanceof TmfExperimentElement
) {
376 for (TmfTraceElement aTrace
: getProject().getTracesFolder().getTraces()) {
377 if (aTrace
.getName().equals(getName())) {
385 // ------------------------------------------------------------------------
387 // ------------------------------------------------------------------------
390 public boolean testAttribute(Object target
, String name
, String value
) {
391 if (name
.equals(IS_LINKED
)) {
392 boolean isLinked
= getResource().isLinked();
393 return Boolean
.toString(isLinked
).equals(value
);
398 // ------------------------------------------------------------------------
400 // ------------------------------------------------------------------------
403 public TmfProjectElement
getProject() {
404 if (getParent() instanceof TmfTraceFolder
) {
405 TmfTraceFolder folder
= (TmfTraceFolder
) getParent();
406 TmfProjectElement project
= (TmfProjectElement
) folder
.getParent();
409 if (getParent() instanceof TmfExperimentElement
) {
410 TmfExperimentElement experiment
= (TmfExperimentElement
) getParent();
411 TmfExperimentFolder folder
= (TmfExperimentFolder
) experiment
.getParent();
412 TmfProjectElement project
= (TmfProjectElement
) folder
.getParent();
418 // ------------------------------------------------------------------------
420 // ------------------------------------------------------------------------
423 public Object
getEditableValue() {
428 * Get the trace properties of this traceElement if the corresponding trace
429 * is opened in an editor
431 * @return a map with the names and values of the trace properties
432 * respectively as keys and values
434 private Map
<String
, String
> getTraceProperties() {
435 for (ITmfTrace openedTrace
: TmfTraceManager
.getInstance().getOpenedTraces()) {
436 for (ITmfTrace singleTrace
: TmfTraceManager
.getTraceSet(openedTrace
)) {
437 if (this.getLocation().toString().endsWith(singleTrace
.getPath())) {
438 if (singleTrace
instanceof ITmfTraceProperties
) {
439 ITmfTraceProperties traceProperties
= (ITmfTraceProperties
) singleTrace
;
440 return traceProperties
.getTraceProperties();
445 return new HashMap
<String
, String
>();
449 public IPropertyDescriptor
[] getPropertyDescriptors() {
450 Map
<String
, String
> traceProperties
= getTraceProperties();
451 if (!traceProperties
.isEmpty()) {
452 IPropertyDescriptor
[] propertyDescriptorArray
= new IPropertyDescriptor
[traceProperties
.size() + sfDescriptors
.length
];
454 for (Map
.Entry
<String
, String
> varName
: traceProperties
.entrySet()) {
455 ReadOnlyTextPropertyDescriptor descriptor
= new ReadOnlyTextPropertyDescriptor(this.getName() + "_" + varName
.getKey(), varName
.getKey()); //$NON-NLS-1$
456 descriptor
.setCategory(sfTracePropertiesCategory
);
457 propertyDescriptorArray
[index
] = descriptor
;
460 for (int i
= 0; i
< sfDescriptors
.length
; i
++) {
461 propertyDescriptorArray
[index
] = sfDescriptors
[i
];
464 return propertyDescriptorArray
;
466 return Arrays
.copyOf(sfDescriptors
, sfDescriptors
.length
);
470 public Object
getPropertyValue(Object id
) {
472 if (sfName
.equals(id
)) {
476 if (sfPath
.equals(id
)) {
477 return getPath().toString();
480 if (sfLocation
.equals(id
)) {
481 return getLocation().toString();
484 if (sfIsLinked
.equals(id
)) {
485 return Boolean
.valueOf(getResource().isLinked()).toString();
488 if (sfEventType
.equals(id
)) {
489 if (fTraceTypeId
!= null) {
490 IConfigurationElement ce
= sfTraceTypeAttributes
.get(fTraceTypeId
);
491 return (ce
!= null) ?
(getCategory(ce
) + " : " + ce
.getAttribute(TmfTraceType
.NAME_ATTR
)) : ""; //$NON-NLS-1$ //$NON-NLS-2$
495 Map
<String
, String
> traceProperties
= getTraceProperties();
496 if (id
!= null && !traceProperties
.isEmpty()) {
497 String key
= (String
) id
;
498 key
= key
.replaceFirst(this.getName() + "_", ""); //$NON-NLS-1$ //$NON-NLS-2$
499 String value
= traceProperties
.get(key
);
506 private static String
getCategory(IConfigurationElement ce
) {
507 String categoryId
= ce
.getAttribute(TmfTraceType
.CATEGORY_ATTR
);
508 if (categoryId
!= null) {
509 IConfigurationElement category
= sfTraceCategories
.get(categoryId
);
510 if (category
!= null) {
511 return category
.getAttribute(TmfTraceType
.NAME_ATTR
);
514 return "[no category]"; //$NON-NLS-1$
518 public void resetPropertyValue(Object id
) {
522 public void setPropertyValue(Object id
, Object value
) {
526 public boolean isPropertyResettable(Object id
) {
531 public boolean isPropertySet(Object id
) {
536 * Copy this trace in the trace folder. No other parameters are mentioned so
537 * the trace is copied in this element's project trace folder
541 * @return the new Resource object
544 public TmfTraceElement
copy(String string
) {
545 TmfTraceFolder folder
= this.getProject().getTracesFolder();
546 IResource res
= super.copy(string
, false);
547 return new TmfTraceElement(string
, res
, folder
);
551 * Close opened editors associated with this trace.
555 public void closeEditors() {
556 // Close the trace if open
557 IFile file
= getBookmarksFile();
558 FileEditorInput input
= new FileEditorInput(file
);
559 IWorkbench wb
= PlatformUI
.getWorkbench();
560 for (IWorkbenchWindow wbWindow
: wb
.getWorkbenchWindows()) {
561 for (IWorkbenchPage wbPage
: wbWindow
.getPages()) {
562 for (IEditorReference editorReference
: wbPage
.getEditorReferences()) {
564 if (editorReference
.getEditorInput().equals(input
)) {
565 wbPage
.closeEditor(editorReference
.getEditor(false), false);
567 } catch (PartInitException e
) {
568 Activator
.getDefault().logError("Error closing editor for trace " + getName(), e
); //$NON-NLS-1$
574 // Close experiments that contain the trace if open
575 if (getParent() instanceof TmfTraceFolder
) {
576 TmfExperimentFolder experimentFolder
= getProject().getExperimentsFolder();
577 for (ITmfProjectModelElement experiment
: experimentFolder
.getChildren()) {
578 for (ITmfProjectModelElement child
: experiment
.getChildren()) {
579 if (child
.getName().equals(getName())) {
580 ((TmfExperimentElement
) experiment
).closeEditors();
585 } else if (getParent() instanceof TmfExperimentElement
) {
586 TmfExperimentElement experiment
= (TmfExperimentElement
) getParent();
587 experiment
.closeEditors();
592 * Get the instantiated trace associated with this element.
594 * @return The instantiated trace or null if trace is not (yet) available
597 public ITmfTrace
getTrace() {
598 for (ITmfTrace trace
: TmfTraceManager
.getInstance().getOpenedTraces()) {
599 if (trace
.getResource().equals(getResource())) {
606 private void refreshAnalysis() {
607 List
<TmfAnalysisElement
> list
= getAvailableAnalysis();
609 /* Remove children */
610 getChildren().clear();
612 /* Add the children again */
613 for (TmfAnalysisElement module
: list
) {
620 * Get the list of analysis elements
622 * @return Array of analysis elements
625 public List
<TmfAnalysisElement
> getAvailableAnalysis() {
626 List
<TmfAnalysisElement
> list
= new ArrayList
<TmfAnalysisElement
>();
628 TraceTypeHelper helper
= TmfTraceType
.getInstance().getTraceType(getTraceType());
630 Class
<?
extends ITmfTrace
> traceClass
= null;
632 if (helper
== null && fTraceTypeId
!= null) {
633 if (fTraceTypeId
.startsWith(CustomTxtTrace
.class.getCanonicalName())) {
634 for (CustomTxtTraceDefinition def
: CustomTxtTraceDefinition
.loadAll()) {
635 if (fTraceTypeId
.equals(CustomTxtTrace
.class.getCanonicalName() + ":" + def
.definitionName
)) { //$NON-NLS-1$
636 traceClass
= CustomTxtTrace
.class;
640 if (fTraceTypeId
.startsWith(CustomXmlTrace
.class.getCanonicalName())) {
641 for (CustomXmlTraceDefinition def
: CustomXmlTraceDefinition
.loadAll()) {
642 if (fTraceTypeId
.equals(CustomXmlTrace
.class.getCanonicalName() + ":" + def
.definitionName
)) { //$NON-NLS-1$
643 traceClass
= CustomTxtTrace
.class;
647 } else if (helper
!= null) {
648 traceClass
= helper
.getTraceClass();
651 if (traceClass
== null) {
655 /** Get the base path to put the resource to */
656 IPath path
= fResource
.getFullPath();
658 for (IAnalysisModuleHelper module
: TmfAnalysisManager
.getAnalysisModules(traceClass
).values()) {
660 /** No need for the resource to exist, nothing will be done with it */
661 IFolder newresource
= ResourcesPlugin
.getWorkspace().getRoot().getFolder(path
.append(module
.getId()));
663 TmfAnalysisElement analysis
= new TmfAnalysisElement(module
.getName(), newresource
, this, module
.getId());
671 * Handler for the Trace Opened signal
674 * The incoming signal
677 public void traceOpened(TmfTraceOpenedSignal signal
) {
678 if (!signal
.getTrace().getResource().equals(getResource())) {
683 getParent().refresh();