KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > importexport > breakpoints > WizardImportBreakpoints


1 /*******************************************************************************
2  * Copyright (c) 2005, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.debug.internal.ui.importexport.breakpoints;
13
14 import org.eclipse.debug.internal.ui.DebugUIPlugin;
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.ui.IImportWizard;
19 import org.eclipse.ui.IWorkbench;
20
21 /**
22  * <p>
23  * Wizard for Importing breakpoints.
24  * It serves a dual purpose, in that it is used by the platform import/export wizard,
25  * but it can also be used as a standalone wizard.
26  * </p>
27  * <p>
28  * Example:
29  * </p>
30  * <pre>
31  * IWizard wiz = new WizardImportBreakpoints();
32  * wiz.init(workbench, selection);
33  * WizardDialog wizdialog = new WizardDialog(shell, wiz);
34  * wizdialog.open();
35  * </pre>
36  *
37  * This class uses <code>WizardImportBreakpointsPage</code>
38  *
39  * @since 3.2
40  *
41  */

42 public class WizardImportBreakpoints extends Wizard implements IImportWizard {
43
44     /*
45      * The main page
46      */

47     private WizardImportBreakpointsPage fMainPage = null;
48     
49     /**
50      * Identifier for dialog settings section for the import wizard.
51      */

52     private static final String JavaDoc IMPORT_DIALOG_SETTINGS = "BreakpointImportSettings"; //$NON-NLS-1$
53

54     /**
55      * This is the default constructor
56      */

57     public WizardImportBreakpoints() {
58         super();
59         DebugUIPlugin plugin = DebugUIPlugin.getDefault();
60         IDialogSettings workbenchSettings = plugin.getDialogSettings();
61         IDialogSettings section = workbenchSettings.getSection(IMPORT_DIALOG_SETTINGS);
62         if (section == null)
63             section = workbenchSettings.addNewSection(IMPORT_DIALOG_SETTINGS);
64         setDialogSettings(section);
65     }
66
67     /* (non-Javadoc)
68      * @see org.eclipse.jface.wizard.IWizard#addPages()
69      */

70     public void addPages() {
71         super.addPages();
72         fMainPage = new WizardImportBreakpointsPage(ImportExportMessages.WizardImportBreakpoints_0);
73         addPage(fMainPage);
74     }
75     
76     /* (non-Javadoc)
77      * @see org.eclipse.jface.wizard.IWizard#dispose()
78      */

79     public void dispose() {
80         super.dispose();
81         fMainPage = null;
82     }
83
84     /* (non-Javadoc)
85      * @see org.eclipse.jface.wizard.IWizard#performFinish()
86      */

87     public boolean performFinish() {
88         return fMainPage.finish();
89     }
90
91     /* (non-Javadoc)
92      * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
93      */

94     public void init(IWorkbench workbench, IStructuredSelection selection) {
95         setWindowTitle(ImportExportMessages.WizardImportBreakpoints_0);
96         setNeedsProgressMonitor(true);
97     }
98 }
99
Popular Tags