Module is.codion.swing.common.ui
Interface MenuBuilder
- All Superinterfaces:
ButtonBuilder<Void,
,JMenu, MenuBuilder> ComponentBuilder<Void,
,JMenu, MenuBuilder> MenuItemBuilder<JMenu,
MenuBuilder>
public interface MenuBuilder
extends ComponentBuilder<Void,JMenu,MenuBuilder>, MenuItemBuilder<JMenu,MenuBuilder>
A builder for menus.
-
Field Summary
Fields inherited from interface is.codion.swing.common.ui.component.builder.ComponentBuilder
TRANSFER_FOCUS_ON_ENTER
-
Method Summary
Modifier and TypeMethodDescriptionstatic MenuBuilder
builder()
static MenuBuilder
static MenuBuilder
builder
(Controls.Builder 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.button.ButtonBuilder
action, actionListener, borderPainted, buttonGroup, contentAreaFilled, control, control, disabledIcon, disabledSelectedIcon, focusPainted, horizontalAlignment, horizontalTextPosition, icon, iconTextGap, includeText, margin, mnemonic, multiClickThreshold, pressedIcon, rolloverEnabled, rolloverIcon, rolloverSelectedIcon, selected, selectedIcon, text, verticalAlignment, verticalTextPosition
Methods inherited from interface is.codion.swing.common.ui.component.builder.ComponentBuilder
background, border, build, build, buildValue, clear, clientProperty, componentListener, componentOrientation, enabled, enabled, focusable, focusCycleRoot, focusListener, font, foreground, initialValue, keyEvent, keyListener, label, linkedValue, linkedValue, maximumHeight, maximumSize, maximumWidth, minimumHeight, minimumSize, minimumWidth, mouseListener, mouseMotionListener, mouseWheelListener, onBuild, onSetVisible, opaque, popupMenu, popupMenuControl, popupMenuControls, preferredHeight, preferredSize, preferredWidth, propertyChangeListener, propertyChangeListener, scrollPane, toolTipText, transferFocusOnEnter, transferHandler, validator, visible
-
Method Details
-
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
-
createPopupMenu
JPopupMenu createPopupMenu()- Returns:
- a new JPopupMenu based on this menu builder
-
createMenuBar
JMenuBar createMenuBar()- 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
-