org.jfree.ui.action
Class ActionMenuItem
JMenuItem
org.jfree.ui.action.ActionMenuItem
The ActionMenuItem is used to connect an Action and its properties to an
MenuItem.
This functionality is already implemented in JDK 1.3 but needed for JDK 1.2.2
compatibility.
ActionMenuItem() - Default constructor.
|
ActionMenuItem(Action action) - Creates a new menu item based on the specified action.
|
ActionMenuItem(Icon icon) - Creates a menu item with the specified icon.
|
ActionMenuItem(String text) - Creates a menu item with the specified label.
|
ActionMenuItem(String text, Icon icon) - Creates a menu item with the specified label and icon.
|
ActionMenuItem(String text, int i) - Creates a new menu item with the specified label and mnemonic.
|
Action | getAction() - Returns the assigned action or null if no action has been assigned.
|
void | setAction(Action newAction) - Assigns the given action to this menuitem.
|
void | setEnabled(boolean b) - Enables and disables this button and if an action is assigned to this
menuitem the propertychange is forwarded to the assigned action.
|
ActionMenuItem
public ActionMenuItem(Action action)
Creates a new menu item based on the specified action.
ActionMenuItem
public ActionMenuItem(Icon icon)
Creates a menu item with the specified icon.
ActionMenuItem
public ActionMenuItem(String text)
Creates a menu item with the specified label.
ActionMenuItem
public ActionMenuItem(String text,
Icon icon)
Creates a menu item with the specified label and icon.
text
- the label.icon
- the icon.
ActionMenuItem
public ActionMenuItem(String text,
int i)
Creates a new menu item with the specified label and mnemonic.
text
- the label.i
- the mnemonic.
getAction
public Action getAction()
Returns the assigned action or null if no action has been assigned.
setAction
public void setAction(Action newAction)
Assigns the given action to this menuitem. The properties of the action
will be assigned to the menuitem. If an previous action was set, the old
action is unregistered.
- NAME - specifies the menuitem text
- SMALL_ICON - specifies the
menuitems icon
- MNEMONIC_KEY - specifies the menuitems mnemonic key
- ACCELERATOR_KEY - specifies the menuitems accelerator
newAction
- the new action
setEnabled
public void setEnabled(boolean b)
Enables and disables this button and if an action is assigned to this
menuitem the propertychange is forwarded to the assigned action.
b
- the new enable-state of this menuitem