01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.internal.ui.wizards.extension;
11:
12: import org.eclipse.core.resources.IProject;
13: import org.eclipse.jface.viewers.IStructuredSelection;
14: import org.eclipse.jface.wizard.Wizard;
15: import org.eclipse.pde.core.plugin.IPluginModelBase;
16: import org.eclipse.pde.internal.ui.PDEPlugin;
17: import org.eclipse.pde.internal.ui.PDEPluginImages;
18: import org.eclipse.pde.internal.ui.PDEUIMessages;
19: import org.eclipse.pde.internal.ui.elements.ElementList;
20:
21: public class ExtensionEditorWizard extends Wizard {
22: public static final String PLUGIN_POINT = "newExtension"; //$NON-NLS-1$
23: private ExtensionEditorSelectionPage pointPage;
24: private IPluginModelBase model;
25: private IProject project;
26: private IStructuredSelection selection;
27: private ElementList wizards;
28:
29: public ExtensionEditorWizard(IProject project,
30: 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:
42: public void addPages() {
43: pointPage = new ExtensionEditorSelectionPage(wizards);
44: pointPage.init(project, model.getPluginBase(), selection);
45: addPage(pointPage);
46: }
47:
48: private void loadWizardCollection() {
49: NewExtensionRegistryReader reader = new NewExtensionRegistryReader(
50: true);
51: wizards = reader.readRegistry(PDEPlugin.getPluginId(),
52: PLUGIN_POINT, 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: }
|