de.qfs.lib.option
Class TextOption
java.lang.Object
|
+--java.util.Observable
|
+--de.qfs.lib.option.Option
|
+--de.qfs.lib.option.StringOption
|
+--de.qfs.lib.option.TextOption
- All Implemented Interfaces:
- java.lang.Cloneable, ConfigurableOption, java.io.Serializable
- Direct Known Subclasses:
- EditorOption
- public class TextOption
- extends StringOption
A TextOption is similar to a StringOption except that its edit Component
is a mulitline text area.
- Version:
- $Revision: 1.11 $
- Author:
- Gregor Schmid
- See Also:
- Serialized Form
Field Summary |
static java.lang.String |
LINESEP
Line separator (system specific). |
Constructor Summary |
TextOption()
Create a new TextOption. |
TextOption(java.lang.String name,
java.lang.String value)
Create a new TextOption with a name and a value. |
TextOption(java.lang.String name,
java.lang.String value,
boolean nullOK)
Create a new TextOption with a name and a value and the nullOK flag. |
Method Summary |
void |
fromArray(java.lang.String[] lines)
Create the value of the TextOption by joining Strings from an array with
the newline character. |
static java.lang.String |
join(java.lang.String[] values,
java.lang.String sep)
Join an arry of Strings into one String. |
static java.lang.String[] |
split(java.lang.String value,
java.lang.String sep,
boolean stripEmpty)
Split a String into an array of Strings. |
java.lang.String[] |
toArray(boolean stripEmpty)
Return the value of the TextOption as an array of Strings, each element
of the array representing one line of text. |
Methods inherited from class de.qfs.lib.option.Option |
addResources, addValidator, checkValue, clone, getName, getResources, getValue, hashCode, isNullOK, removeValidator, setName, setNullOK, setResources, setValue, toString |
Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
LINESEP
public static final java.lang.String LINESEP
- Line separator (system specific).
TextOption
public TextOption()
- Create a new TextOption.
TextOption
public TextOption(java.lang.String name,
java.lang.String value)
- Create a new TextOption with a name and a value.
- Parameters:
name
- The name to use.value
- The value to use.
TextOption
public TextOption(java.lang.String name,
java.lang.String value,
boolean nullOK)
- Create a new TextOption with a name and a value and the nullOK flag.
- Parameters:
name
- The name to use.value
- The value to use.nullOK
- The nullOK flag to use.
split
public static java.lang.String[] split(java.lang.String value,
java.lang.String sep,
boolean stripEmpty)
- Split a String into an array of Strings.
- Parameters:
value
- The String to split.sep
- The separator.stripEmpty
- If true, don't include empty lines.
join
public static java.lang.String join(java.lang.String[] values,
java.lang.String sep)
- Join an arry of Strings into one String.
- Parameters:
values
- The Strings to join.sep
- The separator.
toArray
public java.lang.String[] toArray(boolean stripEmpty)
- Return the value of the TextOption as an array of Strings, each element
of the array representing one line of text.
- Parameters:
stripEmpty
- If true, don't include empty lines.- Returns:
- The array of Strings.
- Since:
- 0.98.0
fromArray
public void fromArray(java.lang.String[] lines)
- Create the value of the TextOption by joining Strings from an array with
the newline character.
- Parameters:
lines
- The Strings to join.- Since:
- 0.98.0