Package docking.action
Class MenuData
java.lang.Object
docking.action.MenuData
- Direct Known Subclasses:
MenuBarData,PopupMenuData
-
Field Summary
Fields -
Constructor Summary
ConstructorsChangeConstructorDescription -
Method Summary
ChangeModifier and TypeMethodDescriptionvoidprotected voidfirePropertyChanged(MenuData oldData) Returns the group for the menu item created by this data.Returns the icon assigned to this action's menu.String[]Returns the menu path.Returns the menu path as a string.Returns the menu path as a string.Returns the subgroup string.intMODIFIEDstatic intgetMnemonic(String menuName) Parses the mnemonic key from the menu items text.static intgetMnemonic(String[] menuPath) Returns the group for the parent menu of the menu item created by this data.voidvoidsetMenuGroup(String newGroup) voidsetMenuItemName(String newMenuItemName) Sets the menu item name and the mnemonic, using the first unescaped '&' found in the text as a marker ("S&ave As").voidsetMenuItemNamePlain(String newMenuItemName) Sets the menu item name, without parsing the name for mnemonics ("&File").voidsetMenuPath(String[] newPath) voidsetMenuSubGroup(String newSubGroup) voidsetMnemonic(Character newMnemonic) voidsetParentMenuGroup(String newParentMenuGroup) See the description ingetParentMenuGroup()NEWstatic StringstripMnemonicAmp(String menuItemName) Removes any single'&'characters used to set the mnemonic from the menu item name.
-
Field Details
-
NO_MNEMONIC
public static final int NO_MNEMONIC- See Also:
-
NO_SUBGROUP
-
-
Constructor Details
-
MenuData
-
MenuData
-
MenuData
-
MenuData
-
MenuData
-
MenuData
-
-
Method Details
-
cloneData
-
firePropertyChanged
-
getMenuPath
Returns the menu path.- Returns:
- an array of strings where each string is an element of a higher level menu.
-
getMenuPathAsString
Returns the menu path as a string. This method includes accelerator characters in the path- Returns:
- the menu path as a string
-
getMenuPathDisplayString
Returns the menu path as a string. This method filters accelerator chars('&') from the path.- Returns:
- the menu path as a string without unescaped '&' chars
-
getMnemonic
public int getMnemonic() -
getMenuIcon
Returns the icon assigned to this action's menu. Null indicates that this action does not have a menu icon- Returns:
- the icon
-
getMenuGroup
Returns the group for the menu item created by this data. This value determines which section inside of the tool's popup menu the menu item will be placed. If you need to control the ordering within a section, then provide a value forsetMenuSubGroup(String).- Returns:
- the group
-
getMenuSubGroup
Returns the subgroup string. This string is used to sort items within atoolbar group. This value is not required. If not specified, then the value will effectively place this item at the end of its specified group.- Returns:
- the sub-group
-
getParentMenuGroup
Returns the group for the parent menu of the menu item created by this data. That is, this value is effectively the same asgetMenuGroup(), but for the parent menu item of this data's item. Setting this value is only valid if thegetMenuPath()has a length greater than 1.- Returns:
- the parent group
-
setIcon
-
setMenuGroup
-
setMenuSubGroup
-
setParentMenuGroup
See the description ingetParentMenuGroup()- Parameters:
newParentMenuGroup- the parent group
-
setMenuPath
-
setMnemonic
-
clearMnemonic
public void clearMnemonic() -
setMenuItemName
Sets the menu item name and the mnemonic, using the first unescaped '&' found in the text as a marker ("S&ave As").NOTE: do NOT use this method with strings that contain user-supplied text. Instead, use
setMenuItemNamePlain(String), and then manuallysetthe mnemonic.- Parameters:
newMenuItemName- the new name for this menu item, with an optional '&' to flag one of the characters of the name as the new mnemonic of this item
-
setMenuItemNamePlain
Sets the menu item name, without parsing the name for mnemonics ("&File").Use this method instead of
setMenuItemName(String)when the name may have '&' characters that need to be preserved, which is typically any user supplied strings.- Parameters:
newMenuItemName- the new name for this menu item
-
getMnemonic
-
getMnemonic MODIFIED
param 1 renamed: string → menuName-static int getMnemonic(java.lang.String string)+static int getMnemonic(java.lang.String menuName)Parses the mnemonic key from the menu items text.- Parameters:
menuName(was: string) - the menu item text- Returns:
- the mnemonic key for encoded in the actions menu text. Returns 0 if there is none.
-
stripMnemonicAmp NEW
Removes any single'&'characters used to set the mnemonic from the menu item name. The'&'character can be included in the name by escaping with another'&'character.- Parameters:
menuItemName- the name that may include mnemonic information- Returns:
- the menu item name with single
'&'characters removed.
-
getMenuItemName
-