1 /*******************************************************************************
2 * Copyright (c) 2009 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
.tmf
.ui
.views
.project
.dialogs
;
15 import java
.util
.List
;
17 import org
.eclipse
.jface
.dialogs
.IDialogSettings
;
18 import org
.eclipse
.jface
.viewers
.IStructuredSelection
;
19 import org
.eclipse
.jface
.viewers
.StructuredSelection
;
20 import org
.eclipse
.jface
.wizard
.Wizard
;
21 import org
.eclipse
.ui
.IImportWizard
;
22 import org
.eclipse
.ui
.IWorkbench
;
23 import org
.eclipse
.ui
.ide
.IDE
;
24 import org
.eclipse
.ui
.internal
.WorkbenchPlugin
;
25 import org
.eclipse
.ui
.internal
.ide
.IDEWorkbenchPlugin
;
26 import org
.eclipse
.ui
.internal
.wizards
.datatransfer
.DataTransferMessages
;
29 * <b><u>ImportTraceWizard</u></b>
32 * TODO: Implement me. Please.
34 @SuppressWarnings("restriction")
35 public class ImportTraceWizard
extends Wizard
implements IImportWizard
{
37 private IWorkbench fWorkbench
;
38 private IStructuredSelection fSelection
;
39 private ImportTraceWizardPage fMainPage
;
44 public ImportTraceWizard() {
45 IDialogSettings workbenchSettings
= WorkbenchPlugin
.getDefault().getDialogSettings();
46 IDialogSettings section
= workbenchSettings
.getSection("TmfTraceImportWizard");
47 if (section
== null) {
48 section
= workbenchSettings
.addNewSection("TmfTraceImportWizard");
50 setDialogSettings(section
);
54 * @see org.eclipse.jface.wizard.Wizard#addPages()
57 public void addPages() {
59 fMainPage
= new ImportTraceWizardPage(fWorkbench
, fSelection
);
64 * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
66 @SuppressWarnings("rawtypes")
67 public void init(IWorkbench workbench
, IStructuredSelection selection
) {
68 fWorkbench
= workbench
;
69 fSelection
= selection
;
71 List selectedResources
= IDE
.computeSelectedResources(selection
);
72 if (!selectedResources
.isEmpty()) {
73 fSelection
= new StructuredSelection(selectedResources
);
76 setWindowTitle(DataTransferMessages
.DataTransfer_importTitle
);
77 setDefaultPageImageDescriptor(IDEWorkbenchPlugin
.getIDEImageDescriptor("wizban/importdir_wiz.png"));
78 setNeedsProgressMonitor(true);
82 * @see org.eclipse.jface.wizard.Wizard#performFinish()
85 public boolean performFinish() {
86 return fMainPage
.finish();