tmf: Perform cleanup when custom parser is modified or deleted
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.ui / src / org / eclipse / tracecompass / internal / tmf / ui / parsers / wizards / CustomTxtParserWizard.java
index 8affbab32ff7cbbf399b7293cd008c6cda3ac7d2..67900612cdb837ebec0eb733d128acf9dad8ce20 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2010, 2014 Ericsson
+ * Copyright (c) 2010, 2015 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -15,6 +15,8 @@ package org.eclipse.tracecompass.internal.tmf.ui.parsers.wizards;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.tracecompass.internal.tmf.ui.parsers.CustomParserUtils;
+import org.eclipse.tracecompass.tmf.core.parsers.custom.CustomTxtTrace;
 import org.eclipse.tracecompass.tmf.core.parsers.custom.CustomTxtTraceDefinition;
 import org.eclipse.ui.INewWizard;
 import org.eclipse.ui.IWorkbench;
@@ -58,9 +60,11 @@ public class CustomTxtParserWizard extends Wizard implements INewWizard {
     @Override
     public boolean performFinish() {
         CustomTxtTraceDefinition def = outputPage.getDefinition();
-        if (definition != null && (!initialCategoryName.equals(def.categoryName) ||
-                !initialDefinitionName.equals(def.definitionName))) {
-            CustomTxtTraceDefinition.delete(initialCategoryName, initialDefinitionName);
+        if (definition != null) {
+            if (!initialCategoryName.equals(def.categoryName) || !initialDefinitionName.equals(def.definitionName)) {
+                CustomTxtTraceDefinition.delete(initialCategoryName, initialDefinitionName);
+            }
+            CustomParserUtils.cleanup(CustomTxtTrace.buildTraceTypeId(initialCategoryName, initialDefinitionName));
         }
         def.save();
         return true;
This page took 0.027766 seconds and 5 git commands to generate.