public static class Options.StringOption extends Options.Option<String,JTextField>
Options.addStringOption.Options.MultipleLineStringOptionXMLSerializable.OldVersionCompatible, XMLSerializable.VersionSupportTypeROOT_ELEMENT_NAME| Modifier | Constructor and Description |
|---|---|
protected |
Options.StringOption(org.jdom.Element e)
Constructor for XML Serialization.
|
protected |
Options.StringOption(String name,
String label,
String defaultValue) |
protected |
Options.StringOption(String name,
String label,
String defaultValue,
String watermarkText)
Construct a new String option
|
| Modifier and Type | Method and Description |
|---|---|
protected JTextField |
createComponent()
Create a graphical component representing this option.
|
int |
getNumberOfColumns()
Get the number of columns used for displaying the value of this option.
|
String |
getValueFromString(String value)
Convert a String into an instance of the object type used by this option.
|
String |
getWatermarkText()
Returns the string passed into
#StringOption(String, String, String, String) (this value may be null) |
void |
setNumberOfColumns(int numberOfColumns)
Sets the number of columns used for displaying the value of this option.
|
protected void |
setValueOnComponent(JTextField textField,
String value)
Set the value on this component.
|
org.jdom.Element |
toXML()
Convert object to a JDOM element.
|
addChangeListener, addChildOptionsDependent, addDependent, fromXML, generateValidValue, getComponent, getDefaultValue, getDescription, getDescriptionAndState, getDisplayedLabel, getExtraPersistentInformation, getLabel, getName, getParentOptions, getPossibleValues, getValue, getValueAsString, getValueAsString, getVerticalWeight, handleSetEnabled, hideWarningMessage, isAdvanced, isEnabled, isFillHorizontalSpace, isProOnly, isRestoreDefaultApplies, isRestorePreferenceApplies, isSpanningComponent, isVisible, moveToOptions, removeChangeListener, restoreDefault, setAdvanced, setAlwaysUsesDefaultPreferenceLocation, setDefaultValue, setDescription, setDisabledValue, setEnabled, setExtraPersistentInformation, setFillHorizontalSpace, setHidden, setLabelComponent, setPreferredHeight, setPreferredWidth, setProOnly, setRestoreDefaultApplies, setRestorePreferenceApplies, setShouldSaveValue, setSpanningComponent, setValue, setValue, setValueFromString, setVerticalWeight, setVisible, setWarningMessage, shouldSaveValue, toStringprotected Options.StringOption(org.jdom.Element e)
throws XMLSerializationException
XMLSerializableXMLSerializationExceptionprotected Options.StringOption(String name, String label, String defaultValue, String watermarkText)
name - the name to be used for referencing this option. For example from scripts or source code which wish to programmatically get or set the value of this option.
Names should be in standard Java variable name style eg. "myAwesomeOption".label - a label describing this option to be displayed to the user. eg. "My Awesome Option"defaultValue - the default value for this optionwatermarkText - Watermark to display when no string is entered and textfield doesn't have focus, or null for none.public org.jdom.Element toXML()
XMLSerializableXMLSerializable.fromXML(org.jdom.Element) can completely
restore the objects representation.
It is recommended that the returned element use XMLSerializable.ROOT_ELEMENT_NAME as its name,
in which case it must not define an attribute called "type". In this case,
fromXML, will be called with an element whose name may differ from the element
return from this function. This recommendation allows a more compact representation
of the XML can be stored.
This method generally should not be called directly. Instead, you should usually call
XMLSerializer.classToXML(String, XMLSerializable)
which calls this method internally.
PluginDocument implementations of this method may choose to throw an XMLSerializationException,
enclosed in a RuntimeException.toXML in interface XMLSerializabletoXML in class Options.Option<String,JTextField>public void setNumberOfColumns(int numberOfColumns)
numberOfColumns - the number of columns, or 0 to use the default number of columns.getNumberOfColumns()public int getNumberOfColumns()
setNumberOfColumns(int)protected JTextField createComponent()
Options.OptionOptions.Option.getValue().
The implementation is also responsible for making sure that the returned component
listens to any changes made to itself and
reflects those changes in the value of this option
using the Options.Option.setValue(Object) method.
This method will only be called once for each instance of an Option.
After it has been called, getComponent() will return a cached copy of it.createComponent in class Options.Option<String,JTextField>public String getValueFromString(String value)
Options.OptionOptions.Option.getValueAsString(Object) .getValueFromString in class Options.Option<String,JTextField>value - the string representation of the object valueprotected void setValueOnComponent(JTextField textField, String value)
Options.OptionsetValueOnComponent in class Options.Option<String,JTextField>textField - a component return from Options.Option.createComponent()value - the value to set.public String getWatermarkText()
#StringOption(String, String, String, String) (this value may be null)#StringOption(String, String, String, String) (this value may be null)