public class StringOption extends TemplateOption
Constructor and Description |
---|
StringOption(BaseOptionTemplateSection section,
String name,
String label)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
createControl(Composite parent,
int span)
Creates the string option control.
|
String |
getText()
A utility version of the getValue() method that converts
the current value into the String object.
|
boolean |
isEmpty()
A string option is empty if its text field contains no text.
|
void |
setEnabled(boolean enabled)
Implements the superclass method by passing the enabled state to the
option's widget.
|
void |
setReadOnly(boolean readOnly)
Update the text widget style to be read only
Added to default style (does not override)
|
void |
setText(String newText)
A utility version of the setValue method that accepts
String objects.
|
void |
setValue(Object value)
Implements the superclass method by passing the string value of the new
value to the widget
|
getMessageLabel, getName, getValue, isEnabled, isRequired, setName, setRequired
createLabel, getLabel, getSection, setLabel
public StringOption(BaseOptionTemplateSection section, String name, String label)
section
- the parent sectionname
- the unique option namelabel
- the translatable label of the optionpublic void setReadOnly(boolean readOnly)
readOnly
- public String getText()
public void setText(String newText)
newText
- the new text value of the optionsetValue(Object)
public void setValue(Object value)
setValue
in class TemplateOption
value
- the new option valuepublic void createControl(Composite parent, int span)
createControl
in class TemplateField
parent
- parent composite of the string option widgetspan
- the number of columns that the widget should spanpublic boolean isEmpty()
isEmpty
in class TemplateOption
public void setEnabled(boolean enabled)
setEnabled
in class TemplateOption
enabled
-
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.