Class CComboBoxEditable<E>

    • Field Detail

      • FIELD_HIGHT

        public static int FIELD_HIGHT
        Field Height
    • Constructor Detail

      • CComboBoxEditable

        public CComboBoxEditable​(ComboBoxModel<E> aModel)
        Creates a JComboBox that takes it's items from an existing ComboBoxModel. Since the ComboBoxModel is provided, a combo box created using this constructor does not create a default combo box model and may impact how the insert, remove and add methods behave.
        Parameters:
        aModel - the ComboBoxModel that provides the displayed list of items
        See Also:
        DefaultComboBoxModel
      • CComboBoxEditable

        public CComboBoxEditable​(E[] items)
        Creates a JComboBox that contains the elements in the specified array. By default the first item in the array (and therefore the data model) becomes selected.
        Parameters:
        items - an array of objects to insert into the combo box
        See Also:
        DefaultComboBoxModel
      • CComboBoxEditable

        public CComboBoxEditable​(E[] items,
                                 String key)
        Creates a JComboBox that contains the elements in the specified array. By default the first item in the array (and therefore the data model) becomes selected.
        Parameters:
        items - an array of objects to insert into the combo box
        key - set selected if exists
        See Also:
        DefaultComboBoxModel
      • CComboBoxEditable

        public CComboBoxEditable​(Vector<E> items)
        Creates a JComboBox that contains the elements in the specified Vector. By default the first item in the vector and therefore the data model) becomes selected.
        Parameters:
        items - an array of vectors to insert into the combo box
        See Also:
        DefaultComboBoxModel
      • CComboBoxEditable

        public CComboBoxEditable()
        Creates a JComboBox with a default data model. The default data model is an empty list of objects. Use addItem to add items. By default the first item in the data model becomes selected.
        See Also:
        DefaultComboBoxModel
    • Method Detail

      • setIcon

        public void setIcon​(Icon defaultIcon)
        Set Icon of arrow button to icon
        Parameters:
        defaultIcon - Icon to be displayed
      • setUI

        public void setUI​(ComboBoxUI ui)
        Set UI and re-set Icon for arrow button
        Overrides:
        setUI in class JComboBox<E>
        Parameters:
        ui -
      • displayPopup

        public boolean displayPopup()
        Display Popup. Called from AdempiereComboPopup and allows to implement alternative actions than showing the popup
        Returns:
        if true, the popup should be displayed
      • setMandatory

        public void setMandatory​(boolean mandatory)
        Set Editor Mandatory
        Specified by:
        setMandatory in interface CEditor
        Parameters:
        mandatory - true, if you have to enter data
      • isMandatory

        public boolean isMandatory()
        Is Field mandatory
        Specified by:
        isMandatory in interface CEditor
        Returns:
        true, if mandatory
      • setReadWrite

        public void setReadWrite​(boolean rw)
        Enable Editor
        Specified by:
        setReadWrite in interface CEditor
        Parameters:
        rw - true, if you can enter/select data
      • isReadWrite

        public boolean isReadWrite()
        Is it possible to edit
        Specified by:
        isReadWrite in interface CEditor
        Returns:
        true, if editable
      • setBackground

        public void setBackground​(boolean error)
        Set Background based on editable / mandatory / error
        Specified by:
        setBackground in interface CEditor
        Parameters:
        error - if true, set background to error color, otherwise mandatory/editable
      • setValue

        public void setValue​(Object value)
        Set Editor to value
        Specified by:
        setValue in interface CEditor
        Parameters:
        value - value of the editor
      • getValue

        public Object getValue()
        Return Editor value
        Specified by:
        getValue in interface CEditor
        Returns:
        current value
      • getDisplay

        public String getDisplay()
        Return Display Value
        Specified by:
        getDisplay in interface CEditor
        Returns:
        displayed String value
      • setActionCommand

        public void setActionCommand​(String actionCommand)
        Set Action Command
        Overrides:
        setActionCommand in class JComboBox<E>
        Parameters:
        actionCommand - command