KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > wizards > extension > ExtensionEditorWizard


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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 package org.eclipse.pde.internal.ui.wizards.extension;
12
13 import org.eclipse.core.resources.IProject;
14 import org.eclipse.jface.viewers.IStructuredSelection;
15 import org.eclipse.jface.wizard.Wizard;
16 import org.eclipse.pde.core.plugin.IPluginModelBase;
17 import org.eclipse.pde.internal.ui.PDEPlugin;
18 import org.eclipse.pde.internal.ui.PDEPluginImages;
19 import org.eclipse.pde.internal.ui.PDEUIMessages;
20 import org.eclipse.pde.internal.ui.elements.ElementList;
21
22 public class ExtensionEditorWizard extends Wizard {
23     public static final String JavaDoc PLUGIN_POINT = "newExtension"; //$NON-NLS-1$
24
private ExtensionEditorSelectionPage pointPage;
25     private IPluginModelBase model;
26     private IProject project;
27     private IStructuredSelection selection;
28     private ElementList wizards;
29     
30     public ExtensionEditorWizard(IProject project, IPluginModelBase model, IStructuredSelection selection) {
31         setDialogSettings(PDEPlugin.getDefault().getDialogSettings());
32         setDefaultPageImageDescriptor(PDEPluginImages.DESC_NEWEX_WIZ);
33         this.model = model;
34         this.project = project;
35         this.selection = selection;
36         setForcePreviousAndNextButtons(true);
37         setWindowTitle(PDEUIMessages.ExtensionEditorWizard_wtitle);
38         PDEPlugin.getDefault().getLabelProvider().connect(this);
39         loadWizardCollection();
40     }
41     public void addPages() {
42         pointPage =
43             new ExtensionEditorSelectionPage(wizards);
44         pointPage.init(project, model.getPluginBase(), selection);
45         addPage(pointPage);
46     }
47     private void loadWizardCollection() {
48         NewExtensionRegistryReader reader = new NewExtensionRegistryReader(true);
49         wizards = reader.readRegistry(
50                 PDEPlugin.getPluginId(),
51                 PLUGIN_POINT,
52                 true);
53     }
54
55     public boolean performFinish() {
56         return true;
57     }
58
59     public void dispose() {
60         super.dispose();
61         PDEPlugin.getDefault().getLabelProvider().disconnect(this);
62     }
63 }
64
Popular Tags