1 /*******************************************************************************
2 * Copyright (c) 2010, 2014 Ericsson
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
10 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.internal
.tmf
.ui
.project
.wizards
.importtrace
;
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
;
24 * The import trace wizard implementation.
27 * @author Francois Chouinard
30 public class ImportTraceWizard
extends Wizard
implements IImportWizard
{
32 // ------------------------------------------------------------------------
34 // ------------------------------------------------------------------------
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$
40 // ------------------------------------------------------------------------
42 // ------------------------------------------------------------------------
44 private IStructuredSelection fSelection
;
45 private ImportTraceWizardPage fTraceImportWizardPage
;
47 // ------------------------------------------------------------------------
49 // ------------------------------------------------------------------------
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
);
59 setDialogSettings(section
);
62 // ------------------------------------------------------------------------
64 // ------------------------------------------------------------------------
67 public void init(IWorkbench workbench
, IStructuredSelection selection
) {
68 fSelection
= selection
;
70 setWindowTitle(Messages
.ImportTraceWizard_DialogTitle
);
71 setDefaultPageImageDescriptor(AbstractUIPlugin
.imageDescriptorFromPlugin(PLUGIN_ID
, ICON_PATH
));
72 setNeedsProgressMonitor(true);
76 public void addPages() {
78 fTraceImportWizardPage
= new ImportTraceWizardPage(fSelection
);
79 addPage(fTraceImportWizardPage
);
83 public boolean performFinish() {
84 return fTraceImportWizardPage
.finish();