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
FieldsModifier and TypeFieldDescriptionprotected final Supplier<Collection<? extends UserAction>> The default supplier ofUserActions, can be injected for testing. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidaddButtonsToToolBar(T toolBar, List<BT> buttons) Adds buttons to the toolbar.protected abstract BTcreateButton(B binder, UserAction action) Creates a button bound to the givenUserAction.voidPopulates the menu bar with menus.
-
Field Details
-
userActionsSupplier
The default supplier ofUserActions, can be injected for testing.
-
-
Constructor Details
-
ToolBarControlSupport
protected ToolBarControlSupport()Default constructor.
-
-
Method Details
-
populate
Populates the menu bar with menus.- Specified by:
populatein 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
-