KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > ide > dialogs > ProjectCapabilitySimpleAddWizard


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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.ui.internal.ide.dialogs;
12
13 import org.eclipse.core.resources.IProject;
14 import org.eclipse.jface.resource.ImageDescriptor;
15 import org.eclipse.jface.viewers.IStructuredSelection;
16 import org.eclipse.jface.wizard.Wizard;
17 import org.eclipse.ui.IWorkbench;
18 import org.eclipse.ui.internal.ide.IDEWorkbenchMessages;
19 import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin;
20
21 public class ProjectCapabilitySimpleAddWizard extends Wizard {
22     private ProjectCapabilitySimpleSelectionPage mainPage;
23
24     private IWorkbench workbench;
25
26     private IStructuredSelection selection;
27
28     private IProject project;
29
30     public ProjectCapabilitySimpleAddWizard(IWorkbench workbench,
31             IStructuredSelection selection, IProject project) {
32         super();
33         this.workbench = workbench;
34         this.selection = selection;
35         this.project = project;
36         setForcePreviousAndNextButtons(true);
37         setNeedsProgressMonitor(true);
38         initializeDefaultPageImageDescriptor();
39         setWindowTitle(IDEWorkbenchMessages.ProjectCapabilitySimpleSelectionPage_windowTitle);
40     }
41
42     /* (non-Javadoc)
43      * Method declared on IWizard
44      */

45     public void addPages() {
46         mainPage = new ProjectCapabilitySimpleSelectionPage(
47                 "projectCapabilitySimpleSelectionPage", //$NON-NLS-1$
48
workbench, selection, project);
49         mainPage.setTitle(IDEWorkbenchMessages.ProjectCapabilitySimpleSelectionPage_title);
50         mainPage.setDescription(IDEWorkbenchMessages.ProjectCapabilitySimpleSelectionPage_description);
51         addPage(mainPage);
52     }
53
54     /* (non-Javadoc)
55      * Method declared on IWizard.
56      */

57     public boolean canFinish() {
58         return false;
59     }
60
61     /**
62      * Sets the image banner for the wizard
63      */

64     protected void initializeDefaultPageImageDescriptor() {
65         ImageDescriptor desc = IDEWorkbenchPlugin.getIDEImageDescriptor("wizban/newprj_wiz.gif");//$NON-NLS-1$
66
setDefaultPageImageDescriptor(desc);
67     }
68
69     /* (non-Javadoc)
70      * Method declared on IWizard
71      */

72     public boolean performFinish() {
73         return true;
74     }
75 }
76
Popular Tags