Class BaseMenuVisitor
- java.lang.Object
-
- org.uberfire.workbench.model.menu.impl.BaseMenuVisitor
-
- All Implemented Interfaces:
MenuVisitor
public abstract class BaseMenuVisitor extends Object implements MenuVisitor
-
-
Constructor Summary
Constructors Constructor Description BaseMenuVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidvisit(MenuCustom<?> menuCustom)Visits a custom menu item in the menu tree.voidvisit(MenuItemCommand menuItemCommand)Visits a menu item that has an associated command.voidvisit(MenuItemPerspective menuItemPerspective)Visits a menu item that has an associated perspective.voidvisit(MenuItemPlain menuItemPlain)Visits a plain menu item in the tree.booleanvisitEnter(MenuGroup menuGroup)Visits a menu group in the tree of menus.booleanvisitEnter(Menus menus)Visits the top-level menu container.voidvisitLeave(MenuGroup menuGroup)Visits a menu group in the tree of menus.voidvisitLeave(Menus menus)Ends the visit of the top-level menu container.
-
-
-
Method Detail
-
visitEnter
public boolean visitEnter(Menus menus)
Description copied from interface:MenuVisitorVisits the top-level menu container. This is the first method invoked when visiting a complete menu tree.- Specified by:
visitEnterin interfaceMenuVisitor- Parameters:
menus- the top-level container of the menus that will be visited.- Returns:
- true if the visitor would like to continue down the tree and visit all children; false if it wants to skip this node. Since this is the root node, returning false from this call will result in no more calls to the visitor.
-
visitLeave
public void visitLeave(Menus menus)
Description copied from interface:MenuVisitorEnds the visit of the top-level menu container. This is the last method invoked when visiting a complete menu tree.Note that this method is not called if
MenuVisitor.visitEnter(Menus)returns false.- Specified by:
visitLeavein interfaceMenuVisitor- Parameters:
menus- the top-level container of the menus that will be visited.
-
visitEnter
public boolean visitEnter(MenuGroup menuGroup)
Description copied from interface:MenuVisitorVisits a menu group in the tree of menus. A menu group has zero or more MenuItem children.- Specified by:
visitEnterin interfaceMenuVisitor- Parameters:
menuGroup- the menu group to visit.- Returns:
- true if the visitor would like to visit all children of this node; false if it wants to skip this node. A
visitor that returns false from this node will not receive any further calls for this node or its
descendants. In particular, there will be no corresponding
MenuVisitor.visitLeave(MenuGroup)call for this node.
-
visitLeave
public void visitLeave(MenuGroup menuGroup)
Description copied from interface:MenuVisitorVisits a menu group in the tree of menus. All descendants of the given menu group have been visited before this method is called.Note that this method is not called for a MenuGroup where the
MenuVisitor.visitEnter(MenuGroup)method returned false.- Specified by:
visitLeavein interfaceMenuVisitor- Parameters:
menuGroup- the menu group to leave.
-
visit
public void visit(MenuItemPlain menuItemPlain)
Description copied from interface:MenuVisitorVisits a plain menu item in the tree.- Specified by:
visitin interfaceMenuVisitor- Parameters:
menuItemPlain- the plain menu item to visit.
-
visit
public void visit(MenuItemCommand menuItemCommand)
Description copied from interface:MenuVisitorVisits a menu item that has an associated command.- Specified by:
visitin interfaceMenuVisitor- Parameters:
menuItemCommand- the command menu item to visit.
-
visit
public void visit(MenuItemPerspective menuItemPerspective)
Description copied from interface:MenuVisitorVisits a menu item that has an associated perspective.- Specified by:
visitin interfaceMenuVisitor- Parameters:
menuItemPerspective- the command menu item to visit.
-
visit
public void visit(MenuCustom<?> menuCustom)
Description copied from interface:MenuVisitorVisits a custom menu item in the menu tree.- Specified by:
visitin interfaceMenuVisitor- Parameters:
menuCustom- the custom (application provides the widget) menu item to visit.
-
-