Class CField

    • Constructor Detail

      • CField

        public CField()
      • CField

        public CField​(CFieldEditor editor,
                      Class<?> cFieldPopup,
                      String title)
        Construct Adempiere Field with external popup editor
        Parameters:
        editor - the (validating) editor
        cFieldPopup - the popup dialog
        title - title for popup
    • Method Detail

      • createNumeric

        public static CField createNumeric()
      • createDate

        public static CField createDate()
      • createText

        public static CField createText​(int length)
      • setIcon

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

        public Icon getIcon()
        Get Icon of arrow button to icon
        Returns:
        defaultIcon Icon to be displayed
      • setUI

        public void setUI​(TextUI ui)
        Set UI and re-set Icon for arrow button
        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
      • notifyUser

        public void notifyUser​(Exception e)
        Notify User of a Ptoblem with starting popup
        Parameters:
        e - Exception
      • 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