Package io.jmix.flowui.menu.provider
Class MenuConfigMenuItemProvider<T extends MenuItem>
java.lang.Object
io.jmix.flowui.menu.provider.MenuConfigMenuItemProvider<T>
- Type Parameters:
T
- menu item type
- All Implemented Interfaces:
MenuItemProvider<T>
- Direct Known Subclasses:
MenuConfigHorizontalMenuItemProvider
,MenuConfigListMenuItemProvider
public abstract class MenuConfigMenuItemProvider<T extends MenuItem>
extends Object
implements MenuItemProvider<T>
Provides base functionality for menu item providers which use MenuConfig as menu item source
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jmix.flowui.menu.provider.MenuItemProvider
MenuItemProvider.CollectionChangeEvent<T>
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdds a listener for an event of menu item collection change.void
Adds a transform function which will be applied to menu items after load.convertToMenuItems
(Collection<MenuItem> menuConfigItems) Converts menu config item descriptors to menu items of specific implementationvoid
load()
Loads menu items.void
Removes menu item transform functiontransformItems
(List<T> menuItems)
-
Field Details
-
transformers
-
events
-
Constructor Details
-
Method Details
-
load
public void load()Description copied from interface:MenuItemProvider
Loads menu items.- Specified by:
load
in interfaceMenuItemProvider<T extends MenuItem>
-
convertToMenuItems
Converts menu config item descriptors to menu items of specific implementation- Parameters:
menuConfigItems
- menu config item descriptors- Returns:
- menu items of specific implementation
-
transformItems
-
addCollectionChangedListener
public Subscription addCollectionChangedListener(Consumer<MenuItemProvider.CollectionChangeEvent<T>> listener) Description copied from interface:MenuItemProvider
Adds a listener for an event of menu item collection change.- Specified by:
addCollectionChangedListener
in interfaceMenuItemProvider<T extends MenuItem>
- Parameters:
listener
- a listener to add- Returns:
- subscription for the listener
-
getMenuItems
- Specified by:
getMenuItems
in interfaceMenuItemProvider<T extends MenuItem>
- Returns:
- loaded menu items.
-
addMenuItemsTransformer
Description copied from interface:MenuItemProvider
Adds a transform function which will be applied to menu items after load. It can be used to add some customizations to loaded items (for example, expand or collapse specific items).- Specified by:
addMenuItemsTransformer
in interfaceMenuItemProvider<T extends MenuItem>
- Parameters:
itemsTransformer
- a transform function to add
-
removeMenuItemsTransformer
Description copied from interface:MenuItemProvider
Removes menu item transform function- Specified by:
removeMenuItemsTransformer
in interfaceMenuItemProvider<T extends MenuItem>
- Parameters:
transformer
- transform function to remove- See Also:
-