Class JideToggleSplitButton

All Implemented Interfaces:
Alignable, ButtonStyle, ComponentStateSupport, ItemListener, ImageObserver, ItemSelectable, MenuContainer, Serializable, EventListener, Accessible, MenuElement, SwingConstants

public class JideToggleSplitButton extends JideSplitButton implements Accessible, ItemListener
An implementation of a two-state JideButton.

Warning: SplitButtonGroup has to be used in place of ButtonGroup for JideToggleSplitButtons.

See Also:
  • Constructor Details

    • JideToggleSplitButton

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

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

      public JideToggleSplitButton(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
    • JideToggleSplitButton

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

      public JideToggleSplitButton(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
    • JideToggleSplitButton

      public JideToggleSplitButton(Action a)
      Creates a toggle button where properties are taken from the Action supplied.
      Since:
      1.3
    • JideToggleSplitButton

      public JideToggleSplitButton(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
    • JideToggleSplitButton

      public JideToggleSplitButton(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 Details

    • configurePropertiesFromAction

      protected void configurePropertiesFromAction(Action action)
      Overrides:
      configurePropertiesFromAction in class JideSplitButton
    • actionPropertyChanged

      protected void actionPropertyChanged(Action action, String propertyName)
      Overrides:
      actionPropertyChanged in class JideSplitButton
    • shouldUpdateSelectedStateFromAction

      protected boolean shouldUpdateSelectedStateFromAction()
      Button subclasses that support mirroring the selected state from the action should override this to return true. AbstractButton's implementation returns false.
    • itemStateChanged

      public void itemStateChanged(ItemEvent e)
      Specified by:
      itemStateChanged in interface ItemListener
    • getAccessibleContext

      public AccessibleContext getAccessibleContext()
      Gets the AccessibleContext associated with this JToggleButton. For toggle buttons, the AccessibleContext takes the form of an AccessibleJToggleButton. A new AccessibleJToggleButton instance is created if necessary.
      Specified by:
      getAccessibleContext in interface Accessible
      Overrides:
      getAccessibleContext in class JMenu
      Returns:
      an AccessibleJToggleButton that serves as the AccessibleContext of this JToggleButton