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