@Deprecated public abstract class BooleanStateAction extends SystemAction implements Presenter.Menu, Presenter.Popup, Presenter.Toolbar
BooleanStateAction.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.
Presenter.Menu, Presenter.Popup, Presenter.Toolbar
Modifier and Type | Field and Description |
---|---|
static String |
PROP_BOOLEAN_STATE
Deprecated.
Name of property hold the state of the action.
|
PROP_ENABLED, PROP_ICON
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 and Description |
---|
BooleanStateAction()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent ev)
Deprecated.
Actually perform the action.
|
boolean |
getBooleanState()
Deprecated.
Get the current state.
|
JMenuItem |
getMenuPresenter()
Deprecated.
Get a menu item that can present this action in a
JMenu . |
JMenuItem |
getPopupPresenter()
Deprecated.
Get a menu item that can present this action in a
JPopupMenu . |
Component |
getToolbarPresenter()
Deprecated.
Get a component that can present this action in a
JToolBar . |
protected void |
initialize()
Deprecated.
Initialize the action.
|
void |
setBooleanState(boolean value)
Deprecated.
Set the current state.
|
clearSharedData, createPopupMenu, createToolbarPresenter, get, getHelpCtx, getIcon, getIcon, getName, getValue, iconResource, isEnabled, linkActions, putValue, setEnabled, setIcon
addNotify, addPropertyChangeListener, equals, finalize, findObject, findObject, firePropertyChange, getLock, getProperty, hashCode, putProperty, putProperty, readExternal, removeNotify, removePropertyChangeListener, reset, writeExternal, writeReplace
clone, getClass, notify, notifyAll, toString, wait, wait, wait
addPropertyChangeListener, removePropertyChangeListener
public static final String PROP_BOOLEAN_STATE
public JMenuItem getMenuPresenter()
Presenter.Menu
JMenu
.
If your menu content is dynamic in nature, consider using DynamicMenuContentgetMenuPresenter
in interface Presenter.Menu
public JMenuItem getPopupPresenter()
Presenter.Popup
JPopupMenu
.
If your menu content is dynamic in nature, consider using DynamicMenuContentgetPopupPresenter
in interface Presenter.Popup
public Component getToolbarPresenter()
Presenter.Toolbar
JToolBar
.getToolbarPresenter
in interface Presenter.Toolbar
public boolean getBooleanState()
true
if onpublic void setBooleanState(boolean value)
value
- true
to turn on, false
to turn offprotected void initialize()
SystemAction
initialize
in class SystemAction
public void actionPerformed(ActionEvent ev)
SystemAction
ActionListener.actionPerformed(java.awt.event.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.
actionPerformed
in interface ActionListener
actionPerformed
in class SystemAction
ev
- the event triggering the action