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 void
addMenuItem(MenuItem menuItem, String... parentPath)
Adds a menu item for path.void
apply(com.vaadin.ui.MenuBar rootMenu, List<VertexRef> targets, OperationContext operationContext, Runnable... hooks)
protected void
applyOrderToChildren(MenuItem parent)
com.vaadin.ui.MenuBar
build(List<VertexRef> targets, OperationContext operationContext, Runnable... hooks)
Converts the current menu configuration to Vaadin'sMenuBar
representation.void
createPath(String... path)
Creates the provided menu path (e.g.protected void
determineAndApplyOrder()
protected static String
getGroupForLabel(String label, List<String> submenuOrder)
protected static String
removeLabelProperties(String commandKey)
void
setSubMenuGroupOrder(Map<String,List<String>> submenOrderMap)
void
setTopLevelMenuOrder(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'sMenuBar
representation.- 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)
-
-