Class CToggleButton

    • Constructor Detail

      • CToggleButton

        public CToggleButton()
        Creates an initially unselected toggle button without setting the text or image.
      • CToggleButton

        public CToggleButton​(Icon icon)
        Creates an initially unselected toggle button with the specified image but no text.
        Parameters:
        icon - the image that the button should display
      • CToggleButton

        public CToggleButton​(Icon icon,
                             boolean selected)
        Creates a toggle button with the specified image and selection state, but no text.
        Parameters:
        icon - the image that the button should display
        selected - if true, the button is initially selected; otherwise, the button is initially unselected
      • CToggleButton

        public CToggleButton​(String text)
        Creates an unselected toggle button with the specified text.
        Parameters:
        text - the string displayed on the toggle button
      • CToggleButton

        public CToggleButton​(String text,
                             boolean selected)
        Creates a toggle button with the specified text and selection state.
        Parameters:
        text - the string displayed on the toggle button
        selected - if true, the button is initially selected; otherwise, the button is initially unselected
      • CToggleButton

        public CToggleButton​(Action a)
        Creates a toggle button where properties are taken from the Action supplied.
        Parameters:
        a -
      • CToggleButton

        public CToggleButton​(String text,
                             Icon icon)
        Creates a toggle button that has the specified text and image, and that is initially unselected.
        Parameters:
        text - the string displayed on the button
        icon - the image that the button should display
      • CToggleButton

        public CToggleButton​(String text,
                             Icon icon,
                             boolean selected)
        Creates a toggle button with the specified text, image, and selection state.
        Parameters:
        text - the text of the toggle button
        icon - the image that the button should display
        selected - if true, the button is initially selected; otherwise, the button is initially unselected
    • Method Detail

      • setBackground

        public void setBackground​(Color bg)
        Set Background - Differentiates between system & user call. If User Call, sets Opaque & ContextAreaFilled to true
        Overrides:
        setBackground in class JComponent
        Parameters:
        bg -
      • setBackground

        public void setBackground​(boolean error)
        Set Background - NOP
        Specified by:
        setBackground in interface CEditor
        Parameters:
        error -
      • setBackgroundColor

        public void setBackgroundColor()
        Set Standard Background
      • setBackgroundColor

        public void setBackgroundColor​(CompiereColor bg)
        Set Background
        Parameters:
        bg - AdempiereColor for Background, if null set standard background
      • getBackgroundColor

        public CompiereColor getBackgroundColor()
        Get Background
        Returns:
        Color for Background
      • 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
      • 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