import org.eclipse.linuxtools.tmf.core.filter.model.TmfFilterNode;\r
import org.eclipse.linuxtools.tmf.core.filter.model.TmfFilterOrNode;\r
import org.eclipse.linuxtools.tmf.core.filter.model.TmfFilterRootNode;\r
+import org.eclipse.linuxtools.tmf.core.filter.model.TmfFilterTreeNode;\r
import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceType;\r
import org.eclipse.swt.SWT;\r
import org.eclipse.swt.custom.SashForm;\r
import org.eclipse.swt.events.FocusListener;\r
import org.eclipse.swt.events.ModifyEvent;\r
import org.eclipse.swt.events.ModifyListener;\r
+import org.eclipse.swt.events.PaintEvent;\r
+import org.eclipse.swt.events.PaintListener;\r
import org.eclipse.swt.events.SelectionAdapter;\r
import org.eclipse.swt.events.SelectionEvent;\r
import org.eclipse.swt.layout.FillLayout;\r
}\r
}\r
});\r
+\r
+ fViewer.getTree().addPaintListener(new PaintListener() {\r
+ @Override\r
+ public void paintControl(PaintEvent e) {\r
+ TmfFilterTreeNode root = (TmfFilterTreeNode) fViewer.getInput();\r
+ if (root == null || root.getChildrenCount() == 0) {\r
+ e.gc.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));\r
+ e.gc.drawText(Messages.FilterViewer_EmptyTreeHintText, 5, 0);\r
+ }\r
+ }\r
+ });\r
}\r
\r
/**\r
}\r
} catch (CoreException e) {\r
}\r
+ if (fieldsList.size() == 0) {\r
+ fieldsList.add(ITmfEvent.EVENT_FIELD_TIMESTAMP);\r
+ fieldsList.add(ITmfEvent.EVENT_FIELD_SOURCE);\r
+ fieldsList.add(ITmfEvent.EVENT_FIELD_TYPE);\r
+ fieldsList.add(ITmfEvent.EVENT_FIELD_REFERENCE);\r
+ fieldsList.add(ITmfEvent.EVENT_FIELD_CONTENT);\r
+ }\r
return fieldsList.toArray(new String[0]);\r
}\r
}\r
- if (eventTypeNode.getEventType().startsWith(CustomTxtEvent.class.getCanonicalName())) {\r
+ if (eventTypeNode.getEventType() != null && eventTypeNode.getEventType().startsWith(CustomTxtEvent.class.getCanonicalName())) {\r
for (CustomTxtTraceDefinition def : CustomTxtTraceDefinition.loadAll()) {\r
if (eventTypeNode.getEventType().equals(CustomTxtEvent.class.getCanonicalName() + ":" + def.definitionName)) { //$NON-NLS-1$\r
for (OutputColumn output : def.outputs) {\r
}\r
}\r
}\r
- if (eventTypeNode.getEventType().startsWith(CustomXmlEvent.class.getCanonicalName())) {\r
+ if (eventTypeNode.getEventType() != null && eventTypeNode.getEventType().startsWith(CustomXmlEvent.class.getCanonicalName())) {\r
for (CustomXmlTraceDefinition def : CustomXmlTraceDefinition.loadAll()) {\r
if (eventTypeNode.getEventType().equals(CustomXmlEvent.class.getCanonicalName() + ":" + def.definitionName)) { //$NON-NLS-1$\r
for (OutputColumn output : def.outputs) {\r
}\r
node = node.getParent();\r
}\r
+\r
+ fieldsList.add(Messages.FilterViewer_CommonCategory);\r
+ fieldsList.add(ITmfEvent.EVENT_FIELD_TIMESTAMP);\r
+ fieldsList.add(ITmfEvent.EVENT_FIELD_SOURCE);\r
+ fieldsList.add(ITmfEvent.EVENT_FIELD_TYPE);\r
+ fieldsList.add(ITmfEvent.EVENT_FIELD_REFERENCE);\r
+ fieldsList.add(ITmfEvent.EVENT_FIELD_CONTENT);\r
+ fieldsList.add(""); //$NON-NLS-1$\r
+\r
for (IConfigurationElement ce : TmfTraceType.getTypeElements()) {\r
try {\r
ITmfEvent event = (ITmfEvent) ce.createExecutableExtension(TmfTraceType.EVENT_TYPE_ATTR);\r
ITmfEventType eventType = event.getType();\r
- if (eventType != null) {\r
+ if (eventType != null && eventType.getFieldNames().length > 0) {\r
fieldsList.add("[" + TmfTraceType.getCategoryName(ce.getAttribute(TmfTraceType.CATEGORY_ATTR)) + //$NON-NLS-1$\r
" : " + ce.getAttribute(TmfTraceType.NAME_ATTR) + "]"); //$NON-NLS-1$ //$NON-NLS-2$\r
for (String field : eventType.getFieldNames()) {\r
}\r
}\r
for (CustomTxtTraceDefinition def : CustomTxtTraceDefinition.loadAll()) {\r
- fieldsList.add("[" + CUSTOM_TXT_CATEGORY + //$NON-NLS-1$\r
- " : " + def.definitionName + "]"); //$NON-NLS-1$ //$NON-NLS-2$\r
- for (OutputColumn output : def.outputs) {\r
- fieldsList.add(output.name);\r
+ if (def.outputs.size() > 0) {\r
+ fieldsList.add("[" + CUSTOM_TXT_CATEGORY + //$NON-NLS-1$\r
+ " : " + def.definitionName + "]"); //$NON-NLS-1$ //$NON-NLS-2$\r
+ for (OutputColumn output : def.outputs) {\r
+ fieldsList.add(output.name);\r
+ }\r
+ fieldsList.add(""); //$NON-NLS-1$\r
}\r
- fieldsList.add(""); //$NON-NLS-1$\r
}\r
for (CustomXmlTraceDefinition def : CustomXmlTraceDefinition.loadAll()) {\r
- fieldsList.add("[" + CUSTOM_XML_CATEGORY + //$NON-NLS-1$\r
- " : " + def.definitionName + "]"); //$NON-NLS-1$ //$NON-NLS-2$\r
- for (OutputColumn output : def.outputs) {\r
- fieldsList.add(output.name);\r
+ if (def.outputs.size() > 0) {\r
+ fieldsList.add("[" + CUSTOM_XML_CATEGORY + //$NON-NLS-1$\r
+ " : " + def.definitionName + "]"); //$NON-NLS-1$ //$NON-NLS-2$\r
+ for (OutputColumn output : def.outputs) {\r
+ fieldsList.add(output.name);\r
+ }\r
+ fieldsList.add(""); //$NON-NLS-1$\r
}\r
- fieldsList.add(""); //$NON-NLS-1$\r
}\r
return fieldsList.toArray(new String[0]);\r
}\r