java.lang.Object
de.julianweinelt.datacat.dbx.api.ui.menubar.MenuComponent<JMenu>
de.julianweinelt.datacat.dbx.api.ui.menubar.Menu

public final class Menu extends MenuComponent<JMenu>
  • Constructor Details

    • Menu

      public Menu(String name, String categoryName)
      Create a new menu for the menubar in the editor. To define a priority, you can either call the method priority or call the constructor with priority Menu(String, String, int)
      Parameters:
      name - A String containing the name of the menu
      categoryName - The internal name of the menu. Only alphanumerical lower case letters and underscores are allowed.
    • Menu

      public Menu(String name, String categoryName, int priority)
      Create a new menu for the menubar in the editor
      Parameters:
      name - A String containing the name of the menu
      categoryName - The internal name of the menu. Only alphanumerical lower case letters and underscores are allowed.
      priority - The display priority. Must be below 900 to not conflict with the default menu.
  • Method Details

    • priority

      public Menu priority(int priority)
      Defines the display priority of the menu. All numbers greater than 899 are system-reserved.
      Parameters:
      priority - The priority as an integer
      Returns:
      The creating Menu object
    • child

      public Menu child(MenuComponent menuComponent)
      Adds a new child to the next row in the menu.
      Parameters:
      menuComponent - A MenuComponent object, either a sub-menu or a menu item.
      Returns:
      The creating Menu object
    • separator

      public Menu separator()
      Adds a separator child to the next row of the menu. It will be displayed as a horizontal line.
      Returns:
      The creating Menu object
    • create

      protected JMenu create()
      Description copied from class: MenuComponent
      Constructs a menu component
      Specified by:
      create in class MenuComponent<JMenu>
      Returns:
      The MenuComponent extending a JMenuItem object