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 ComboBoxcombo-
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.JComponentgetDeepEditComponent()JComponentgetEditComponent()return the editing JComponentprotected ObjectgetEditValue()Get current value from editComponentprotected ObjectgetStoreValue(Object defValue)Get value from Store, will be an item to be placed in the listbooleanisEditable()can user edit?voidsetEditable(boolean isEditable)Set whether the field is editable, default == enabledprotected voidsetEditValue(Object value)set value of editComponentprotected voidsetStoreValue(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:
getEditComponentin classField
-
getDeepEditComponent
public JComponent getDeepEditComponent()
- Overrides:
getDeepEditComponentin classField
-
getEditValue
protected Object getEditValue()
Get current value from editComponent- Specified by:
getEditValuein classField
-
setEditValue
protected void setEditValue(Object value)
set value of editComponent- Specified by:
setEditValuein classField
-
getStoreValue
protected Object getStoreValue(Object defValue)
Get value from Store, will be an item to be placed in the list- Specified by:
getStoreValuein classField
-
setStoreValue
protected void setStoreValue(Object newValue)
Put new value into Store, will be an item from the list- Specified by:
setStoreValuein classField
-
isEditable
public boolean isEditable()
can user edit?- Overrides:
isEditablein classField
-
setEditable
public void setEditable(boolean isEditable)
Description copied from class:FieldSet whether the field is editable, default == enabled- Overrides:
setEditablein classField
-
-