Package org.eclipse.pde.ui.templates
Class StringOption
- java.lang.Object
- 
- org.eclipse.pde.ui.templates.TemplateField
- 
- org.eclipse.pde.ui.templates.TemplateOption
- 
- org.eclipse.pde.ui.templates.StringOption
 
 
 
- 
 public class StringOption extends TemplateOption This template option can be used to collect string option from the user in the template section wizard page.- Since:
- 2.0
 
- 
- 
Constructor SummaryConstructors Constructor Description StringOption(BaseOptionTemplateSection section, String name, String label)The constructor.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateControl(Composite parent, int span)Creates the string option control.StringgetText()A utility version of the getValue() method that converts the current value into the String object.booleanisEmpty()A string option is empty if its text field contains no text.voidsetEnabled(boolean enabled)Implements the superclass method by passing the enabled state to the option's widget.voidsetReadOnly(boolean readOnly)Update the text widget style to be read only Added to default style (does not override)voidsetText(String newText)A utility version of the setValue method that accepts String objects.voidsetValue(Object value)Implements the superclass method by passing the string value of the new value to the widget- 
Methods inherited from class org.eclipse.pde.ui.templates.TemplateOptiongetMessageLabel, getName, getValue, isEnabled, isRequired, setName, setRequired
 - 
Methods inherited from class org.eclipse.pde.ui.templates.TemplateFieldcreateLabel, getLabel, getSection, setLabel
 
- 
 
- 
- 
- 
Constructor Detail- 
StringOptionpublic StringOption(BaseOptionTemplateSection section, String name, String label) The constructor.- Parameters:
- section- the parent section
- name- the unique option name
- label- the translatable label of the option
 
 
- 
 - 
Method Detail- 
setReadOnlypublic void setReadOnly(boolean readOnly) Update the text widget style to be read only Added to default style (does not override)- Parameters:
- readOnly-- trueto make this option read only,- falseotherwise
 
 - 
getTextpublic String getText() A utility version of the getValue() method that converts the current value into the String object.- Returns:
- the string version of the current value.
 
 - 
setTextpublic void setText(String newText) A utility version of the setValue method that accepts String objects.- Parameters:
- newText- the new text value of the option
- See Also:
- setValue(Object)
 
 - 
setValuepublic void setValue(Object value) Implements the superclass method by passing the string value of the new value to the widget- Overrides:
- setValuein class- TemplateOption
- Parameters:
- value- the new option value
 
 - 
createControlpublic void createControl(Composite parent, int span) Creates the string option control.- Specified by:
- createControlin class- TemplateField
- Parameters:
- parent- parent composite of the string option widget
- span- the number of columns that the widget should span
 
 - 
isEmptypublic boolean isEmpty() A string option is empty if its text field contains no text.- Overrides:
- isEmptyin class- TemplateOption
- Returns:
- true if there is no text in the text field.
 
 - 
setEnabledpublic void setEnabled(boolean enabled) Implements the superclass method by passing the enabled state to the option's widget.- Overrides:
- setEnabledin class- TemplateOption
- Parameters:
- enabled- the new enabled state
 
 
- 
 
-