|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.gridsystems.config.tools.console.Field com.gridsystems.config.tools.console.ValueField
public class ValueField
Text value edition field.
It can be optionally validated through a TextVerifier instance
Field Summary | |
---|---|
protected java.lang.String |
linePattern
Pattern to use for field display. |
protected boolean |
trimmed
If true text spaces will be trimmed. |
protected java.lang.Object |
value
The value. |
protected java.text.MessageFormat |
valueFormater
A cached instance of the value formatter. |
protected java.lang.String |
valuePattern
Pattern to use for value display and parsing. |
protected TextVerifier |
verifier
The text verifier. |
Fields inherited from class com.gridsystems.config.tools.console.Field |
---|
bundle |
Constructor Summary | |
---|---|
ValueField(java.util.ResourceBundle bundle,
java.lang.String linePattern,
java.lang.String valuePattern)
Creates a new instance. |
Method Summary | |
---|---|
boolean |
execute(ConsoleConfiguratorView view)
Asks the user for the new value for this field. |
java.lang.String[] |
getContents()
Gets the contents of this field. |
java.lang.String |
getKeyMapping()
Gets the key mapping of this action. |
protected java.lang.String |
getStringValue()
Gets the field value as a string. |
java.lang.Object |
getValue()
Gets this field value. |
TextVerifier |
getVerifier()
Gets the current verifier for this field. |
boolean |
isTrimmed()
Gets if the value should be trimmed. |
protected java.lang.String |
readLine()
Reads a line of text from the console. |
void |
setKeyMapping(java.lang.String mapping)
Sets the key-mapping to use for this field. |
protected void |
setStringValue(java.lang.String newValue)
Sets the field value from the specified string. |
void |
setTrimmed(boolean trimmed)
Sets if the value should be trimmed on storing it. |
void |
setValue(java.lang.Object value)
Sets the value of this field. |
void |
setVerifier(TextVerifier verifier)
Sets the verifier for this field. |
Methods inherited from class com.gridsystems.config.tools.console.Field |
---|
getString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String linePattern
protected java.lang.String valuePattern
protected java.lang.Object value
protected TextVerifier verifier
protected java.text.MessageFormat valueFormater
protected boolean trimmed
true
text spaces will be trimmed.
Constructor Detail |
---|
public ValueField(java.util.ResourceBundle bundle, java.lang.String linePattern, java.lang.String valuePattern)
bundle
- The resource bundlelinePattern
- The pattern for field displayvaluePattern
- The pattern for value display and parsingMethod Detail |
---|
public java.lang.String getKeyMapping()
getKeyMapping
in interface ConsoleViewAction
public void setKeyMapping(java.lang.String mapping)
mapping
- The key-mapping to setpublic java.lang.String[] getContents()
getContents
in class Field
public java.lang.Object getValue()
public void setValue(java.lang.Object value)
value
- The new valuepublic void setVerifier(TextVerifier verifier)
verifier
- The verifierpublic TextVerifier getVerifier()
public void setTrimmed(boolean trimmed)
trimmed
- true if the value should be trimmed, false otherwisepublic boolean isTrimmed()
protected java.lang.String getStringValue()
protected void setStringValue(java.lang.String newValue)
newValue
- The text containing the new valuepublic boolean execute(ConsoleConfiguratorView view)
To specify an empty value, in trimmed fields a blank space can be used
This method does not return until the default value or a valid one is specified.
execute
in interface ConsoleViewAction
view
- The view where this field is located
ConsoleViewAction
protected java.lang.String readLine() throws java.io.IOException
java.io.IOException
- If an error occurs while reading from the console
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |