org.fopps.ui
Class MenuBuilder

java.lang.Object
  |
  +--org.fopps.ui.MenuBuilder

public class MenuBuilder
extends java.lang.Object

MenuBuilder creates menue from an actions list. The contents of each menu depends on the action's group. The technique is very similar to ToolBarBuilder.

Author:
Oliver Wieland

Field Summary
static char GROUP_SEPERATOR
          Seperator char used to identify new group name
 
Constructor Summary
MenuBuilder()
           
 
Method Summary
static java.util.Map createMenu(ActionHandler pHandler)
          Create menu
static java.util.Map createMenu(ActionHandler pHandler, java.lang.String[] pMenuesToGlue)
          Create tool bars from an action list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GROUP_SEPERATOR

public static final char GROUP_SEPERATOR
Seperator char used to identify new group name

See Also:
Constant Field Values
Constructor Detail

MenuBuilder

public MenuBuilder()
Method Detail

createMenu

public static java.util.Map createMenu(ActionHandler pHandler)
Create menu

Parameters:
pHandler - ActionHandler which contains the actions
Returns:
Collection containing the created tool bars. If the list is null or does not contain any action, an empty list is returned

createMenu

public static java.util.Map createMenu(ActionHandler pHandler,
                                       java.lang.String[] pMenuesToGlue)
Create tool bars from an action list. In comparison to ToolbarBuilder it is possible to assign an own group name to change the menues name. To do so, you have to add the name in front of the list, seperated by a colon. This name is also used to identify the corresponding resource entry.

Parameters:
pHandler - ActionHandler which contains the actions
pMenuesToGlue - List containing the group names of the menues to put together. To glue bars a,b, and d,e, the array contents has to look like {"a,b,c", "d,e"}. To assign a different group name, use {"myGroupname;a,b,c"}
Returns:
Collection containing the created tool bars. If the list is null or does not contain any action, an empty list is returned.
See Also:
GROUP_SEPERATOR, ActionGroups.MENU_FILE, ActionGroups.MENU_EDIT, ActionGroups.MENU_VIEW


Fopps 0.19 - Copyright © 2002 Oliver Wieland. All Rights Reserved.