Class ToggleAction

java.lang.Object
javax.swing.AbstractAction
org.jjazz.utilities.api.ToggleAction
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action

public abstract class ToggleAction extends AbstractAction
An Action which can be selected or not.

The Action.SELECTED_KEY property value represents the selected state.
The selected icon is stored in the Action.LARGE_ICON_KEY property.

See Also:
  • Constructor Details

    • ToggleAction

      public ToggleAction()
      Create a non selected action.
    • ToggleAction

      public ToggleAction(boolean selected)
      Create a selected or non-selected action.
      Parameters:
      selected -
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent ae)
      Default implementation just toggles the selected state.
      Parameters:
      ae -
    • setSelected

      public void setSelected(boolean b)
    • isSelected

      public boolean isSelected()
    • setSelectedIcon

      public void setSelectedIcon(Icon icon)
    • getSelectedIcon

      public Icon getSelectedIcon()