Class BooleanStateAction

All Implemented Interfaces:
ActionListener, Externalizable, Serializable, EventListener, Action, Presenter, Presenter.Menu, Presenter.Popup, Presenter.Toolbar, HelpCtx.Provider

@Deprecated public abstract class BooleanStateAction extends SystemAction implements Presenter.Menu, Presenter.Popup, Presenter.Toolbar
Deprecated.
Use new support for stateful actions in Actions or ActionState annotation
An action that can be toggled on or off. The actual "performing" of the action is the toggle itself, so this action should be used by listening to the PROP_BOOLEAN_STATE property. The default value of the state is true (on).

This action is not the most effective way to implement checkbox in a menu. Consider using more modern alternative: Actions.checkbox, or declarative ActionState annotation.

See Also:
  • Field Details

    • PROP_BOOLEAN_STATE

      public static final String PROP_BOOLEAN_STATE
      Deprecated.
      Name of property hold the state of the action.
      See Also:
  • Constructor Details

    • BooleanStateAction

      public BooleanStateAction()
      Deprecated.
  • Method Details

    • getMenuPresenter

      public JMenuItem getMenuPresenter()
      Deprecated.
      Description copied from interface: Presenter.Menu
      Get a menu item that can present this action in a JMenu. If your menu content is dynamic in nature, consider using DynamicMenuContent
      Specified by:
      getMenuPresenter in interface Presenter.Menu
      Returns:
      the representation for this action
    • getPopupPresenter

      public JMenuItem getPopupPresenter()
      Deprecated.
      Description copied from interface: Presenter.Popup
      Get a menu item that can present this action in a JPopupMenu. If your menu content is dynamic in nature, consider using DynamicMenuContent
      Specified by:
      getPopupPresenter in interface Presenter.Popup
      Returns:
      the representation for this action
    • getToolbarPresenter

      public Component getToolbarPresenter()
      Deprecated.
      Description copied from interface: Presenter.Toolbar
      Get a component that can present this action in a JToolBar.
      Specified by:
      getToolbarPresenter in interface Presenter.Toolbar
      Returns:
      the representation for this action
    • getBooleanState

      public boolean getBooleanState()
      Deprecated.
      Get the current state.
      Returns:
      true if on
    • setBooleanState

      public void setBooleanState(boolean value)
      Deprecated.
      Set the current state. Fires a change event, which should be used to affect other components when its state is toggled.
      Parameters:
      value - true to turn on, false to turn off
    • initialize

      protected void initialize()
      Deprecated.
      Description copied from class: SystemAction
      Initialize the action. The default implementation just enabled it.
      Overrides:
      initialize in class SystemAction
    • actionPerformed

      public void actionPerformed(ActionEvent ev)
      Deprecated.
      Description copied from class: SystemAction
      Actually perform the action. Specified in ActionListener.actionPerformed(ActionEvent).

      In some cases, the implementation may have an empty body, if the presenters handle the performing of the action in a different way than by calling this method.

      Since 4.11, will be performed directly in the event thread.

      Specified by:
      actionPerformed in interface ActionListener
      Specified by:
      actionPerformed in class SystemAction
      Parameters:
      ev - the event triggering the action