|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.AbstractAction be.ugent.caagt.swirl.actions.SimpleAction
public abstract class SimpleAction
Abstract action (controller) based on an internationalized description.
As with AbstractAction
you need only define the
actionPerformed
method when you extend this class.
Also defines several new action properties which allow a more detailed configuration of buttons and menu items created from this action to be configured.
Description
,
ToolBarButton
,
ToolBarToggleButton
,
MenuButton
,
MenuRadioButton
,
MenuCheckBoxButton
,
Serialized FormField Summary | |
---|---|
static java.lang.String |
MEDIUM_DISABLED_ICON
The action key used for storing a medium size 'disabled' Icon for use with tool bar buttons. |
static java.lang.String |
MEDIUM_ICON
The action key used for storing a medium size Icon
for use with tool bar buttons. |
static java.lang.String |
SMALL_DISABLED_ICON
The action key used for storing a small 'disabled' Icon for use in menus. |
static java.lang.String |
TOGGLE_BUTTON_MODEL
The action key used for storing a shared toggle button model. |
Fields inherited from class javax.swing.AbstractAction |
---|
changeSupport, enabled |
Fields inherited from interface javax.swing.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 | |
---|---|
protected |
SimpleAction()
Make a simple action which is not really different from an AbstractAction . |
protected |
SimpleAction(java.util.ResourceBundle bundle,
java.lang.String key,
javax.swing.Icon icon)
Construct an action with an internationalized description string and given icon. |
protected |
SimpleAction(java.util.ResourceBundle bundle,
java.lang.String key,
javax.swing.Icon icon,
javax.swing.Icon mediumIcon,
javax.swing.Icon mediumDisabledIcon)
Construct an action with an internationalized description string and given icons. |
Method Summary | |
---|---|
abstract void |
actionPerformed(java.awt.event.ActionEvent e)
|
void |
setMediumDisabledIcon(javax.swing.Icon mediumDisabledIcon)
Set the medium size 'disabled' icon for this action. |
void |
setMediumIcon(javax.swing.Icon mediumIcon)
Set the medium size icon for this action. |
void |
setSharedToggleButtonModel(javax.swing.ButtonModel buttonModel)
Set the shared button model for toggle buttons created with this action. |
void |
setSmallDisabledIcon(javax.swing.Icon smallDisabledIcon)
Set the small 'disabled' icon for this action. |
Methods inherited from class javax.swing.AbstractAction |
---|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String MEDIUM_ICON
Icon
for use with tool bar buttons. Icons registered
with this key will be used for tool bar buttons
of type ToolBarToggleButton
or ToolBarButton
, but not
for standard Swing buttons.
public static final java.lang.String MEDIUM_DISABLED_ICON
Icon
for use with tool bar buttons. Icons registered
with this key will be used for tool bar buttons
of type ToolBarToggleButton
or ToolBarButton
, but not
for standard Swing buttons.
public static final java.lang.String SMALL_DISABLED_ICON
Icon
for use in menus.
Note: Swing menu items do not honour this key, use
one of the Menu...Button
classes instead.
public static final java.lang.String TOGGLE_BUTTON_MODEL
Note: Swing buttons do not honour this key, use
one of the ToolBar...Button
or Menu...Button
classes instead.
JToggleButton.ToggleButtonModel
,
Constant Field ValuesConstructor Detail |
---|
protected SimpleAction(java.util.ResourceBundle bundle, java.lang.String key, javax.swing.Icon icon, javax.swing.Icon mediumIcon, javax.swing.Icon mediumDisabledIcon)
bundle
- Resource bundle which contains the description for
this action.key
- Key used for the description of this action in the bundle.icon
- Small icon to be used for menu and standard button decoration (or null)mediumIcon
- Medium size icon to be used for tool bar buttons (or null)mediumDisabledIcon
- Medium size icon to be used for a disabled tool bar buttons (or null)protected SimpleAction(java.util.ResourceBundle bundle, java.lang.String key, javax.swing.Icon icon)
bundle
- Resource bundle which contains the description for
this action.key
- Key used for the description of this action in the bundle.icon
- Small icon to be used for menu and standard button decoration (or null).protected SimpleAction()
AbstractAction
.
Clients should consider using AbstractAction
directly or else
use one of the other constructors of this class.
Method Detail |
---|
public abstract void actionPerformed(java.awt.event.ActionEvent e)
public void setMediumIcon(javax.swing.Icon mediumIcon)
ToolBarToggleButton
or ToolBarButton
which are
created with this action.
public void setMediumDisabledIcon(javax.swing.Icon mediumDisabledIcon)
ToolBarToggleButton
or ToolBarButton
which are
created with this action.
public void setSmallDisabledIcon(javax.swing.Icon smallDisabledIcon)
Menu...Button
which are
created with this action.
public void setSharedToggleButtonModel(javax.swing.ButtonModel buttonModel)
Note: Swing buttons do not honour this property, use
one of the ToolBar...Button
or Menu...Button
classes instead.
JToggleButton.ToggleButtonModel
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |