Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.uberfire.workbench.model.menu;


Visitor interface for implementing arbitrary operations over menus. For example, a visitor could filter a menu tree for items that the current user has permission to see; it could build widgets in a particular view module; it could simply dump the menu structure to a string.
 
 public interface MenuVisitor {

    
Visits the top-level menu container. This is the first method invoked when visiting a complete menu tree.

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.
    boolean visitEnterMenus menus );

    
Ends 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 visitEnter(org.uberfire.workbench.model.menu.Menus) returns false.

Parameters:
menus the top-level container of the menus that will be visited.
    void visitLeaveMenus menus );

    
Visits a menu group in the tree of menus. A menu group has zero or more MenuItem children.

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 visitLeave(org.uberfire.workbench.model.menu.MenuGroup) call for this node.
    boolean visitEnterMenuGroup menuGroup );

    
Visits 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 visitEnter(org.uberfire.workbench.model.menu.MenuGroup) method returned false.

Parameters:
menuGroup the menu group to leave.
    void visitLeaveMenuGroup menuGroup );

    
Visits a plain menu item in the tree.

Parameters:
menuItemPlain the plain menu item to visit.
    void visitMenuItemPlain menuItemPlain );

    
Visits a menu item that has an associated command.

Parameters:
menuItemCommand the command menu item to visit.
    void visitMenuItemCommand menuItemCommand );

    
Visits a menu item that has an associated perspective.

Parameters:
menuItemPerspective the command menu item to visit.
    void visitMenuItemPerspective menuItemPerspective );

    
Visits a custom menu item in the menu tree.

Parameters:
menuCustom the custom (application provides the widget) menu item to visit.
    void visitMenuCustom<?> menuCustom );
New to GrepCode? Check out our FAQ X