Package it.tidalwave.ui.core.spi
Class MenuBarControlSupport<B,MB,M>
java.lang.Object
it.tidalwave.ui.core.spi.MenuBarControlSupport<B,MB,M>
- Type Parameters:
B
- the type of the binderMB
- the type of the menubarM
- the type of the menu
- All Implemented Interfaces:
MenuBarControl<B,
MB>
A support implementation for
MenuBarControl
.- Since:
- 1.1-ALPHA-6
- Author:
- Fabrizio Giudici
-
Nested Class Summary
Nested classes/interfaces inherited from interface it.tidalwave.ui.core.MenuBarControl
MenuBarControl.MenuIndex, MenuBarControl.MenuPlacement
-
Field Summary
Modifier and TypeFieldDescriptionprotected final Supplier
<Collection<? extends UserAction>> The default supplier ofUserAction
s, can be injected for testing. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
addMenuItemToMenu
(M menu, B binder, UserAction action) Adds to the given menu a new item bound to the givenUserAction
.protected abstract void
addMenuToMenuBar
(MB menuBar, M menu) Adds a menu to the menu bar.protected abstract M
createMenu
(String label) Returns a new menu with the given label.void
Populates the menu bar with menus.
-
Field Details
-
userActionsSupplier
The default supplier ofUserAction
s, can be injected for testing.
-
-
Constructor Details
-
MenuBarControlSupport
protected MenuBarControlSupport()Default constructor.
-
-
Method Details
-
populate
Populates the menu bar with menus.- Specified by:
populate
in interfaceMenuBarControl<B,
MB> - Parameters:
binder
- the bindermenuBar
- the menu bar
-
createMenu
Returns a new menu with the given label..- Parameters:
label
- the label- Returns:
- a new menu with the given label
-
addMenuToMenuBar
Adds a menu to the menu bar.- Parameters:
menuBar
- the menu barmenu
- the menu
-
addMenuItemToMenu
protected abstract void addMenuItemToMenu(@Nonnull M menu, @Nonnull B binder, @Nonnull UserAction action) Adds to the given menu a new item bound to the givenUserAction
.- Parameters:
menu
- the menubinder
- the binderaction
- the user action
-