Class Button

    • Constructor Detail

      • Button

        public Button()
      • Button

        public Button​(java.lang.Object buttonData)
    • Method Detail

      • getButtonData

        public java.lang.Object getButtonData()
      • setButtonData

        public void setButtonData​(java.lang.Object buttonData)
      • getAction

        public Action getAction()
        Returns the action associated with this button.
        Returns:
        The button's action, or null if no action is defined.
      • setAction

        public void setAction​(Action action)
        Sets this button's action.
        Parameters:
        action - The action to be triggered when this button is pressed, or null for no action.
      • setAction

        public void setAction​(java.lang.String actionID)
        Sets this button's action.
        Parameters:
        actionID - The ID of the action to be triggered when this button is pressed.
        Throws:
        java.lang.IllegalArgumentException - If an action with the given ID does not exist.
      • setEnabled

        public void setEnabled​(boolean enabled)
        Description copied from class: Component
        Sets the component's enabled state. Enabled components respond to user input events; disabled components do not.
        Overrides:
        setEnabled in class Component
        Parameters:
        enabled - true if the component is enabled; false, otherwise.
      • press

        public void press()
        "Presses" the button. Performs any action associated with the button.
      • isSelected

        public boolean isSelected()
        Returns:
        The button's selected state.
      • setSelected

        public void setSelected​(boolean selected)
        Sets the button's selected state.
        Parameters:
        selected - The new "selected" value.
      • getState

        public Button.State getState()
        Returns:
        The button's selection state (for tri-state buttons).
      • setState

        public void setState​(Button.State state)
        Sets the button's tri-state selection state.
        Parameters:
        state - The new button selection state.
      • isToggleButton

        public boolean isToggleButton()
        Returns:
        The button's toggle state.
      • setToggleButton

        public void setToggleButton​(boolean toggleButton)
        Sets the button's toggle state.
        Parameters:
        toggleButton - Whether or not this should be a toggle button.
      • isTriState

        public boolean isTriState()
        Returns:
        The button's tri-state state.
      • setTriState

        public void setTriState​(boolean triState)
        Sets the button's tri-state state.
        Parameters:
        triState - Whether or not to make this a tri-state button.
      • isQueuedAction

        public boolean isQueuedAction()
        Returns:
        Whether or not actions are executed immediately or are queued for later on press().
      • setQueuedAction

        public void setQueuedAction​(boolean flag)
        Sets the "queued action" flag so that actions invoked on button press are queued to the ApplicationContext callback queue to be run "later" instead of being invoked now.
        Parameters:
        flag - The new value of the queued action flag for this button.
      • getQueuedActionDelay

        public int getQueuedActionDelay()
        Returns:
        The (millisecond) delay to use when queuing actions for later.
      • setQueuedActionDelay

        public void setQueuedActionDelay​(int delay)
        Set the delay to be used when setQueuedAction(boolean) is set to true.

        Typically this delay would be a bit longer than the popup window fade transition (for instance), or similar timing.

        Parameters:
        delay - The delay value (in milliseconds) to use when queuing the action, or 0 to use no delay.
      • getButtonGroup

        public ButtonGroup getButtonGroup()
        Returns the button's button group.
        Returns:
        The group to which the button belongs, or null if the button does not belong to a group.
      • setButtonGroup

        public void setButtonGroup​(ButtonGroup buttonGroup)
        Sets the button's button group.
        Parameters:
        buttonGroup - The group to which the button will belong, or null if the button will not belong to a group.
      • getButtonDataKey

        public java.lang.String getButtonDataKey()
        Returns:
        The binding key used for this button's data.
      • setButtonDataKey

        public void setButtonDataKey​(java.lang.String buttonDataKey)
        Set the binding key to use for this button's data.
        Parameters:
        buttonDataKey - The binding key for button data, which should be a field name or object "property" that supplies the button data.
      • getButtonDataBindType

        public BindType getButtonDataBindType()
        Returns:
        The type of binding used for button data (that is "load", "store" or "both").
      • setButtonDataBindType

        public void setButtonDataBindType​(BindType buttonDataBindType)
      • setButtonDataBindMapping

        public void setButtonDataBindMapping​(Button.ButtonDataBindMapping buttonDataBindMapping)
        Set the bind mapping used for this button's data. This is a method that is used make a translation between the type of object needed for this button's data and the actual data supplied by the bound object.
        Parameters:
        buttonDataBindMapping - The new mapping to use (can be null to disable bind mapping).
      • getSelectedKey

        public java.lang.String getSelectedKey()
      • setSelectedKey

        public void setSelectedKey​(java.lang.String selectedKey)
      • getSelectedBindType

        public BindType getSelectedBindType()
      • setSelectedBindType

        public void setSelectedBindType​(BindType selectedBindType)
      • getStateKey

        public java.lang.String getStateKey()
      • setStateKey

        public void setStateKey​(java.lang.String stateKey)
      • getStateBindType

        public BindType getStateBindType()
      • setStateBindType

        public void setStateBindType​(BindType stateBindType)
      • load

        public void load​(java.lang.Object context)
        Description copied from class: Component
        Copies bound values from the bind context to the component. This functionality must be provided by the subclass; the base implementation is a no-op.
        Overrides:
        load in class Component
        Parameters:
        context - The object to load the bound values from.
      • store

        public void store​(java.lang.Object context)
        Description copied from class: Component
        Copies bound values from the component to the bind context. This functionality must be provided by the subclass; the base implementation is a no-op.
        Overrides:
        store in class Component
        Parameters:
        context - The object to store the bound values into.
      • clear

        public void clear()
        Description copied from class: Component
        Clears any bound values in the component. This functionality must be provided by the subclass; the base implementation is a no-op.
        Overrides:
        clear in class Component