Interface MenuItemProvider<T extends MenuItem>

Type Parameters:
T - menu item type
All Known Implementing Classes:
MenuConfigHorizontalMenuItemProvider, MenuConfigListMenuItemProvider, MenuConfigMenuItemProvider

public interface MenuItemProvider<T extends MenuItem>
Represents menu item source which can be bound to a menu
  • Method Details

    • load

      void load()
      Loads menu items.
    • addCollectionChangedListener

      Subscription addCollectionChangedListener(Consumer<MenuItemProvider.CollectionChangeEvent<T>> listener)
      Adds a listener for an event of menu item collection change.
      Parameters:
      listener - a listener to add
      Returns:
      subscription for the listener
    • getMenuItems

      List<T> getMenuItems()
      Returns:
      loaded menu items.
    • addMenuItemsTransformer

      void addMenuItemsTransformer(Function<List<T>,List<T>> itemsTransformer)
      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).
      Parameters:
      itemsTransformer - a transform function to add
    • removeMenuItemsTransformer

      void removeMenuItemsTransformer(Function<List<T>,List<T>> transformer)
      Removes menu item transform function
      Parameters:
      transformer - transform function to remove
      See Also: