Move alltests plugin to the Trace Compass namespace
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.ui / src / org / eclipse / linuxtools / internal / tmf / ui / project / wizards / importtrace / ImportTraceWizard.java
1 /*******************************************************************************
2 * Copyright (c) 2010, 2014 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 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.internal.tmf.ui.project.wizards.importtrace;
14
15 import org.eclipse.jface.dialogs.IDialogSettings;
16 import org.eclipse.jface.viewers.IStructuredSelection;
17 import org.eclipse.jface.wizard.Wizard;
18 import org.eclipse.linuxtools.internal.tmf.ui.Activator;
19 import org.eclipse.ui.IImportWizard;
20 import org.eclipse.ui.IWorkbench;
21 import org.eclipse.ui.plugin.AbstractUIPlugin;
22
23 /**
24 * The import trace wizard implementation.
25 * <p>
26 * @version 1.0
27 * @author Francois Chouinard
28 * @since 2.0
29 */
30 public class ImportTraceWizard extends Wizard implements IImportWizard {
31
32 // ------------------------------------------------------------------------
33 // Constants
34 // ------------------------------------------------------------------------
35
36 static private final String PLUGIN_ID = Activator.PLUGIN_ID;
37 static private final String IMPORT_WIZARD = "ImportTraceWizard"; //$NON-NLS-1$
38 static private final String ICON_PATH = "icons/wizban/trace_import_wiz.png"; //$NON-NLS-1$
39
40 // ------------------------------------------------------------------------
41 // Attributes
42 // ------------------------------------------------------------------------
43
44 private IStructuredSelection fSelection;
45 private ImportTraceWizardPage fTraceImportWizardPage;
46
47 // ------------------------------------------------------------------------
48 // Constructor
49 // ------------------------------------------------------------------------
50 /**
51 * Default constructor
52 */
53 public ImportTraceWizard() {
54 IDialogSettings workbenchSettings = Activator.getDefault().getDialogSettings();
55 IDialogSettings section = workbenchSettings.getSection(IMPORT_WIZARD);
56 if (section == null) {
57 section = workbenchSettings.addNewSection(IMPORT_WIZARD);
58 }
59 setDialogSettings(section);
60 }
61
62 // ------------------------------------------------------------------------
63 // Wizard
64 // ------------------------------------------------------------------------
65
66 @Override
67 public void init(IWorkbench workbench, IStructuredSelection selection) {
68 fSelection = selection;
69
70 setWindowTitle(Messages.ImportTraceWizard_DialogTitle);
71 setDefaultPageImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, ICON_PATH));
72 setNeedsProgressMonitor(true);
73 }
74
75 @Override
76 public void addPages() {
77 super.addPages();
78 fTraceImportWizardPage = new ImportTraceWizardPage(fSelection);
79 addPage(fTraceImportWizardPage);
80 }
81
82 @Override
83 public boolean performFinish() {
84 return fTraceImportWizardPage.finish();
85 }
86
87 }
This page took 0.032796 seconds and 5 git commands to generate.