public static class Field.Text extends Field
Field.BeanTableField, Field.CheckBox, Field.Date, Field.Double, Field.EnumCombo, Field.Int, Field.Password, Field.Text, Field.TextArea, Field.TextCombo
Modifier and Type | Field and Description |
---|---|
protected javax.swing.text.JTextComponent |
tf |
label, listenerList, name, popupMenu, previousValue, storeData, validValue
Modifier | Constructor and Description |
---|---|
protected |
Text(java.lang.String name,
java.lang.String label,
PersistenceManager storeData)
Constructor for subclasses.
|
|
Text(java.lang.String name,
java.lang.String label,
java.lang.String defValue,
PersistenceManager storeData)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
_validate(java.lang.StringBuffer buff)
See if edit value is valid, put error message in buff.
|
javax.swing.JComponent |
getEditComponent()
Return the editing JComponent
|
protected java.lang.Object |
getEditValue()
Get current value from editComponent
|
protected java.lang.Object |
getStoreValue(java.lang.Object defValue)
Get value from Store, if it exists, else return default value.
|
java.lang.String |
getText()
Return the current accepted value
|
boolean |
isEditable()
Can the user edit this field.
|
protected java.lang.String |
normalize(java.lang.String s) |
void |
setEditable(boolean isEditable)
Set whether the field is editable, default == enabled
|
protected void |
setEditValue(java.lang.Object value)
Set current value of editComponent
|
protected void |
setStoreValue(java.lang.Object value)
Put new value into Store.
|
void |
setText(java.lang.String newValue)
Set value of text; if different from current value, store in PersistenceManager and
send event.
|
accept, acceptIfDifferent, addPopupMenuAction, addPropertyChangeListener, addStandardPopups, addValidator, dfrac, finish, getDeepEditComponent, getLabel, getName, getPersistenceManager, getToolTipText, getValue, isEnabled, next, removePropertyChangeListener, restoreValue, sendEvent, setEnabled, setNewValueFromStore, setToolTipText, setValue, validate
protected Text(java.lang.String name, java.lang.String label, PersistenceManager storeData)
name
- of the field; must be unique within the storelabel
- to display to the userstoreData
- store/fetch data from here, may be null.public Text(java.lang.String name, java.lang.String label, java.lang.String defValue, PersistenceManager storeData)
name
- of the field; must be unique within the storelabel
- to display to the userdefValue
- defau;lt value to start with.storeData
- store/fetch data from here, may be null.PrefPanel.addTextField(java.lang.String, java.lang.String, java.lang.String)
public javax.swing.JComponent getEditComponent()
Field
getEditComponent
in class Field
public boolean isEditable()
isEditable
in class Field
public void setEditable(boolean isEditable)
Field
setEditable
in class Field
protected boolean _validate(java.lang.StringBuffer buff)
protected java.lang.Object getEditValue()
Field
getEditValue
in class Field
protected void setEditValue(java.lang.Object value)
Field
setEditValue
in class Field
protected void setStoreValue(java.lang.Object value)
Field
setStoreValue
in class Field
protected java.lang.Object getStoreValue(java.lang.Object defValue)
getStoreValue
in class Field
defValue
- default valuepublic java.lang.String getText()
public void setText(java.lang.String newValue)
protected java.lang.String normalize(java.lang.String s)