-package org.eclipse.linuxtools.internal.tmf.ui.parsers.wizards;\r
-\r
-import org.eclipse.jface.viewers.ISelection;\r
-import org.eclipse.jface.viewers.IStructuredSelection;\r
-import org.eclipse.jface.wizard.Wizard;\r
-import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomXmlTraceDefinition;\r
-import org.eclipse.ui.INewWizard;\r
-import org.eclipse.ui.IWorkbench;\r
-\r
-public class CustomXmlParserWizard extends Wizard implements INewWizard {\r
-\r
- CustomXmlParserInputWizardPage inputPage;\r
- CustomXmlParserOutputWizardPage outputPage;\r
- private ISelection selection;\r
- CustomXmlTraceDefinition definition;\r
-\r
- public CustomXmlParserWizard() {\r
- super();\r
- }\r
-\r
- public CustomXmlParserWizard(CustomXmlTraceDefinition definition) {\r
- super();\r
- this.definition = definition;\r
- }\r
-\r
- @Override\r
- public boolean performFinish() {\r
- CustomXmlTraceDefinition def = outputPage.getDefinition();\r
- if (definition != null && !definition.definitionName.equals(def.definitionName)) {\r
- CustomXmlTraceDefinition.delete(definition.definitionName);\r
- }\r
- def.save();\r
- return true;\r
- }\r
-\r
- /**\r
- * Adding the page to the wizard.\r
- */\r
-\r
- @Override\r
- public void addPages() {\r
- inputPage = new CustomXmlParserInputWizardPage(selection, definition);\r
- addPage(inputPage);\r
- outputPage = new CustomXmlParserOutputWizardPage(this);\r
- addPage(outputPage);\r
- }\r
-\r
- @Override\r
- public void init(IWorkbench workbench, IStructuredSelection selection) {\r
- this.selection = selection;\r
- }\r
-\r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2010, 2014 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tasse - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.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.linuxtools.tmf.core.parsers.custom.CustomXmlTraceDefinition;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+
+/**
+ * Wizard for custom XML trace parsers.
+ *
+ * @author Patrick Tasse
+ */
+public class CustomXmlParserWizard extends Wizard implements INewWizard {
+
+ CustomXmlParserInputWizardPage inputPage;
+ CustomXmlParserOutputWizardPage outputPage;
+ private ISelection selection;
+ CustomXmlTraceDefinition definition;
+
+ /**
+ * Default constructor
+ */
+ public CustomXmlParserWizard() {
+ super();
+ }
+
+ /**
+ * Constructor
+ *
+ * @param definition
+ * The trace definition
+ */
+ public CustomXmlParserWizard(CustomXmlTraceDefinition definition) {
+ super();
+ this.definition = definition;
+ }
+
+ @Override
+ public boolean performFinish() {
+ CustomXmlTraceDefinition def = outputPage.getDefinition();
+ if (definition != null && !definition.definitionName.equals(def.definitionName)) {
+ CustomXmlTraceDefinition.delete(definition.definitionName);
+ }
+ def.save();
+ return true;
+ }
+
+ /**
+ * Adding the page to the wizard.
+ */
+
+ @Override
+ public void addPages() {
+ inputPage = new CustomXmlParserInputWizardPage(selection, definition);
+ addPage(inputPage);
+ outputPage = new CustomXmlParserOutputWizardPage(this);
+ addPage(outputPage);
+ }
+
+ @Override
+ public void init(IWorkbench workbench, IStructuredSelection sel) {
+ this.selection = sel;
+ }
+
+}