Package org.eclipse.pde.ui.templates
Class TemplateOption
- java.lang.Object
- 
- org.eclipse.pde.ui.templates.TemplateField
- 
- org.eclipse.pde.ui.templates.TemplateOption
 
 
- 
- Direct Known Subclasses:
- AbstractChoiceOption,- BlankField,- BooleanOption,- ChoiceOption,- StringOption
 
 public abstract class TemplateOption extends TemplateField The base class of all the template options. Options have unique name and a value that can be changed. The value of the option is automatically available to the template files - can be accessed by substitution (e.g. $value_name$) or as part of conditional code generation (e.g. if value_name).- Since:
- 2.0
 
- 
- 
Constructor SummaryConstructors Constructor Description TemplateOption(BaseOptionTemplateSection section, String name, String label)Creates a new option for the provided template section.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetMessageLabel()Returns the label of this option that can be presented in the messages to the user.StringgetName()Returns the unique name of this optionObjectgetValue()Returns the value of this option.booleanisEmpty()Returns whether this option is currently empty.booleanisEnabled()Returns whether this option is enabled.booleanisRequired()Returns whether this option is required (cannot be empty)voidsetEnabled(boolean enabled)Sets the enabled state of this option.voidsetName(String name)Changes the unique name of this optionvoidsetRequired(boolean required)Marks this option as required.voidsetValue(Object value)Sets the new value of this option.- 
Methods inherited from class org.eclipse.pde.ui.templates.TemplateFieldcreateControl, createLabel, getLabel, getSection, setLabel
 
- 
 
- 
- 
- 
Constructor Detail- 
TemplateOptionpublic TemplateOption(BaseOptionTemplateSection section, String name, String label) Creates a new option for the provided template section.- Parameters:
- section- the parent template section
- name- the unique name of this option
- label- presentable label of this option
 
 
- 
 - 
Method Detail- 
getNamepublic String getName() Returns the unique name of this option- Returns:
- option name
 
 - 
setNamepublic void setName(String name) Changes the unique name of this option- Parameters:
- name- the new option name
 
 - 
getValuepublic Object getValue() Returns the value of this option.- Returns:
- the current value
 
 - 
isEmptypublic boolean isEmpty() Returns whether this option is currently empty. The actual semantics of the result depends on the implementing option.- Returns:
- true if option is empty, false otherwise.
 
 - 
setRequiredpublic void setRequired(boolean required) Marks this option as required. Required options must be set by the user. An option that is empty and is marked required will be flagged as an error in the wizard.- Parameters:
- required- the new value of the property
- See Also:
- isEmpty()
 
 - 
isRequiredpublic boolean isRequired() Returns whether this option is required (cannot be empty)- Returns:
- true if this option is required, false otherwise.
 
 - 
setValuepublic void setValue(Object value) Sets the new value of this option.- Parameters:
- value- the new value
 
 - 
isEnabledpublic boolean isEnabled() Returns whether this option is enabled. The actual presentation of enabled state depends on the implementing option.- Returns:
- true if option is enabled and can be modified.
 
 - 
setEnabledpublic void setEnabled(boolean enabled) Sets the enabled state of this option. The action presentation of the enabled state depends on the implementing option.- Parameters:
- enabled- the new enabled state
 
 - 
getMessageLabelpublic String getMessageLabel() Returns the label of this option that can be presented in the messages to the user. The default implementation trims the 'label' property from mnemonics and from the trailing column.- Returns:
- the label to show to the user
 
 
- 
 
-