KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > ui > IPluginContentWizard


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.ui;
12 import org.eclipse.core.resources.IProject;
13 import org.eclipse.core.runtime.IProgressMonitor;
14 import org.eclipse.pde.core.plugin.IPluginModelBase;
15 import org.eclipse.pde.core.plugin.IPluginReference;
16 /**
17  * Classes that implement this interface are contributed via the extension point
18  * <code>org.eclipse.pde.ui.pluginContent</code>. The expectation is that
19  * classes also extend JFace Wizard class. The role of this wizard is to provide
20  * additional plug-in content after the project and the critical plug-in project
21  * files have been created. The wizard is nested in the overall 'New' wizard and
22  * can contribute one or more pages that allow users to configure how this
23  * content will be generated. A typical implementation of this interface would
24  * be a template wizard that populates the plug-in project with content that can
25  * be useful right away (for example, a view or an editor extension).
26  * <p>
27  * Due to the call order of the method <code>performFinish</code> in nested
28  * wizards, classes that implement this interface should not place the code that
29  * generates new content in the implementation of the abstract method
30  * <code>Wizard.performFinish()</code>. Instead, they should simply return
31  * <code>true</code> and have all the real code in <code>performFinish</code>
32  * defined in this interface. This version of the method passes all the context
33  * required for the content generation and is called AFTER the project and vital
34  * plug-in files have been already created.
35  *
36  * @since 3.0
37  */

38 public interface IPluginContentWizard extends IBasePluginWizard {
39     /**
40      * Initializes the wizard with the data collected from the parent wizard
41      * pages. The data can be used to customize the generated content.
42      *
43      * @param data
44      * all the information collected in the parent wizard that can be
45      * used in configuring the generated content
46      */

47     void init(IFieldData data);
48     /**
49      * Returns new dependencies that are required by this wizard. If the wizard
50      * adds extensions or code to the plug-in that depend on other plug-ins, it
51      * must report it by returning a reference to that plug-in. This information
52      * will be used to compose a correct list of plug-in dependencies so that
53      * the plug-in compiles without errors in the first build after creation.
54      *
55      * @param schemaVersion
56      * version of the plug-in manifest, or <samp>null </samp> if
57      * older manifest (prior to 3.0) has been created. Depending on
58      * the manifest version, the list of dependencies may vary.
59      * @return the array of plug-in dependencies required by this wizard
60      */

61     IPluginReference[] getDependencies(String JavaDoc schemaVersion);
62     /**
63      * The wizard is required to return an array of new file and folder names
64      * that are generated by it for the purpose of inclusion in
65      * <code>build.properties</code> file. All files and folders that must be
66      * part of the binary build must be listed in <code>bin.includes</code>
67      * variable. Since the tokens obtained by this method will be passed to the
68      * variable as-is, it is legal to use all wild cards also legal in
69      * <code>build.properties,
70      * such as "*.gif".
71      *
72      * @return an array of new file and folder names
73      */

74     String JavaDoc[] getNewFiles();
75
76     /**
77      * Executes the wizard when 'Finish' button has been pressed. Note that you
78      * should put all your working code in this method and not in
79      * 'performFinish' of the Wizard class due to the wrong calling order. In
80      * addition, this method provides progress monitor so that the execution of
81      * the content wizard can be reported as a part of the overall new project
82      * creation operation.
83      *
84      * @param project
85      * the newly created plug-in project handle
86      * @param model
87      * the model of the plug-in manifest that can be used to add
88      * extension markup
89      * @param monitor
90      * the progress monitor to track progress of the content
91      * generation
92      * @return <code>true</code> if the content has been generated
93      * successfully, <code>false</code> otherwise. In case of failure,
94      * the wizard dialog will stay open.
95      */

96     boolean performFinish(IProject project, IPluginModelBase model,
97             IProgressMonitor monitor);
98     
99 }
100
Popular Tags