KickJava   Java API By Example, From Geeks To Geeks.

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


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