Package docking.action

# Class MenuData

java.lang.Object
docking.action.MenuData

Direct Known Subclasses:
  `MenuBarData`, `PopupMenuData`

public class MenuData extends Object

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `NO_MNEMONIC`
  `static final String`
  `NO_SUBGROUP`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MenuData(MenuData menuData)`
  `MenuData(String[] menuPath)`
  `MenuData(String[] menuPath, String group)`
  `MenuData(String[] menuPath, Icon icon)`
  `MenuData(String[] menuPath, Icon icon, String menuGroup)`
  `MenuData(String[] menuPath, Icon icon, String menuGroup, int mnemonic, String menuSubGroup)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `clearMnemonic()`
  `MenuData`
  `cloneData()`
  `protected void`
  `firePropertyChanged(MenuData oldData)`
  `String`
  `getMenuGroup()`
  Returns the group for the menu item created by this data.
  `Icon`
  `getMenuIcon()`
  Returns the icon assigned to this action's menu.
  `String`
  `getMenuItemName()`
  `String[]`
  `getMenuPath()`
  Returns the menu path.
  `String`
  `getMenuPathAsString()`
  `String`
  `getMenuSubGroup()`
  Returns the subgroup string.
  `int`
  `getMnemonic()`
  `String`
  `getParentMenuGroup()`
  Returns the group for the parent menu of the menu item created by this data.
  `void`
  `setIcon(Icon newIcon)`
  `void`
  `setMenuGroup(String newGroup)`
  `void`
  `setMenuItemName(String newMenuItemName)`
  Sets the menu item name and the mnemonic, using the first '&' found in the text as a marker ("S&ave As").
  `void`
  `setMenuItemNamePlain(String newMenuItemName)`
  Sets the menu item name, without parsing the name for mnemonics ("&File").
  `void`
  `setMenuPath(String[] newPath)`
  `void`
  `setMenuSubGroup(String newSubGroup)`
  `void`
  `setMnemonic(Character newMnemonic)`
  `void`
  `setParentMenuGroup(String newParentMenuGroup)`
  See the description in `getParentMenuGroup()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### NO_MNEMONIC

    public static final int NO_MNEMONIC
    See Also:
      - Constant Field Values

  - ### NO_SUBGROUP

    public static final String NO_SUBGROUP

- ## Constructor Details

  - ### MenuData

    public MenuData(String[] menuPath)

  - ### MenuData

    public MenuData(String[] menuPath, String group)

  - ### MenuData

    public MenuData(String[] menuPath, Icon icon)

  - ### MenuData

    public MenuData(String[] menuPath, Icon icon, String menuGroup)

  - ### MenuData

    public MenuData(String[] menuPath, Icon icon, String menuGroup, int mnemonic, String menuSubGroup)

  - ### MenuData

    public MenuData(MenuData menuData)

- ## Method Details

  - ### cloneData

    public MenuData cloneData()

  - ### firePropertyChanged

    protected void firePropertyChanged(MenuData oldData)

  - ### getMenuPath

    public String[] getMenuPath()
    Returns the menu path.
    Returns:
      an array of strings where each string is an element of a higher level menu.

  - ### getMenuPathAsString

    public String getMenuPathAsString()

  - ### getMnemonic

    public int getMnemonic()

  - ### getMenuIcon

    public Icon 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

    public String 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 for `setMenuSubGroup(String)`.
    Returns:
      the group

  - ### getMenuSubGroup

    public String getMenuSubGroup()
    Returns the subgroup string. This string is used to sort items within a `toolbar 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

    public String getParentMenuGroup()
    Returns the group for the parent menu of the menu item created by this data. That is, this value is effectively the same as `getMenuGroup()`, but for the parent menu item of this data's item. Setting this value is only valid if the `getMenuPath()` has a length greater than 1.
    Returns:
      the parent group

  - ### setIcon

    public void setIcon(Icon newIcon)

  - ### setMenuGroup

    public void setMenuGroup(String newGroup)

  - ### setMenuSubGroup

    public void setMenuSubGroup(String newSubGroup)

  - ### setParentMenuGroup

    public void setParentMenuGroup(String newParentMenuGroup)
    See the description in `getParentMenuGroup()`
    Parameters:
      `newParentMenuGroup` - the parent group

  - ### setMenuPath

    public void setMenuPath(String[] newPath)

  - ### setMnemonic

    public void setMnemonic(Character newMnemonic)

  - ### clearMnemonic

    public void clearMnemonic()

  - ### setMenuItemName

    public void setMenuItemName(String newMenuItemName)
    Sets the menu item name and the mnemonic, using the first '&' 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 manually `set` the 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

    public void setMenuItemNamePlain(String newMenuItemName)
    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

  - ### getMenuItemName

    public String getMenuItemName()