tmf: Add missing Javadoc to tmf.ui
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / internal / tmf / ui / parsers / wizards / CustomXmlParserWizard.java
CommitLineData
a0a88f65
AM
1/*******************************************************************************
2 * Copyright (c) 2013 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Patrick Tassé - Initial API and implementation
11 *******************************************************************************/
12
be222f56
PT
13package org.eclipse.linuxtools.internal.tmf.ui.parsers.wizards;
14
15import org.eclipse.jface.viewers.ISelection;
16import org.eclipse.jface.viewers.IStructuredSelection;
17import org.eclipse.jface.wizard.Wizard;
18import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomXmlTraceDefinition;
19import org.eclipse.ui.INewWizard;
20import org.eclipse.ui.IWorkbench;
21
a0a88f65
AM
22/**
23 * Wizard for custom XML trace parsers.
24 *
25 * @author Patrick Tassé
26 */
be222f56
PT
27public class CustomXmlParserWizard extends Wizard implements INewWizard {
28
29 CustomXmlParserInputWizardPage inputPage;
30 CustomXmlParserOutputWizardPage outputPage;
31 private ISelection selection;
32 CustomXmlTraceDefinition definition;
33
a0a88f65
AM
34 /**
35 * Default constructor
36 */
be222f56
PT
37 public CustomXmlParserWizard() {
38 super();
39 }
40
a0a88f65
AM
41 /**
42 * Constructor
43 *
44 * @param definition
45 * The trace definition
46 */
be222f56
PT
47 public CustomXmlParserWizard(CustomXmlTraceDefinition definition) {
48 super();
49 this.definition = definition;
50 }
51
52 @Override
53 public boolean performFinish() {
54 CustomXmlTraceDefinition def = outputPage.getDefinition();
55 if (definition != null && !definition.definitionName.equals(def.definitionName)) {
56 CustomXmlTraceDefinition.delete(definition.definitionName);
57 }
58 def.save();
59 return true;
60 }
61
62 /**
63 * Adding the page to the wizard.
64 */
65
66 @Override
a0a88f65 67 public void addPages() {
be222f56
PT
68 inputPage = new CustomXmlParserInputWizardPage(selection, definition);
69 addPage(inputPage);
70 outputPage = new CustomXmlParserOutputWizardPage(this);
71 addPage(outputPage);
72 }
73
74 @Override
a0a88f65 75 public void init(IWorkbench workbench, IStructuredSelection selection) {
be222f56
PT
76 this.selection = selection;
77 }
78
79}
This page took 0.028263 seconds and 5 git commands to generate.