Package ucar.ui.prefs

Class Field.TextCombo

  • Enclosing class:
    Field

    public static class Field.TextCombo
    extends Field
    A text input field which keeps track of recent choices in a combobox. The order they appear in the combobox choices reflects how recently they were chosen. NOTE: to use this, you must use a PreferencesExt.

    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.

    See Also:
    ComboBox
    • Method Detail

      • _validate

        protected boolean _validate​(StringBuffer buff)
        See if edit value is valid, put error message in buff.
        Specified by:
        _validate in class Field
      • getEditValue

        protected Object getEditValue()
        Get current value from editComponent, will be an ArrayList
        Specified by:
        getEditValue in class Field
      • setEditValue

        protected void setEditValue​(Object value)
        set value of editComponent, must be a List
        Specified by:
        setEditValue in class Field
      • getStoreValue

        protected Object getStoreValue​(Object defValue)
        Get value from Store, will be an ArrayList or null
        Specified by:
        getStoreValue in class Field
      • setStoreValue

        protected void setStoreValue​(Object newValue)
        Put new value into Store, must be a Collection of Strings
        Specified by:
        setStoreValue in class Field
      • getText

        public String getText()
        Return the current selected value as a String
      • setText

        public void setText​(String newValue)
        Set current selected value of text; send event.
      • setValue

        public void setValue​(Object value)
        Set edit value as an Object.
        Overrides:
        setValue in class Field
      • isEditable

        public boolean isEditable()
        can user edit?
        Overrides:
        isEditable in class Field
      • setEditable

        public void setEditable​(boolean isEditable)
        Description copied from class: Field
        Set whether the field is editable, default == enabled
        Overrides:
        setEditable in class Field