KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ant > internal > ui > datatransfer > AntNewJavaProjectWizard


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.ant.internal.ui.datatransfer;
12
13 import org.eclipse.ant.internal.ui.AntUIImages;
14 import org.eclipse.ant.internal.ui.IAntUIConstants;
15 import org.eclipse.jface.viewers.IStructuredSelection;
16 import org.eclipse.jface.wizard.Wizard;
17 import org.eclipse.ui.INewWizard;
18 import org.eclipse.ui.IWorkbench;
19
20 public class AntNewJavaProjectWizard extends Wizard implements INewWizard {
21
22     private AntNewJavaProjectPage fMainPage;
23
24     public AntNewJavaProjectWizard() {
25         super();
26     }
27
28     /* (non-Javadoc)
29      * @see org.eclipse.jface.wizard.IWizard#addPages()
30      */

31     public void addPages() {
32         super.addPages();
33         fMainPage = new AntNewJavaProjectPage();
34         addPage(fMainPage);
35     }
36     
37     /* (non-Javadoc)
38      * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
39      */

40     public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
41         setWindowTitle(DataTransferMessages.AntNewJavaProjectWizard_0);
42         setDefaultPageImageDescriptor(AntUIImages.getImageDescriptor(IAntUIConstants.IMG_WIZARD_BANNER));
43         
44     }
45     /* (non-Javadoc)
46      * @see org.eclipse.jface.wizard.IWizard#performCancel()
47      */

48     public boolean performCancel() {
49         return true;
50     }
51     
52     /* (non-Javadoc)
53      * @see org.eclipse.jface.wizard.IWizard#performFinish()
54      */

55     public boolean performFinish() {
56         return (fMainPage.createProject() != null);
57     }
58 }
59
Popular Tags