Class CButton

    • Constructor Detail

      • CButton

        public CButton()
        Creates a button with no set text or icon.
      • CButton

        public CButton​(Icon icon)
        Creates a button with an icon.
        Parameters:
        icon - the Icon image to display on the button
      • CButton

        public CButton​(String text)
        Creates a button with text.
        Parameters:
        text - the text of the button
      • CButton

        public CButton​(Action a)
        Creates a button where properties are taken from the Action supplied.
        Parameters:
        a - the Action used to specify the new button
        Since:
        1.3
      • CButton

        public CButton​(String text,
                       Icon icon)
        Creates a button with initial text and an icon.
        Parameters:
        text - the text of the button
        icon - the Icon image to display on the button
    • 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 - background color
      • setBackground

        public void setBackground​(boolean error)
        Set Background - NOP
        Specified by:
        setBackground in interface CEditor
        Parameters:
        error - 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
      • setText

        public void setText​(String text)
        Set Text & Mnemonic
        Overrides:
        setText in class AbstractButton
        Parameters:
        text - text
      • setToolTipText

        public void setToolTipText​(String text)
        Set Tool Tip Text & Mnemonic
        Overrides:
        setToolTipText in class JComponent
        Parameters:
        text - text
      • setActionCommand

        public void setActionCommand​(String actionCommand)
        Set Action Command
        Overrides:
        setActionCommand in class AbstractButton
        Parameters:
        actionCommand - command
      • setMnemonic

        public void setMnemonic​(int mnemonic)
        Overrides the JButton.setMnemonic() method, setting modifier keys to CTRL+ALT.
        Overrides:
        setMnemonic in class AbstractButton
        Parameters:
        mnemonic - The mnemonic character code.