public interface ITemplateSection
If a section generates extensions, it should be written in such a way to be used both in the 'New Extension' wizard and as a part of a new plug-in project wizard. When used as part of the new plug-in project wizard, it may appear alongside other templates and therefore should not do anything that prevents it.
Modifier and Type | Method and Description |
---|---|
void |
addPages(Wizard wizard)
Adds template-related pages to the wizard.
|
void |
execute(IProject project,
IPluginModelBase model,
IProgressMonitor monitor)
Executes the template.
|
IPluginReference[] |
getDependencies(String schemaVersion)
Provides the list of template dependencies.
|
String |
getDescription()
Returns a description of the section.
|
String |
getLabel()
Returns a presentable label the section.
|
String[] |
getNewFiles()
Returns an array of tokens representing new files and folders created by
this template section.
|
int |
getNumberOfWorkUnits()
Returns the number of work units that this template will consume during
the execution.
|
WizardPage |
getPage(int pageIndex)
Returns a wizard page at the provided index.
|
int |
getPageCount()
Returns number of pages that are contributed by this template.
|
boolean |
getPagesAdded()
Tests whether this template have had a chance to create its pages.
|
String |
getReplacementString(String fileName,
String key)
Returns a replacement string for the provided key.
|
URL |
getTemplateLocation()
Returns the URL of the zip file containing template files and directories
that will be created in the plug-in project.
|
String |
getUsedExtensionPoint()
Returns identifier of the extension point used in this section.
|
URL getTemplateLocation()
String getLabel()
String getDescription()
String getReplacementString(String fileName, String key)
fileName
- the name of the file in which the key was found. You can use
it to return different values for different files.key
- the replacement key found in the template filevoid addPages(Wizard wizard)
wizard
- the host wizard to add pages intoWizardPage getPage(int pageIndex)
pageIndex
- the index to get the page forint getPageCount()
boolean getPagesAdded()
int getNumberOfWorkUnits()
IPluginReference[] getDependencies(String schemaVersion)
schemaVersion
- version of the target manifest, or null if older
manifest (prior to 3.0) will be created. Depending on the
manifest version, the list of dependencies may vary.String getUsedExtensionPoint()
void execute(IProject project, IPluginModelBase model, IProgressMonitor monitor) throws CoreException
project
- the workspace project that contains the plug-inmodel
- structured representation of the plug-in manifestmonitor
- progress monitor to indicate execution progressCoreException
- if there is a problem generating resourcesString[] getNewFiles()
build.properties
file so that the generated files and
folders are included in the binary build. The tokens will be added as-is
to the variable bin.includes
. For this reason, wild cards
and other syntax rules applicable to this variable can be used in this
method. For example:
return new String[]{"/icons/*.png"};
bin.includes
variable in build.properties
file.
Copyright (c) 2000, 2016 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.