Internalize some more TMF APIs
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / internal / tmf / ui / parsers / wizards / CustomTxtParserWizard.java
1 package org.eclipse.linuxtools.internal.tmf.ui.parsers.wizards;
2
3 import org.eclipse.jface.viewers.ISelection;
4 import org.eclipse.jface.viewers.IStructuredSelection;
5 import org.eclipse.jface.wizard.Wizard;
6 import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomTxtTraceDefinition;
7 import org.eclipse.ui.INewWizard;
8 import org.eclipse.ui.IWorkbench;
9
10 public class CustomTxtParserWizard extends Wizard implements INewWizard {
11
12 CustomTxtParserInputWizardPage inputPage;
13 CustomTxtParserOutputWizardPage outputPage;
14 private ISelection selection;
15 CustomTxtTraceDefinition definition;
16
17 public CustomTxtParserWizard() {
18 super();
19 }
20
21 public CustomTxtParserWizard(CustomTxtTraceDefinition definition) {
22 super();
23 this.definition = definition;
24 }
25
26 @Override
27 public boolean performFinish() {
28 CustomTxtTraceDefinition def = outputPage.getDefinition();
29 if (definition != null && !definition.definitionName.equals(def.definitionName)) {
30 CustomTxtTraceDefinition.delete(definition.definitionName);
31 }
32 def.save();
33 return true;
34 }
35
36 /**
37 * Adding the page to the wizard.
38 */
39
40 @Override
41 public void addPages() {
42 inputPage = new CustomTxtParserInputWizardPage(selection, definition);
43 addPage(inputPage);
44 outputPage = new CustomTxtParserOutputWizardPage(this);
45 addPage(outputPage);
46 }
47
48 @Override
49 public void init(IWorkbench workbench, IStructuredSelection selection) {
50 this.selection = selection;
51 }
52
53 }
This page took 0.030346 seconds and 5 git commands to generate.