public abstract class BooleanStateAction extends SystemAction implements Presenter.Menu, Presenter.Popup, Presenter.Toolbar
PROP_BOOLEAN_STATE property.
The default value of the state is true (on).
Presenter.Menu, Presenter.Popup, Presenter.Toolbar| Modifier and Type | Field and Description |
|---|---|
static String |
PROP_BOOLEAN_STATE
Name of property hold the state of the action.
|
PROP_ENABLED, PROP_ICONACCELERATOR_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() |
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(ActionEvent ev)
Actually perform the action.
|
boolean |
getBooleanState()
Get the current state.
|
JMenuItem |
getMenuPresenter()
Get a menu item that can present this action in a
JMenu. |
JMenuItem |
getPopupPresenter()
Get a menu item that can present this action in a
JPopupMenu. |
Component |
getToolbarPresenter()
Get a component that can present this action in a
JToolBar. |
protected void |
initialize()
Initialize the action.
|
void |
setBooleanState(boolean value)
Set the current state.
|
clearSharedData, createPopupMenu, createToolbarPresenter, get, getHelpCtx, getIcon, getIcon, getName, getValue, iconResource, isEnabled, linkActions, putValue, setEnabled, setIconaddNotify, addPropertyChangeListener, equals, finalize, findObject, findObject, firePropertyChange, getLock, getProperty, hashCode, putProperty, putProperty, readExternal, removeNotify, removePropertyChangeListener, reset, writeExternal, writeReplaceclone, getClass, notify, notifyAll, toString, wait, wait, waitaddPropertyChangeListener, removePropertyChangeListenerpublic static final String PROP_BOOLEAN_STATE
public JMenuItem getMenuPresenter()
Presenter.MenuJMenu.
If your menu content is dynamic in nature, consider using DynamicMenuContentgetMenuPresenter in interface Presenter.Menupublic JMenuItem getPopupPresenter()
Presenter.PopupJPopupMenu.
If your menu content is dynamic in nature, consider using DynamicMenuContentgetPopupPresenter in interface Presenter.Popuppublic Component getToolbarPresenter()
Presenter.ToolbarJToolBar.getToolbarPresenter in interface Presenter.Toolbarpublic boolean getBooleanState()
true if onpublic void setBooleanState(boolean value)
value - true to turn on, false to turn offprotected void initialize()
SystemActioninitialize in class SystemActionpublic void actionPerformed(ActionEvent ev)
SystemActionActionListener.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 ActionListeneractionPerformed in class SystemActionev - the event triggering the actionBuilt on August 24 2014. | Portions Copyright 1997-2014 Sun Microsystems, Inc. All rights reserved.