2010-11-09 Francois Chouinard <fchouinard@gmail.com> Contribution for Bug315307
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / project / dialogs / ImportTraceWizard.java
CommitLineData
abfad0aa
FC
1/*******************************************************************************
2 * Copyright (c) 2009 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
13package org.eclipse.linuxtools.tmf.ui.views.project.dialogs;
14
15import java.util.List;
16
17import org.eclipse.jface.dialogs.IDialogSettings;
18import org.eclipse.jface.viewers.IStructuredSelection;
19import org.eclipse.jface.viewers.StructuredSelection;
20import org.eclipse.jface.wizard.Wizard;
21import org.eclipse.ui.IImportWizard;
22import org.eclipse.ui.IWorkbench;
23import org.eclipse.ui.ide.IDE;
24import org.eclipse.ui.internal.WorkbenchPlugin;
25import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin;
26import org.eclipse.ui.internal.wizards.datatransfer.DataTransferMessages;
27
28/**
29 * <b><u>ImportTraceWizard</u></b>
30 * <p>
31 *
32 * TODO: Implement me. Please.
33 */
34@SuppressWarnings("restriction")
35public class ImportTraceWizard extends Wizard implements IImportWizard {
36
37 private IWorkbench fWorkbench;
38 private IStructuredSelection fSelection;
39 private ImportTraceWizardPage fMainPage;
40
41 /**
42 *
43 */
44 public ImportTraceWizard() {
45 IDialogSettings workbenchSettings = WorkbenchPlugin.getDefault().getDialogSettings();
3b38ea61 46 IDialogSettings section = workbenchSettings.getSection("TmfTraceImportWizard"); //$NON-NLS-1$
abfad0aa 47 if (section == null) {
3b38ea61 48 section = workbenchSettings.addNewSection("TmfTraceImportWizard"); //$NON-NLS-1$
abfad0aa
FC
49 }
50 setDialogSettings(section);
51 }
52
53 /* (non-Javadoc)
54 * @see org.eclipse.jface.wizard.Wizard#addPages()
55 */
56 @Override
57 public void addPages() {
58 super.addPages();
59 fMainPage = new ImportTraceWizardPage(fWorkbench, fSelection);
60 addPage(fMainPage);
61 }
62
63 /* (non-Javadoc)
64 * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
65 */
d4011df2 66 @Override
abfad0aa
FC
67 @SuppressWarnings("rawtypes")
68 public void init(IWorkbench workbench, IStructuredSelection selection) {
69 fWorkbench = workbench;
70 fSelection = selection;
71
72 List selectedResources = IDE.computeSelectedResources(selection);
73 if (!selectedResources.isEmpty()) {
74 fSelection = new StructuredSelection(selectedResources);
75 }
76
77 setWindowTitle(DataTransferMessages.DataTransfer_importTitle);
3b38ea61 78 setDefaultPageImageDescriptor(IDEWorkbenchPlugin.getIDEImageDescriptor("wizban/importdir_wiz.png")); //$NON-NLS-1$
abfad0aa
FC
79 setNeedsProgressMonitor(true);
80 }
81
82 /* (non-Javadoc)
83 * @see org.eclipse.jface.wizard.Wizard#performFinish()
84 */
85 @Override
86 public boolean performFinish() {
87 return fMainPage.finish();
88 }
89
90}
This page took 0.029098 seconds and 5 git commands to generate.