Package it.tidalwave.ui.core.spi
Class ToolBarControlSupport<B,T,BT>
java.lang.Object
it.tidalwave.ui.core.spi.ToolBarControlSupport<B,T,BT>
- Type Parameters:
B
- the concrete type of the binderT
- the concrete type of the toolbarBT
- the concrete type of the button
- All Implemented Interfaces:
ToolBarControl<B,
T>
A support implementation for
ToolBarControl
.- Since:
- 1.1-ALPHA-6
- Author:
- Fabrizio Giudici
-
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
addButtonsToToolBar
(T toolBar, List<BT> buttons) Adds buttons to the toolbar.protected abstract BT
createButton
(B binder, UserAction action) Creates a button bound to the givenUserAction
.void
Populates the menu bar with menus.
-
Field Details
-
userActionsSupplier
The default supplier ofUserAction
s, can be injected for testing.
-
-
Constructor Details
-
ToolBarControlSupport
protected ToolBarControlSupport()Default constructor.
-
-
Method Details
-
populate
Populates the menu bar with menus.- Specified by:
populate
in interfaceToolBarControl<B,
T> - Parameters:
binder
- the bindertoolBar
- the toolbar
-
createButton
Creates a button bound to the givenUserAction
.- Parameters:
binder
- the binderaction
- the user action- Returns:
- the button
-
addButtonsToToolBar
Adds buttons to the toolbar.- Parameters:
toolBar
- the toolbarbuttons
- the button
-