Class MenuBuilder
- java.lang.Object
-
- org.opennms.features.topology.app.internal.menu.MenuBuilder
-
public class MenuBuilder extends Object
Builder to create a Menu.
-
-
Constructor Summary
Constructors Constructor Description MenuBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMenuItem(MenuItem menuItem, String... parentPath)Adds a menu item for path.voidapply(com.vaadin.ui.MenuBar rootMenu, List<VertexRef> targets, OperationContext operationContext, Runnable... hooks)protected voidapplyOrderToChildren(MenuItem parent)com.vaadin.ui.MenuBarbuild(List<VertexRef> targets, OperationContext operationContext, Runnable... hooks)Converts the current menu configuration to Vaadin'sMenuBarrepresentation.voidcreatePath(String... path)Creates the provided menu path (e.g.protected voiddetermineAndApplyOrder()protected static StringgetGroupForLabel(String label, List<String> submenuOrder)protected static StringremoveLabelProperties(String commandKey)voidsetSubMenuGroupOrder(Map<String,List<String>> submenOrderMap)voidsetTopLevelMenuOrder(List<String> menuOrder)
-
-
-
Method Detail
-
createPath
public void createPath(String... path)
Creates the provided menu path (e.g. File, Save As)- Parameters:
path- The path to create
-
addMenuItem
public void addMenuItem(MenuItem menuItem, String... parentPath)
Adds a menu item for path. If path is empty, it is added as a root entry.- Parameters:
menuItem- The item to add.parentPath- The item to add to
-
determineAndApplyOrder
protected void determineAndApplyOrder()
-
applyOrderToChildren
protected void applyOrderToChildren(MenuItem parent)
-
build
public com.vaadin.ui.MenuBar build(List<VertexRef> targets, OperationContext operationContext, Runnable... hooks)
Converts the current menu configuration to Vaadin'sMenuBarrepresentation.- Parameters:
targets- The current targets (e.g. the selection)operationContext- The currentOperationContext.hooks- Optional hooks to be executed after a menu item's command has been executed.- Returns:
- The converted
MenuBar
-
apply
public void apply(com.vaadin.ui.MenuBar rootMenu, List<VertexRef> targets, OperationContext operationContext, Runnable... hooks)
-
-