Module is.codion.swing.common.ui
Interface MenuBuilder
- All Superinterfaces:
ComponentBuilder<Void,
JMenu, MenuBuilder>
A builder for menus.
-
Field Summary
Fields inherited from interface is.codion.swing.common.ui.component.builder.ComponentBuilder
COMPONENT_VALUE, TRANSFER_FOCUS_ON_ENTER
-
Method Summary
Modifier and TypeMethodDescriptionstatic MenuBuilder
builder()
static MenuBuilder
static MenuBuilder
builder
(Controls.ControlsBuilder controlsBuilder) Adds all actions from the givenControls
instancemenuItemBuilder
(MenuItemBuilder<?, ?> menuItemBuilder) menuListener
(MenuListener menuListener) popupMenuListener
(PopupMenuListener popupMenuListener) Has no effect if a popup menu is not created.Adds a separatortoggleMenuItemBuilder
(ToggleMenuItemBuilder<?, ?> toggleMenuItemBuilder) Methods inherited from interface is.codion.swing.common.ui.component.builder.ComponentBuilder
background, border, build, build, buildValue, buildValue, clientProperty, componentListener, componentOrientation, consumer, enabled, enabled, focusable, focusCycleRoot, focusListener, font, foreground, keyEvent, keyListener, label, link, link, listener, maximumHeight, maximumSize, maximumWidth, minimumHeight, minimumSize, minimumWidth, mouseListener, mouseMotionListener, mouseWheelListener, name, onBuild, onBuildValue, onSetVisible, opaque, popupMenu, popupMenuControl, popupMenuControls, preferredHeight, preferredSize, preferredWidth, propertyChangeListener, propertyChangeListener, scrollPane, toolTipText, transferFocusOnEnter, transferHandler, validator, value, visible
-
Method Details
-
action
- Parameters:
action
- the action to add- Returns:
- this builder instance
-
control
- Parameters:
control
- the control to add- Returns:
- this builder instance
-
controls
Adds all actions from the givenControls
instance- Parameters:
controls
- the Controls instance- Returns:
- this builder instance
-
separator
MenuBuilder separator()Adds a separator- Returns:
- this builder instance
- See Also:
-
popupMenuListener
Has no effect if a popup menu is not created.- Parameters:
popupMenuListener
- the popup menu listener- Returns:
- this builder instance
- See Also:
-
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
- Returns:
- a new MenuBuilder
-
builder
- Parameters:
controls
- the controls to base the menu on- Returns:
- a new MenuBuilder based on the given controls
-
builder
- Parameters:
controlsBuilder
- the controls builder to base the menu on- Returns:
- a new MenuBuilder based on the given controls
-