// make sure that supplementary folder exists
refreshSupplementaryFolder();
- if (getTraceType() != null) {
- if (getTraceType().startsWith(CustomTxtTrace.class.getCanonicalName())) {
+ String traceTypeId = getTraceType();
+ if (traceTypeId != null) {
+ if (CustomTxtTrace.isCustomTraceTypeId(traceTypeId)) {
for (CustomTxtTraceDefinition def : CustomTxtTraceDefinition.loadAll()) {
- if (getTraceType().equals(CustomTxtTrace.class.getCanonicalName() + ':' + def.categoryName+ ':' + def.definitionName)) {
+ String id = CustomTxtTrace.buildTraceTypeId(def.categoryName, def.definitionName);
+ if (traceTypeId.equals(id)) {
return new CustomTxtTrace(def);
}
}
}
- if (getTraceType().startsWith(CustomXmlTrace.class.getCanonicalName())) {
+ if (CustomXmlTrace.isCustomTraceTypeId(traceTypeId)) {
for (CustomXmlTraceDefinition def : CustomXmlTraceDefinition.loadAll()) {
- if (getTraceType().equals(CustomXmlTrace.class.getCanonicalName() + ':' + def.categoryName+ ':' + def.definitionName)) {
+ String id = CustomXmlTrace.buildTraceTypeId(def.categoryName, def.definitionName);
+ if (traceTypeId.equals(id)) {
return new CustomXmlTrace(def);
}
}
}
- IConfigurationElement ce = sfTraceTypeAttributes.get(getTraceType());
+ IConfigurationElement ce = sfTraceTypeAttributes.get(traceTypeId);
if (ce == null) {
return null;
}
*/
public ITmfEvent instantiateEvent() {
try {
- if (getTraceType() != null) {
- if (getTraceType().startsWith(CustomTxtTrace.class.getCanonicalName())) {
+ String traceTypeId = getTraceType();
+ if (traceTypeId != null) {
+ if (CustomTxtTrace.isCustomTraceTypeId(traceTypeId)) {
for (CustomTxtTraceDefinition def : CustomTxtTraceDefinition.loadAll()) {
- if (getTraceType().equals(CustomTxtTrace.class.getCanonicalName() + ':' + def.categoryName+ ':' + def.definitionName)) {
+ String id = CustomTxtTrace.buildTraceTypeId(def.categoryName, def.definitionName);
+ if (traceTypeId.equals(id)) {
return new CustomTxtEvent(def);
}
}
}
- if (getTraceType().startsWith(CustomXmlTrace.class.getCanonicalName())) {
+ if (CustomXmlTrace.isCustomTraceTypeId(traceTypeId)) {
for (CustomXmlTraceDefinition def : CustomXmlTraceDefinition.loadAll()) {
- if (getTraceType().equals(CustomXmlTrace.class.getCanonicalName() + ':' + def.categoryName+ ':' + def.definitionName)) {
+ String id = CustomXmlTrace.buildTraceTypeId(def.categoryName, def.definitionName);
+ if (traceTypeId.equals(id)) {
return new CustomXmlEvent(def);
}
}
}
- IConfigurationElement ce = sfTraceTypeAttributes.get(getTraceType());
+ IConfigurationElement ce = sfTraceTypeAttributes.get(traceTypeId);
if (ce == null) {
return null;
}
@Override
public String getEditorId() {
- if (getTraceType() != null) {
- if (getTraceType().startsWith(CustomTxtTrace.class.getCanonicalName())) {
- return TmfEventsEditor.ID;
- }
- if (getTraceType().startsWith(CustomXmlTrace.class.getCanonicalName())) {
+ String traceTypeId = getTraceType();
+ if (traceTypeId != null) {
+ if (CustomTxtTrace.isCustomTraceTypeId(traceTypeId) || CustomXmlTrace.isCustomTraceTypeId(traceTypeId)) {
return TmfEventsEditor.ID;
}
+
IConfigurationElement ce = sfTraceTypeUIAttributes.get(getTraceType());
if (ce == null) {
/* This trace type does not define UI attributes */