|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.vergil.toolbox.MenuActionFactory
ptolemy.vergil.toolbox.RadioMenuActionFactory
public class RadioMenuActionFactory
A factory that adds a given action or set of actions as radio selections to a context menu. All the actions created by an instance of this factory are in the same group. Selecting one item in a group causes the currently selected item in the same group unselected, if it is not the same as the newly selected one. If an array of actions is given to the constructor, then the actions will be put in a submenu with the specified label.
Red (tfeng) |
Red (tfeng) |
Field Summary | |
---|---|
private javax.swing.ButtonGroup |
_group
The group that contains all the actions for this factory. |
Constructor Summary | |
---|---|
RadioMenuActionFactory(javax.swing.Action action)
Construct a factory that adds a given action as a radio selection to a given context menu. |
|
RadioMenuActionFactory(javax.swing.Action[] actions,
java.lang.String label)
Construct a factory that adds a given group of actions as radio selections 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. |
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. |
Methods inherited from class ptolemy.vergil.toolbox.MenuActionFactory |
---|
addAction, addAction, addActions, addMenuItemListener, substitute |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private javax.swing.ButtonGroup _group
Constructor Detail |
---|
public RadioMenuActionFactory(javax.swing.Action action)
action
- The action to be associated with the context menu.public RadioMenuActionFactory(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 javax.swing.JMenuItem create(JContextMenu menu, NamedObj object)
create
in interface MenuItemFactory
create
in class MenuActionFactory
menu
- The context menu to add to.object
- The object that the menu item command will operate on.
protected javax.swing.JMenuItem _add(JContextMenu menu, javax.swing.Action action, java.lang.String tooltip)
_add
in class MenuActionFactory
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)
_add
in class MenuActionFactory
submenu
- The submenu.action
- The action to be added to the submenu.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |