Commit | Line | Data |
---|---|---|
d7fcacc9 FC |
1 | package org.eclipse.linuxtools.tmf.ui.parsers.custom;\r |
2 | \r | |
4c564a2d FC |
3 | import org.eclipse.linuxtools.tmf.core.event.ITmfEventField;\r |
4 | import org.eclipse.linuxtools.tmf.core.event.TmfEventField;\r | |
6c13869b | 5 | import org.eclipse.linuxtools.tmf.core.event.TmfEventType;\r |
d7fcacc9 FC |
6 | \r |
7 | public abstract class CustomEventType extends TmfEventType {\r | |
8 | \r | |
cbbcc354 | 9 | private static String CONTEXT_ID = "CustomEventType"; //$NON-NLS-1$\r |
10 | \r | |
d7fcacc9 | 11 | public CustomEventType(CustomTraceDefinition definition) {\r |
4c564a2d | 12 | super(CONTEXT_ID, definition.definitionName, getRootField(definition));\r |
d7fcacc9 FC |
13 | }\r |
14 | \r | |
4c564a2d FC |
15 | private static ITmfEventField getRootField(CustomTraceDefinition definition) {\r |
16 | ITmfEventField[] fields = new ITmfEventField[definition.outputs.size()];\r | |
17 | for (int i = 0; i < fields.length; i++) {\r | |
18 | fields[i] = new TmfEventField(definition.outputs.get(i).name, null);\r | |
d7fcacc9 | 19 | }\r |
a4115405 | 20 | ITmfEventField rootField = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, fields);\r |
4c564a2d | 21 | return rootField;\r |
d7fcacc9 FC |
22 | }\r |
23 | \r | |
24 | }\r |