Class MenuFactory

java.lang.Object
com.foreach.across.modules.web.menu.MenuFactory

public class MenuFactory extends Object
  • Constructor Details

    • MenuFactory

      public MenuFactory()
  • Method Details

    • getDefaultMenuStore

      public MenuStore getDefaultMenuStore()
    • setDefaultMenuStore

      public void setDefaultMenuStore(MenuStore defaultMenuStore)
    • getDefaultMenuBuilder

      public MenuBuilder getDefaultMenuBuilder()
    • setDefaultMenuBuilder

      public void setDefaultMenuBuilder(MenuBuilder defaultMenuBuilder)
    • addMenuStore

      public void addMenuStore(MenuStore store, Class<? extends Menu>... menuTypes)
    • addMenuBuilder

      public void addMenuBuilder(MenuBuilder builder, Class<? extends Menu>... menuTypes)
    • buildMenu

      public Menu buildMenu(String name)
      Fetches a generic menu with the given name. If any store already has a menu with the given name, the existing menu will be returned.
      Parameters:
      name - Name of the menu.
      Returns:
      Menu instance.
    • buildMenu

      public <T extends Menu> T buildMenu(String name, Class<T> menuType)
    • buildMenu

      public <T extends Menu, E extends BuildMenuEvent<T>, B extends MenuBuilder<T, E>> T buildMenu(T menu)
      Performs the build action on the given menu: publishes the build event, sorts and executes the selector attached to the event.
      Type Parameters:
      T - Actual Menu implementation.
      Parameters:
      menu - Menu instance being built.
      Returns:
      Menu instance after build has completed.
    • getMenuWithName

      public Menu getMenuWithName(String name)
      Will search all MenuStore instances for a menu with the given name.
      Parameters:
      name - Name of the menu.
      Returns:
      Menu or null