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.pde.core.plugin.IPluginExtensionPoint;
14: import org.eclipse.pde.core.plugin.IPluginModelBase;
15: import org.eclipse.pde.internal.ui.PDEPlugin;
16: import org.eclipse.pde.internal.ui.PDEPluginImages;
17: import org.eclipse.pde.internal.ui.PDEUIMessages;
18: import org.eclipse.pde.internal.ui.editor.plugin.ManifestEditor;
19: import org.eclipse.pde.internal.ui.wizards.NewWizard;
20:
21: public class NewExtensionPointWizard extends NewWizard {
22: private NewExtensionPointMainPage mainPage;
23: private IPluginModelBase model;
24: private IProject project;
25: private IPluginExtensionPoint point;
26: private ManifestEditor editor;
27:
28: public NewExtensionPointWizard(IProject project,
29: IPluginModelBase model, ManifestEditor editor) {
30: this (project, model, (IPluginExtensionPoint) null);
31: this .editor = editor;
32: }
33:
34: public NewExtensionPointWizard(IProject project,
35: IPluginModelBase model, IPluginExtensionPoint point) {
36: initialize();
37: this .project = project;
38: this .model = model;
39: this .point = point;
40: }
41:
42: public void initialize() {
43: setDialogSettings(PDEPlugin.getDefault().getDialogSettings());
44: setDefaultPageImageDescriptor(PDEPluginImages.DESC_NEWEXP_WIZ);
45: setWindowTitle(PDEUIMessages.NewExtensionPointWizard_wtitle);
46: setNeedsProgressMonitor(true);
47: }
48:
49: public void addPages() {
50: mainPage = new NewExtensionPointMainPage(project, model, point);
51: addPage(mainPage);
52: }
53:
54: public boolean performFinish() {
55: if (editor != null)
56: editor.ensurePluginContextPresence();
57: return mainPage.finish();
58: }
59: }
|