Class MenuFactory
java.lang.Object
com.foreach.across.modules.web.menu.MenuFactory
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addMenuBuilder
(MenuBuilder builder, Class<? extends Menu>... menuTypes) void
addMenuStore
(MenuStore store, Class<? extends Menu>... menuTypes) Fetches a generic menu with the given name.<T extends Menu>
T<T extends Menu,
E extends BuildMenuEvent<T>, B extends MenuBuilder<T, E>>
TbuildMenu
(T menu) Performs the build action on the given menu: publishes the build event, sorts and executes the selector attached to the event.getMenuWithName
(String name) Will search all MenuStore instances for a menu with the given name.void
setDefaultMenuBuilder
(MenuBuilder defaultMenuBuilder) void
setDefaultMenuStore
(MenuStore defaultMenuStore)
-
Constructor Details
-
MenuFactory
public MenuFactory()
-
-
Method Details
-
getDefaultMenuStore
-
getDefaultMenuBuilder
-
buildMenu
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
-
buildMenu
public <T extends Menu,E extends BuildMenuEvent<T>, T buildMenuB extends MenuBuilder<T, E>> (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
Will search all MenuStore instances for a menu with the given name.- Parameters:
name
- Name of the menu.- Returns:
- Menu or null
-