From 12ec416dd76291031b7ed7eb59acf6f59fcdb95b Mon Sep 17 00:00:00 2001 From: Bernd Hufmann Date: Wed, 4 May 2016 16:04:45 -0400 Subject: [PATCH] tmf: add experiment type ID property to be displayed in Properties view 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 Reviewed-on: https://git.eclipse.org/r/72083 Reviewed-by: Hudson CI Reviewed-by: Matthew Khouzam Tested-by: Matthew Khouzam --- .../tmf/ui/project/model/TmfExperimentElement.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/project/model/TmfExperimentElement.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/project/model/TmfExperimentElement.java index 25f01daafb..9e9b336d92 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/project/model/TmfExperimentElement.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/project/model/TmfExperimentElement.java @@ -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; } -- 2.34.1