All Superinterfaces:
ComponentBuilder<Void,JMenu,MenuBuilder>

public interface MenuBuilder extends ComponentBuilder<Void,JMenu,MenuBuilder>
A builder for menus.
  • Method Details

    • action

      MenuBuilder action(Action action)
      Parameters:
      action - the action to add
      Returns:
      this builder instance
    • control

      MenuBuilder control(Control control)
      Parameters:
      control - the control to add
      Returns:
      this builder instance
    • controls

      MenuBuilder controls(Controls controls)
      Adds all actions from the given Controls instance
      Parameters:
      controls - the Controls instance
      Returns:
      this builder instance
    • separator

      MenuBuilder separator()
      Adds a separator
      Returns:
      this builder instance
      See Also:
    • popupMenuListener

      MenuBuilder popupMenuListener(PopupMenuListener popupMenuListener)
      Has no effect if a popup menu is not created.
      Parameters:
      popupMenuListener - the popup menu listener
      Returns:
      this builder instance
      See Also:
    • toggleMenuItemBuilder

      MenuBuilder toggleMenuItemBuilder(ToggleMenuItemBuilder<?,?> toggleMenuItemBuilder)
      Parameters:
      toggleMenuItemBuilder - the toggle menu item builder to use when creating toggle menu items
      Returns:
      this builder instance
    • buildPopupMenu

      JPopupMenu buildPopupMenu()
      Returns:
      a new JPopupMenu based on this menu builder
    • buildMenuBar

      JMenuBar buildMenuBar()
      Returns:
      a new JMenuBar based on this menu builder
    • builder

      static MenuBuilder builder()
      Returns:
      a new MenuBuilder
    • builder

      static MenuBuilder builder(Controls controls)
      Parameters:
      controls - the controls to base the menu on
      Returns:
      a new MenuBuilder based on the given controls
    • builder

      static MenuBuilder builder(Controls.ControlsBuilder controlsBuilder)
      Parameters:
      controlsBuilder - the controls builder to base the menu on
      Returns:
      a new MenuBuilder based on the given controls