tmf: add experiment type ID property to be displayed in Properties view
authorBernd Hufmann <Bernd.Hufmann@ericsson.com>
Wed, 4 May 2016 20:04:45 +0000 (16:04 -0400)
committerBernd Hufmann <bernd.hufmann@ericsson.com>
Wed, 11 May 2016 20:10:05 +0000 (16:10 -0400)
This information is needed when creating XML analysis once it's
supported by the data-driven analysis.

Change-Id: I0cc632e040595082610afdc8ed07cbb7051d664e
Signed-off-by: Bernd Hufmann <Bernd.Hufmann@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/72083
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/project/model/TmfExperimentElement.java

index 25f01daafb38fbba0c7e4605be4f3a5afe3d7dba..9e9b336d923874deeec8a82abeff3e5c859350f0 100644 (file)
@@ -79,21 +79,24 @@ public class TmfExperimentElement extends TmfCommonProjectElement implements IPr
     private static final String LOCATION = "location"; //$NON-NLS-1$
     private static final String FOLDER_SUFFIX = "_exp"; //$NON-NLS-1$
     private static final String EXPERIMENT_TYPE = "type"; //$NON-NLS-1$
+    private static final String EXPERIMENT_TYPE_ID = "type ID"; //$NON-NLS-1$
 
     private static final ReadOnlyTextPropertyDescriptor NAME_DESCRIPTOR = new ReadOnlyTextPropertyDescriptor(NAME, NAME);
     private static final ReadOnlyTextPropertyDescriptor PATH_DESCRIPTOR = new ReadOnlyTextPropertyDescriptor(PATH, PATH);
     private static final ReadOnlyTextPropertyDescriptor LOCATION_DESCRIPTOR = new ReadOnlyTextPropertyDescriptor(LOCATION,
             LOCATION);
     private static final ReadOnlyTextPropertyDescriptor TYPE_DESCRIPTOR = new ReadOnlyTextPropertyDescriptor(EXPERIMENT_TYPE, EXPERIMENT_TYPE);
+    private static final ReadOnlyTextPropertyDescriptor TYPE_ID_DESCRIPTOR = new ReadOnlyTextPropertyDescriptor(EXPERIMENT_TYPE_ID, EXPERIMENT_TYPE_ID);
 
     private static final IPropertyDescriptor[] DESCRIPTORS = { NAME_DESCRIPTOR, PATH_DESCRIPTOR,
-            LOCATION_DESCRIPTOR, TYPE_DESCRIPTOR };
+            LOCATION_DESCRIPTOR, TYPE_DESCRIPTOR, TYPE_ID_DESCRIPTOR };
 
     static {
         NAME_DESCRIPTOR.setCategory(INFO_CATEGORY);
         PATH_DESCRIPTOR.setCategory(INFO_CATEGORY);
         LOCATION_DESCRIPTOR.setCategory(INFO_CATEGORY);
         TYPE_DESCRIPTOR.setCategory(INFO_CATEGORY);
+        TYPE_ID_DESCRIPTOR.setCategory(INFO_CATEGORY);
     }
 
     // The mapping of available trace type IDs to their corresponding
@@ -519,6 +522,15 @@ public class TmfExperimentElement extends TmfCommonProjectElement implements IPr
                 return ce.getAttribute(TmfTraceType.NAME_ATTR);
             }
         }
+        if (EXPERIMENT_TYPE_ID.equals(id)) {
+            if (getTraceType() != null) {
+                IConfigurationElement ce = TRACE_TYPE_ATTRIBUTES.get(getTraceType());
+                if (ce == null) {
+                    return ""; //$NON-NLS-1$
+                }
+                return ce.getAttribute(TmfTraceType.ID_ATTR);
+            }
+        }
 
         return null;
     }
This page took 0.026467 seconds and 5 git commands to generate.