be.ugent.caagt.swirl.actions
Class SimpleAction
AbstractAction
be.ugent.caagt.swirl.actions.SimpleAction
public abstract class SimpleAction
extends AbstractAction
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.
static String | MEDIUM_DISABLED_ICON - The action key used for storing a medium size 'disabled'
Icon for use with tool bar buttons.
|
static String | MEDIUM_ICON - The action key used for storing a medium size
Icon
for use with tool bar buttons.
|
static String | SMALL_DISABLED_ICON - The action key used for storing a small 'disabled'
Icon for use in menus.
|
static String | TOGGLE_BUTTON_MODEL - The action key used for storing a shared toggle button model.
|
SimpleAction() - Make a simple action which is not really different from an
AbstractAction .
|
SimpleAction(ResourceBundle bundle, String key, Icon icon) - Construct an action with an internationalized description
string and given icon.
|
SimpleAction(ResourceBundle bundle, String key, Icon icon, Icon mediumIcon, Icon mediumDisabledIcon) - Construct an action with an internationalized description
string and given icons.
|
MEDIUM_DISABLED_ICON
public static final String MEDIUM_DISABLED_ICON
The action key used for storing a medium size 'disabled'
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.
MEDIUM_ICON
public static final String MEDIUM_ICON
The action key used for storing a medium size
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.
SMALL_DISABLED_ICON
public static final String SMALL_DISABLED_ICON
The action key used for storing a small 'disabled'
Icon
for use in menus.
Note: Swing menu items do not honour this key, use
one of the
Menu...Button
classes instead.
TOGGLE_BUTTON_MODEL
public static final String TOGGLE_BUTTON_MODEL
The action key used for storing a shared toggle button model. This allows
selection state to be synchronised between different toggle buttons and
radio or checkbox menu items.
Note: Swing buttons do not honour this key, use
one of the
ToolBar...Button
or
Menu...Button
classes instead.
javax.swing.JToggleButton.ToggleButtonModel
SimpleAction
protected SimpleAction()
Make a simple action which is not really different from an
AbstractAction
.
Clients should consider using
AbstractAction
directly or else
use one of the other constructors of this class.
SimpleAction
protected SimpleAction(ResourceBundle bundle,
String key,
Icon icon)
Construct an action with an internationalized description
string and given 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).
SimpleAction
protected SimpleAction(ResourceBundle bundle,
String key,
Icon icon,
Icon mediumIcon,
Icon mediumDisabledIcon)
Construct an action with an internationalized description
string and given icons.
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)
actionPerformed
public abstract void actionPerformed(ActionEvent e)
setMediumDisabledIcon
public void setMediumDisabledIcon(Icon mediumDisabledIcon)
Set the medium size 'disabled' icon for this action. This icon will be used
for all tool bar buttons
of type
ToolBarToggleButton
or
ToolBarButton
which are
created with this action.
setMediumIcon
public void setMediumIcon(Icon mediumIcon)
Set the medium size icon for this action. This icon will be used
for all tool bar buttons
of type
ToolBarToggleButton
or
ToolBarButton
which are
created with this action.
setSharedToggleButtonModel
public void setSharedToggleButtonModel(ButtonModel buttonModel)
Set the shared button model for toggle buttons created with this
action.
Note: Swing buttons do not honour this property, use
one of the
ToolBar...Button
or
Menu...Button
classes instead.
javax.swing.JToggleButton.ToggleButtonModel
setSmallDisabledIcon
public void setSmallDisabledIcon(Icon smallDisabledIcon)
Set the small 'disabled' icon for this action. This icon will be used
for all menu items
of type Menu...Button
which are
created with this action.