Package ucar.ui.prefs
Class Field.EnumCombo
- java.lang.Object
-
- ucar.ui.prefs.Field
-
- ucar.ui.prefs.Field.EnumCombo
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ucar.ui.prefs.Field
Field.BeanTableField, Field.CheckBox, Field.Date, Field.Double, Field.EnumCombo, Field.Int, Field.Password, Field.Text, Field.TextArea, Field.TextCombo
-
-
Field Summary
Fields Modifier and Type Field Description protected ComboBox
combo
-
Fields inherited from class ucar.ui.prefs.Field
label, listenerList, name, popupMenu, previousValue, storeData, validValue
-
-
Constructor Summary
Constructors Constructor Description EnumCombo(String fldName, String label, Collection<Object> choices, PersistenceManager storeData)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
_validate(StringBuffer buff)
See if edit value is valid, put error message in buff.JComponent
getDeepEditComponent()
JComponent
getEditComponent()
return the editing JComponentprotected Object
getEditValue()
Get current value from editComponentprotected Object
getStoreValue(Object defValue)
Get value from Store, will be an item to be placed in the listboolean
isEditable()
can user edit?void
setEditable(boolean isEditable)
Set whether the field is editable, default == enabledprotected void
setEditValue(Object value)
set value of editComponentprotected void
setStoreValue(Object newValue)
Put new value into Store, will be an item from the list-
Methods inherited from class ucar.ui.prefs.Field
accept, acceptIfDifferent, addPopupMenuAction, addPropertyChangeListener, addStandardPopups, addValidator, dfrac, finish, getLabel, getName, getPersistenceManager, getToolTipText, getValue, isEnabled, next, removePropertyChangeListener, restoreValue, sendEvent, setEnabled, setNewValueFromStore, setToolTipText, setValue, validate
-
-
-
-
Field Detail
-
combo
protected ComboBox combo
-
-
Constructor Detail
-
EnumCombo
public EnumCombo(String fldName, String label, Collection<Object> choices, PersistenceManager storeData)
Constructor.- Parameters:
fldName
- name of the field, must be unique within the store.label
- to display to the userchoices
- list of enumerations.storeData
- store/fetch data from here, may be null.- See Also:
PrefPanel.addTextComboField(java.lang.String, java.lang.String, java.util.Collection, int, boolean)
-
-
Method Detail
-
_validate
protected boolean _validate(StringBuffer buff)
See if edit value is valid, put error message in buff.
-
getEditComponent
public JComponent getEditComponent()
return the editing JComponent- Specified by:
getEditComponent
in classField
-
getDeepEditComponent
public JComponent getDeepEditComponent()
- Overrides:
getDeepEditComponent
in classField
-
getEditValue
protected Object getEditValue()
Get current value from editComponent- Specified by:
getEditValue
in classField
-
setEditValue
protected void setEditValue(Object value)
set value of editComponent- Specified by:
setEditValue
in classField
-
getStoreValue
protected Object getStoreValue(Object defValue)
Get value from Store, will be an item to be placed in the list- Specified by:
getStoreValue
in classField
-
setStoreValue
protected void setStoreValue(Object newValue)
Put new value into Store, will be an item from the list- Specified by:
setStoreValue
in classField
-
isEditable
public boolean isEditable()
can user edit?- Overrides:
isEditable
in classField
-
setEditable
public void setEditable(boolean isEditable)
Description copied from class:Field
Set whether the field is editable, default == enabled- Overrides:
setEditable
in classField
-
-