|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectptolemy.vergil.toolbox.MenuActionFactory
public class MenuActionFactory
A factory that adds a given action or set of actions to a context menu. If an array of actions is given to the constructor, then the actions will be put in a submenu with the specified label.
| Red (johnr) |
| Red (eal) |
| Field Summary | |
|---|---|
private javax.swing.Action |
_action
The action that will be added to the context menu. |
private javax.swing.Action[] |
_actions
The group of actions that will be added in a submenu. |
private java.lang.String |
_label
The submenu label, if one was given. |
private java.util.List |
_menuItemListeners
the list of menu item listeners. |
| Constructor Summary | |
|---|---|
MenuActionFactory(javax.swing.Action action)
Construct a factory that adds a given action to a given context menu. |
|
MenuActionFactory(javax.swing.Action[] actions,
java.lang.String label)
Construct a factory that adds a given group of actions to a given context menu in a submenu with the specified label. |
|
| Method Summary | |
|---|---|
protected javax.swing.JMenuItem |
_add(JContextMenu menu,
javax.swing.Action action,
java.lang.String tooltip)
Add an action to the context menu. |
protected javax.swing.JMenuItem |
_add(javax.swing.JMenu submenu,
javax.swing.Action action)
Add an action to the submenu. |
void |
addAction(javax.swing.Action action)
Add an action to the pre-existing group of actions. |
void |
addAction(javax.swing.Action action,
java.lang.String label)
Add an action to the pre-existing group of actions. |
void |
addActions(javax.swing.Action[] actions,
java.lang.String label)
Add a set of action to the pre-existing group of actions. |
void |
addMenuItemListener(MenuItemListener listener)
Add a menu item listener to the list of menu item listeners. |
javax.swing.JMenuItem |
create(JContextMenu menu,
NamedObj object)
Add an item to the given context menu that will configure the parameters on the given target. |
boolean |
substitute(javax.swing.Action oldAction,
javax.swing.Action newAction)
Substitute the old action with the new action, if the old action is added to this factory. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private javax.swing.Action _action
private javax.swing.Action[] _actions
private java.lang.String _label
private java.util.List _menuItemListeners
| Constructor Detail |
|---|
public MenuActionFactory(javax.swing.Action action)
action - The action to be associated with the context menu.
public MenuActionFactory(javax.swing.Action[] actions,
java.lang.String label)
actions - The actions to be in the submenu.label - The label for the submenu.| Method Detail |
|---|
public void addAction(javax.swing.Action action)
action - The action to add.
public void addAction(javax.swing.Action action,
java.lang.String label)
action - The action to add.label - The label to give to the menu group.
public void addActions(javax.swing.Action[] actions,
java.lang.String label)
actions - The actions to add.label - The label to give to the menu group if it
previously not a menu group.public void addMenuItemListener(MenuItemListener listener)
listener - The menu item listener.
public javax.swing.JMenuItem create(JContextMenu menu,
NamedObj object)
create in interface MenuItemFactorymenu - The context menu to add to.object - The object that the menu item command will operate on.
public boolean substitute(javax.swing.Action oldAction,
javax.swing.Action newAction)
oldAction - The old action.newAction - The new action.
protected javax.swing.JMenuItem _add(JContextMenu menu,
javax.swing.Action action,
java.lang.String tooltip)
menu - The context menu.action - The action to be added to the context menu.tooltip - The tooltip for the action.
protected javax.swing.JMenuItem _add(javax.swing.JMenu submenu,
javax.swing.Action action)
submenu - The submenu.action - The action to be added to the submenu.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||