public static class Field.TextCombo extends Field
The actual stored object type is an ArrayList of Strings. The current choice is the first one in the list, use getText() to obtain it.
ComboBox
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 ComboBox |
combo |
label, listenerList, name, popupMenu, previousValue, storeData, validValue
Constructor and Description |
---|
TextCombo(java.lang.String fldName,
java.lang.String label,
java.util.Collection defValues,
int n,
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 |
getDeepEditComponent() |
javax.swing.JComponent |
getEditComponent()
return the editing JComponent
|
protected java.lang.Object |
getEditValue()
Get current value from editComponent, will be an ArrayList
|
protected java.lang.Object |
getStoreValue(java.lang.Object defValue)
Get value from Store, will be an ArrayList or null
|
java.lang.String |
getText()
Return the current selected value as a String
|
boolean |
isEditable()
can user edit?
|
void |
setEditable(boolean isEditable)
Set whether the field is editable, default == enabled
|
protected void |
setEditValue(java.lang.Object value)
set value of editComponent, must be a List
|
protected void |
setStoreValue(java.lang.Object newValue)
Put new value into Store, must be a Collection of Strings
|
void |
setText(java.lang.String newValue)
Set current selected value of text; send event.
|
void |
setValue(java.lang.Object value)
Set edit value as an Object.
|
accept, acceptIfDifferent, addPopupMenuAction, addPropertyChangeListener, addStandardPopups, addValidator, dfrac, finish, getLabel, getName, getPersistenceManager, getToolTipText, getValue, isEnabled, next, removePropertyChangeListener, restoreValue, sendEvent, setEnabled, setNewValueFromStore, setToolTipText, validate
protected ComboBox combo
public TextCombo(java.lang.String fldName, java.lang.String label, java.util.Collection defValues, int n, PersistenceManager storeData)
fldName
- name of the field, must be unique within the store.label
- to display to the userdefValues
- list of default values to include in the comboBox. May be null.
These are added to the combobox (at the end) no matter how many there are.n
- number of most recently used values to keepstoreData
- store/fetch data from here, may be null.PrefPanel.addTextComboField(java.lang.String, java.lang.String, java.util.Collection, int, boolean)
protected boolean _validate(java.lang.StringBuffer buff)
public javax.swing.JComponent getEditComponent()
getEditComponent
in class Field
protected java.lang.Object getEditValue()
getEditValue
in class Field
public javax.swing.JComponent getDeepEditComponent()
getDeepEditComponent
in class Field
protected void setEditValue(java.lang.Object value)
setEditValue
in class Field
protected java.lang.Object getStoreValue(java.lang.Object defValue)
getStoreValue
in class Field
protected void setStoreValue(java.lang.Object newValue)
setStoreValue
in class Field
public java.lang.String getText()
public void setText(java.lang.String newValue)
public void setValue(java.lang.Object value)
public boolean isEditable()
isEditable
in class Field
public void setEditable(boolean isEditable)
Field
setEditable
in class Field