Class BooleanStateAction
java.lang.Object
org.openide.util.SharedClassObject
org.openide.util.actions.SystemAction
org.openide.util.actions.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:
-
Nested Class Summary
Nested classes/interfaces inherited from interface Presenter
Presenter.Menu, Presenter.Popup, Presenter.Toolbar -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated.Name of property hold the state of the action.Fields inherited from class SystemAction
PROP_ENABLED, PROP_ICONFields inherited from interface Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated.Actually perform the action.booleanDeprecated.Get the current state.Deprecated.Get a menu item that can present this action in aJMenu.Deprecated.Get a menu item that can present this action in aJPopupMenu.Deprecated.Get a component that can present this action in aJToolBar.protected voidDeprecated.Initialize the action.voidsetBooleanState(boolean value) Deprecated.Set the current state.Methods inherited from class SystemAction
clearSharedData, createPopupMenu, createToolbarPresenter, get, getHelpCtx, getIcon, getIcon, getName, getValue, iconResource, isEnabled, linkActions, putValue, setEnabled, setIconMethods inherited from class SharedClassObject
addNotify, addPropertyChangeListener, equals, finalize, findObject, findObject, firePropertyChange, getLock, getProperty, hashCode, putProperty, putProperty, readExternal, removeNotify, removePropertyChangeListener, reset, writeExternal, writeReplaceMethods inherited from interface Action
accept, addPropertyChangeListener, removePropertyChangeListener
-
Field Details
-
PROP_BOOLEAN_STATE
Deprecated.Name of property hold the state of the action.- See Also:
-
-
Constructor Details
-
BooleanStateAction
public BooleanStateAction()Deprecated.
-
-
Method Details
-
getMenuPresenter
Deprecated.Description copied from interface:Presenter.MenuGet a menu item that can present this action in aJMenu. If your menu content is dynamic in nature, consider using DynamicMenuContent- Specified by:
getMenuPresenterin interfacePresenter.Menu- Returns:
- the representation for this action
-
getPopupPresenter
Deprecated.Description copied from interface:Presenter.PopupGet a menu item that can present this action in aJPopupMenu. If your menu content is dynamic in nature, consider using DynamicMenuContent- Specified by:
getPopupPresenterin interfacePresenter.Popup- Returns:
- the representation for this action
-
getToolbarPresenter
Deprecated.Description copied from interface:Presenter.ToolbarGet a component that can present this action in aJToolBar.- Specified by:
getToolbarPresenterin interfacePresenter.Toolbar- Returns:
- the representation for this action
-
getBooleanState
public boolean getBooleanState()Deprecated.Get the current state.- Returns:
trueif 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-trueto turn on,falseto turn off
-
initialize
protected void initialize()Deprecated.Description copied from class:SystemActionInitialize the action. The default implementation just enabled it.- Overrides:
initializein classSystemAction
-
actionPerformed
Deprecated.Description copied from class:SystemActionActually perform the action. Specified inActionListener.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:
actionPerformedin interfaceActionListener- Specified by:
actionPerformedin classSystemAction- Parameters:
ev- the event triggering the action
-