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
This template option can be used to collect string option from the user in
the template section wizard page.
- Since:
- 2.0
-
Constructor Summary
ConstructorsConstructorDescriptionStringOption(BaseOptionTemplateSection section, String name, String label) The constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateControl(Composite parent, int span) Creates the string option control.getText()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)voidA utility version of the setValue method that accepts String objects.voidImplements the superclass method by passing the string value of the new value to the widgetMethods inherited from class org.eclipse.pde.ui.templates.TemplateOption
getMessageLabel, getName, getValue, isEnabled, isRequired, setName, setRequiredMethods inherited from class org.eclipse.pde.ui.templates.TemplateField
createLabel, getLabel, getSection, setLabel
-
Constructor Details
-
StringOption
The constructor.- Parameters:
section- the parent sectionname- the unique option namelabel- the translatable label of the option
-
-
Method Details
-
setReadOnly
public 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
-
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.
-
setText
A utility version of the setValue method that accepts String objects.- Parameters:
newText- the new text value of the option- See Also:
-
setValue
Implements the superclass method by passing the string value of the new value to the widget- Overrides:
setValuein classTemplateOption- Parameters:
value- the new option value
-
createControl
Creates the string option control.- Specified by:
createControlin classTemplateField- Parameters:
parent- parent composite of the string option widgetspan- the number of columns that the widget should span
-
isEmpty
public boolean isEmpty()A string option is empty if its text field contains no text.- Overrides:
isEmptyin classTemplateOption- Returns:
- true if there is no text in the text field.
-
setEnabled
public void setEnabled(boolean enabled) Implements the superclass method by passing the enabled state to the option's widget.- Overrides:
setEnabledin classTemplateOption- Parameters:
enabled- the new enabled state
-