Package docking.menu
Class MenuManager
java.lang.Object
docking.menu.MenuManager
Class to manage a hierarchy of menus.
-
Constructor Summary
ConstructorDescriptionMenuManager
(String name, char mnemonicKey, String group, boolean usePopupPath, MenuHandler menuHandler, MenuGroupMap menuGroupMap) Constructs a new MenuManager -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAction
(DockingActionIf action) Adds an action to this menu.void
dispose()
getGroup()
getMenu()
Returns a Menu hierarchy of all the actionsstatic char
getMnemonicKey
(String str) Parses the mnemonic key from the menu items text.Returns a JPopupMenu for the action hierarchyboolean
isEmpty()
Tests if this menu is empty.void
menuGroupChanged
(String[] theMenuPath, int i, String localGroup) Notification that a menu item has changed groups.boolean
removeAction
(DockingActionIf action) static String
stripMnemonicAmp
(String text) Removes the Mnemonic indicator character (&) from the texttoString()
-
Constructor Details
-
Method Details
-
addAction
Adds an action to this menu. Can create subMenus depending on the menuPath of the action- Parameters:
action
- the action to be added
-
getAction
-
getMnemonicKey
Parses the mnemonic key from the menu items text.- Parameters:
str
- the menu item text- Returns:
- the mnemonic key for encoded in the actions menu text. Returns 0 if there is none.
-
stripMnemonicAmp
Removes the Mnemonic indicator character (&) from the text- Parameters:
text
- the text to strip- Returns:
- the stripped mnemonic
-
isEmpty
public boolean isEmpty()Tests if this menu is empty. -
getMenu
Returns a Menu hierarchy of all the actions- Returns:
- the menu
-
getMenuItem
- See Also:
-
getGroup
- See Also:
-
getSubGroup
-
dispose
public void dispose() -
getPopupMenu
Returns a JPopupMenu for the action hierarchy- Returns:
- the popup menu
-
removeAction
-
toString
-
getMenuHandler
-
getMenuItemText
-