ss: Move plugins to Trace Compass namespace
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / internal / tmf / ui / project / wizards / importtrace / ImportTraceWizard.java
CommitLineData
002f9f07 1/*******************************************************************************
60ae41e1 2 * Copyright (c) 2010, 2014 Ericsson
002f9f07
BH
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
1de10308 13package org.eclipse.linuxtools.internal.tmf.ui.project.wizards.importtrace;
002f9f07 14
002f9f07
BH
15import org.eclipse.jface.dialogs.IDialogSettings;
16import org.eclipse.jface.viewers.IStructuredSelection;
002f9f07
BH
17import org.eclipse.jface.wizard.Wizard;
18import org.eclipse.linuxtools.internal.tmf.ui.Activator;
002f9f07
BH
19import org.eclipse.ui.IImportWizard;
20import org.eclipse.ui.IWorkbench;
002f9f07
BH
21import 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 */
30public 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
002f9f07
BH
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) {
002f9f07
BH
68 fSelection = selection;
69
002f9f07
BH
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();
d0e34947 78 fTraceImportWizardPage = new ImportTraceWizardPage(fSelection);
002f9f07
BH
79 addPage(fTraceImportWizardPage);
80 }
81
82 @Override
83 public boolean performFinish() {
84 return fTraceImportWizardPage.finish();
85 }
86
87}
This page took 0.037251 seconds and 5 git commands to generate.