KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-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.model.AntUIImages;
14 import org.eclipse.ant.internal.ui.model.IAntUIConstants;
15 import org.eclipse.jface.viewers.IStructuredSelection;
16 import org.eclipse.jface.wizard.Wizard;
17 import org.eclipse.ui.IImportWizard;
18 import org.eclipse.ui.IWorkbench;
19
20 public class AntBuildfileImportWizard extends Wizard implements IImportWizard {
21
22     private ExternalAntBuildfileImportPage mainPage;
23
24     public AntBuildfileImportWizard() {
25         super();
26     }
27
28     /* (non-Javadoc)
29     * Method declared on IWizard.
30     */

31     public void addPages() {
32         super.addPages();
33         mainPage = new ExternalAntBuildfileImportPage();
34         addPage(mainPage);
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.getString("AntBuildfileImportWizard.0")); //$NON-NLS-1$
42
setDefaultPageImageDescriptor(AntUIImages.getImageDescriptor(IAntUIConstants.IMG_IMPORT_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 (mainPage.createProject() != null);
57     }
58 }
Popular Tags