Class CommandToggleButtonGroup

    • Constructor Detail

      • CommandToggleButtonGroup

        public CommandToggleButtonGroup()
        Creates a new button group.
    • Method Detail

      • setAllowsClearingSelection

        public void setAllowsClearingSelection​(boolean allowsClearingSelection)
        Sets the new value for clearing selection. If true is passed, the selection can be cleared in clearSelection() or setSelected(JCommandToggleButton, boolean) (passing the currently selected button and false).
        Parameters:
        allowsClearingSelection - The new value for clearing selection.
      • isAllowsClearingSelection

        public boolean isAllowsClearingSelection()
        Returns the current value for clearing selection. true is returned when selection can be cleared in clearSelection() or setSelected(JCommandToggleButton, boolean) (passing the currently selected button and false).
        Returns:
        The current value for clearing selection.
      • add

        public void add​(JCommandToggleButton b)
        Adds the specified button to the group. If the button is selected, and the group has a selected button, the newly added button is marked as unselected.
        Parameters:
        b - The button to be added.
      • remove

        public void remove​(JCommandToggleButton b)
        Removes the specified button from the group.
        Parameters:
        b - The button to be removed
      • setSelected

        public void setSelected​(JCommandToggleButton button,
                                boolean isSelected)
        Changes the selected status of the specified button.
        Parameters:
        button - Button.
        isSelected - Selection indication.
      • getSelected

        public JCommandToggleButton getSelected()
        Returns the selected button of this group.
        Returns:
        The selected button of this group. The result can be null.
      • clearSelection

        public void clearSelection()
        Clears the selection of this button group.
      • addPropertyChangeListener

        public void addPropertyChangeListener​(PropertyChangeListener listener)
        Adds the specified property change listener on this button group.
        Parameters:
        listener - Listener to add.
      • removePropertyChangeListener

        public void removePropertyChangeListener​(PropertyChangeListener listener)
        Removes the specified property change listener from this button group.
        Parameters:
        listener - Listener to remove.
      • firePropertyChange

        protected void firePropertyChange​(String propertyName,
                                          Object oldValue,
                                          Object newValue)
        Fires a property change event on all registered listeners.
        Parameters:
        propertyName - Name of the changed property.
        oldValue - Old property value.
        newValue - New property value.