KickJava   Java API By Example, From Geeks To Geeks.

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


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.IExportWizard;
19 import org.eclipse.ui.IWorkbench;
20
21 /**
22  * <p>
23  * This class provides a wizard for exporting breakpoints.
24  * It serves 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 WizardExportBreakpoints();
32  * wiz.init(workbench, selection);
33  * WizardDialog wizdialog = new WizardDialog(shell, wiz);
34  * wizdialog.open();
35  * </pre>
36  *
37  * This class uses <code>WizardExportBreakpointsPage</code>
38  *
39  * @since 3.2
40  *
41  */

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

47     private WizardExportBreakpointsPage fMainPage = null;
48     
49     /**
50      * The existing selection
51      */

52     private IStructuredSelection fSelection = null;
53     
54     /**
55      * Identifier for dialog settings section for the export wizard.
56      */

57     private static final String JavaDoc EXPORT_DIALOG_SETTINGS = "BreakpointExportSettings"; //$NON-NLS-1$
58

59     /**
60      * This is the default constructor
61      */

62     public WizardExportBreakpoints() {
63         super();
64         DebugUIPlugin plugin = DebugUIPlugin.getDefault();
65         IDialogSettings workbenchSettings = plugin.getDialogSettings();
66         IDialogSettings section = workbenchSettings.getSection(EXPORT_DIALOG_SETTINGS);
67         if (section == null)
68             section = workbenchSettings.addNewSection(EXPORT_DIALOG_SETTINGS);
69         setDialogSettings(section);
70     }
71
72     /* (non-Javadoc)
73      * @see org.eclipse.jface.wizard.IWizard#addPages()
74      */

75     public void addPages() {
76         super.addPages();
77         fMainPage = new WizardExportBreakpointsPage(ImportExportMessages.WizardExportBreakpoints_0, fSelection);
78         addPage(fMainPage);
79     }
80
81     /* (non-Javadoc)
82      * @see org.eclipse.jface.wizard.IWizard#dispose()
83      */

84     public void dispose() {
85         super.dispose();
86         fMainPage = null;
87         fSelection = null;
88     }
89
90     /* (non-Javadoc)
91      * @see org.eclipse.jface.wizard.IWizard#performFinish()
92      */

93     public boolean performFinish() {
94         return fMainPage.finish();
95     }
96
97     /* (non-Javadoc)
98      * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
99      */

100     public void init(IWorkbench workbench, IStructuredSelection selection) {
101         fSelection = selection;
102         setWindowTitle(ImportExportMessages.WizardExportBreakpoints_0);
103         setNeedsProgressMonitor(true);
104     }
105 }
106
Popular Tags