Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernd Hufmann2014-08-15 11:54:03 +0000
committerBernd Hufmann2014-08-15 17:37:12 +0000
commita09e64112b66e778d64c6feb3ef2e9d0d3a68de7 (patch)
tree3067d66f66b07cd355c2c49f6d3132a2b0942472
parent4d557f1f1c5c35b8e2aaf5ce614e904cf95688b2 (diff)
downloadorg.eclipse.linuxtools-a09e64112b66e778d64c6feb3ef2e9d0d3a68de7.tar.gz
org.eclipse.linuxtools-a09e64112b66e778d64c6feb3ef2e9d0d3a68de7.tar.xz
org.eclipse.linuxtools-a09e64112b66e778d64c6feb3ef2e9d0d3a68de7.zip
tmf: Use custom parser constants of TmfTraceType evereywhere
Change-Id: I165c289d5fa3394deee47b631dec45a202987bdc Signed-off-by: Bernd Hufmann <Bernd.Hufmann@ericsson.com> Reviewed-on: https://git.eclipse.org/r/31748 Tested-by: Hudson CI Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com> Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com> Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/SelectElementTypeContributionItem.java14
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/filter/FilterViewer.java11
2 files changed, 10 insertions, 15 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/SelectElementTypeContributionItem.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/SelectElementTypeContributionItem.java
index febf142571..c1d3c2324a 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/SelectElementTypeContributionItem.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/SelectElementTypeContributionItem.java
@@ -56,8 +56,6 @@ public class SelectElementTypeContributionItem extends CompoundContributionItem
private static final String TYPE_PARAMETER = "org.eclipse.linuxtools.tmf.ui.commandparameter.select_trace_type.type"; //$NON-NLS-1$
private static final String ICON_PARAMETER = "org.eclipse.linuxtools.tmf.ui.commandparameter.select_trace_type.icon"; //$NON-NLS-1$
private static final String SELECT_TRACE_TYPE_COMMAND_ID = "org.eclipse.linuxtools.tmf.ui.command.select_trace_type"; //$NON-NLS-1$
- private static final String CUSTOM_TXT_CATEGORY = "Custom Text"; //$NON-NLS-1$
- private static final String CUSTOM_XML_CATEGORY = "Custom XML"; //$NON-NLS-1$
private static final String DEFAULT_TRACE_ICON_PATH = "icons/elcl16/trace.gif"; //$NON-NLS-1$
@Override
@@ -155,15 +153,15 @@ public class SelectElementTypeContributionItem extends CompoundContributionItem
CustomTxtTraceDefinition[] customTxtTraceDefinitions = CustomTxtTraceDefinition.loadAll();
if (customTxtTraceDefinitions.length > 0) {
ImageDescriptor icon = isSelectedCategory(customTxtTraceDefinitions, selectedTraceTypes) ? SELECTED_ICON : null;
- MenuManager subMenu = new MenuManager(CUSTOM_TXT_CATEGORY, icon, null);
- categoriesMap.put(CUSTOM_TXT_CATEGORY, subMenu);
+ MenuManager subMenu = new MenuManager(TmfTraceType.CUSTOM_TXT_CATEGORY, icon, null);
+ categoriesMap.put(TmfTraceType.CUSTOM_TXT_CATEGORY, subMenu);
list.add(subMenu);
}
CustomXmlTraceDefinition[] customXmlTraceDefinitions = CustomXmlTraceDefinition.loadAll();
if (customXmlTraceDefinitions.length > 0) {
ImageDescriptor icon = isSelectedCategory(customXmlTraceDefinitions, selectedTraceTypes) ? SELECTED_ICON : null;
- MenuManager subMenu = new MenuManager(CUSTOM_XML_CATEGORY, icon, null);
- categoriesMap.put(CUSTOM_XML_CATEGORY, subMenu);
+ MenuManager subMenu = new MenuManager(TmfTraceType.CUSTOM_XML_CATEGORY, icon, null);
+ categoriesMap.put(TmfTraceType.CUSTOM_XML_CATEGORY, subMenu);
list.add(subMenu);
}
@@ -174,7 +172,7 @@ public class SelectElementTypeContributionItem extends CompoundContributionItem
String traceIcon = DEFAULT_TRACE_ICON_PATH;
String label = def.definitionName;
boolean selected = selectedTraceTypes.contains(traceTypeId);
- MenuManager subMenu = categoriesMap.get(CUSTOM_TXT_CATEGORY);
+ MenuManager subMenu = categoriesMap.get(TmfTraceType.CUSTOM_TXT_CATEGORY);
addContributionItem(list, traceBundle, traceTypeId, traceIcon, label, selected, subMenu);
}
@@ -184,7 +182,7 @@ public class SelectElementTypeContributionItem extends CompoundContributionItem
String traceIcon = DEFAULT_TRACE_ICON_PATH;
String label = def.definitionName;
boolean selected = selectedTraceTypes.contains(traceTypeId);
- MenuManager subMenu = categoriesMap.get(CUSTOM_XML_CATEGORY);
+ MenuManager subMenu = categoriesMap.get(TmfTraceType.CUSTOM_XML_CATEGORY);
addContributionItem(list, traceBundle, traceTypeId, traceIcon, label, selected, subMenu);
}
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/filter/FilterViewer.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/filter/FilterViewer.java
index 836505ead8..faacf6977a 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/filter/FilterViewer.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/filter/FilterViewer.java
@@ -83,9 +83,6 @@ import org.eclipse.swt.widgets.TreeItem;
class FilterViewer extends Composite {
- private static final String CUSTOM_TXT_CATEGORY = "Custom Text"; //$NON-NLS-1$
- private static final String CUSTOM_XML_CATEGORY = "Custom XML"; //$NON-NLS-1$
-
private TreeViewer fViewer;
private Composite fComposite;
@@ -447,7 +444,7 @@ class FilterViewer extends Composite {
}
for (CustomTxtTraceDefinition def : CustomTxtTraceDefinition.loadAll()) {
if (def.outputs.size() > 0) {
- fieldsList.add("[" + CUSTOM_TXT_CATEGORY + //$NON-NLS-1$
+ fieldsList.add("[" + TmfTraceType.CUSTOM_TXT_CATEGORY + //$NON-NLS-1$
" : " + def.definitionName + "]"); //$NON-NLS-1$ //$NON-NLS-2$
for (OutputColumn output : def.outputs) {
fieldsList.add(output.name);
@@ -457,7 +454,7 @@ class FilterViewer extends Composite {
}
for (CustomXmlTraceDefinition def : CustomXmlTraceDefinition.loadAll()) {
if (def.outputs.size() > 0) {
- fieldsList.add("[" + CUSTOM_XML_CATEGORY + //$NON-NLS-1$
+ fieldsList.add("[" + TmfTraceType.CUSTOM_XML_CATEGORY + //$NON-NLS-1$
" : " + def.definitionName + "]"); //$NON-NLS-1$ //$NON-NLS-2$
for (OutputColumn output : def.outputs) {
fieldsList.add(output.name);
@@ -597,11 +594,11 @@ class FilterViewer extends Composite {
eventsTypeMap.put(text, ce);
}
for (CustomTxtTraceDefinition def : CustomTxtTraceDefinition.loadAll()) {
- String text = CUSTOM_TXT_CATEGORY + " : " + def.definitionName; //$NON-NLS-1$
+ String text = TmfTraceType.CUSTOM_TXT_CATEGORY + " : " + def.definitionName; //$NON-NLS-1$
eventsTypeMap.put(text, def);
}
for (CustomXmlTraceDefinition def : CustomXmlTraceDefinition.loadAll()) {
- String text = CUSTOM_XML_CATEGORY + " : " + def.definitionName; //$NON-NLS-1$
+ String text = TmfTraceType.CUSTOM_XML_CATEGORY + " : " + def.definitionName; //$NON-NLS-1$
eventsTypeMap.put(text, def);
}
return eventsTypeMap;

Back to the top