KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*******************************************************************************
2  * Copyright (c) 2004, 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
12 package org.eclipse.ant.internal.ui.datatransfer;
13
14 import java.util.List JavaDoc;
15
16 import org.eclipse.ant.internal.ui.AntUIImages;
17 import org.eclipse.ant.internal.ui.IAntUIConstants;
18 import org.eclipse.jface.viewers.IStructuredSelection;
19 import org.eclipse.jface.wizard.Wizard;
20 import org.eclipse.ui.IExportWizard;
21 import org.eclipse.ui.IWorkbench;
22
23 /**
24  * Exports currently selected Eclipse Java project as an Ant buildfile.
25  */

26 public class AntBuildfileExportWizard extends Wizard implements IExportWizard
27 {
28     private IStructuredSelection fSelection;
29     private AntBuildfileExportPage fMainPage;
30     
31     /**
32      * Creates buildfile.
33      */

34     public boolean performFinish()
35     {
36         return fMainPage.generateBuildfiles();
37     }
38  
39     public void addPages()
40     {
41         fMainPage = new AntBuildfileExportPage();
42         List JavaDoc projects = fSelection.toList();
43         fMainPage.setSelectedProjects(projects);
44         addPage(fMainPage);
45     }
46
47     public void init(IWorkbench workbench, IStructuredSelection selection)
48     {
49         setWindowTitle(DataTransferMessages.AntBuildfileExportWizard_0);
50         setDefaultPageImageDescriptor(AntUIImages.getImageDescriptor(IAntUIConstants.IMG_EXPORT_WIZARD_BANNER));
51         fSelection= selection;
52     }
53 }
54
Popular Tags