public abstract class OptionTemplateSection extends BaseOptionTemplateSection
[install location]/[templateDirectory]/[sectionId]where
templateDirectory
is expected to be 'templates_3.0' (to
distinguish from template designed for earlier Eclipse versions), and
sectionId
is the unique identifier as reported by the template
section.
It also assumes that all wizard pages associated with this template will be
based on OptionTemplateWizardPage
.
KEY_ACTIVATOR_SIMPLE, KEY_PACKAGE_NAME, KEY_PLUGIN_CLASS, KEY_PLUGIN_ID, KEY_PLUGIN_NAME, model, project
Constructor and Description |
---|
OptionTemplateSection()
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
WizardPage |
createPage(int pageIndex)
Creates the wizard page for the specified page index.
|
WizardPage |
createPage(int pageIndex,
String helpContextId)
Creates the wizard page for the specified page index.
|
protected void |
flagMissingRequiredOption(TemplateOption option)
Locates the page that this option is presented in and flags that the
option is required and is currently not set.
|
String |
getDescription()
Returns the description of this template to be used in the UI.
|
protected abstract URL |
getInstallURL()
Returns the install URL of the plug-in that contributes this template.
|
String |
getLabel()
Returns the label of this template to be used in the UI.
|
TemplateOption[] |
getOptions(int pageIndex)
Returns options that belong to the page with the given index.
|
TemplateOption[] |
getOptions(WizardPage page)
Returns options that are added to the provided wizard page.
|
WizardPage |
getPage(int pageIndex)
Returns the wizard page at the specified index.
|
int |
getPageCount()
Returns a number of pages that this template contributes to the wizard.
|
int |
getPageIndex(TemplateOption option)
Returns the zero-based index of a page that hosts the the given option.
|
abstract String |
getSectionId()
Returns the unique name of this section.
|
protected String |
getTemplateDirectory()
Returns the directory where all the templates are located in the
contributing plug-in.
|
URL |
getTemplateLocation()
Implements the abstract method by looking for templates using the
following path:
[install location]/[templateDirectory]/[sectionId]
|
protected void |
registerOption(TemplateOption option,
Object value,
int pageIndex)
Registers the provided option and sets the initial value.
|
protected void |
resetPageState()
Resets the current page state by clearing the error message and making
the page complete, thereby allowing users to flip to the next page.
|
void |
setPageCount(int count)
Sets the number of pages this template will manage.
|
void |
validateOptions(TemplateOption source)
Validate options given a template option
|
addBlankField, addBlankField, addComboChoiceOption, addOption, addOption, addOption, execute, getBooleanOption, getReplacementString, getStringOption, getValue, initializeFields, initializeFields, initializeOption, isDependentOnParentWizard, setOptionEnabled
addPages, createExtension, generateFiles, generateFiles, getDependencies, getManifestHeader, getNumberOfWorkUnits, getPagesAdded, getPluginResourceBundle, getPluginResourceString, getSourceFolder, getTargetVersion, hasBundleManifest, isOkToCreateFile, isOkToCreateFolder, markPagesAdded, setManifestHeader, updateModel
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getNewFiles, getUsedExtensionPoint
public abstract String getSectionId()
getLabel()
,
getDescription()
,
getTemplateLocation()
protected String getTemplateDirectory()
protected abstract URL getInstallURL()
public URL getTemplateLocation()
[install location]/[templateDirectory]/[sectionId]
getTemplateLocation
in interface ITemplateSection
getTemplateLocation
in class AbstractTemplateSection
public WizardPage getPage(int pageIndex)
pageIndex
- the index to get the page forcreatePage(int)
public WizardPage createPage(int pageIndex)
pageIndex
- a zero-based index of the page relative to this template. For
example, if a template needs to have two pages, you have to
call this method twice (once with index 0 and again with index
1).setPageCount(int)
,
BaseOptionTemplateSection.addOption(java.lang.String, java.lang.String, boolean, int)
public WizardPage createPage(int pageIndex, String helpContextId)
pageIndex
- a zero-based index of the page relative to this template. For
example, if a template need to have two pages, you have to
call this method twice (once with index 0 and again with index
1).helpContextId
- the Id of the help context defined in the contributing plug-in
that will be used to locate content of the info-pop displayed
when F1 is pressed.setPageCount(int)
,
BaseOptionTemplateSection.addOption(java.lang.String, java.lang.String, boolean, int)
public int getPageCount()
setPageCount(int)
public void setPageCount(int count)
count
- number of pages that this template will contribute to the
template wizardpublic TemplateOption[] getOptions(int pageIndex)
pageIndex
- 0-based index of the template pagepublic TemplateOption[] getOptions(WizardPage page)
page
- wizard page that hosts required optionspublic int getPageIndex(TemplateOption option)
option
- template option for which a page index is being requestedpublic String getLabel()
public String getDescription()
getDescription
in interface ITemplateSection
getDescription
in class AbstractTemplateSection
protected void flagMissingRequiredOption(TemplateOption option)
option
- the option that is required and currently not setprotected void resetPageState()
protected void registerOption(TemplateOption option, Object value, int pageIndex)
BaseOptionTemplateSection
registerOption
in class BaseOptionTemplateSection
option
- the option to registervalue
- the initial valuepageIndex
- the page index to which this option belongspublic void validateOptions(TemplateOption source)
validateOptions
in class BaseOptionTemplateSection
source
- the template option to validate
Copyright (c) 2000, 2017 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.