Package org.apache.ofbiz.widget.model
Class ModelMenu
java.lang.Object
org.apache.ofbiz.widget.model.ModelWidget
org.apache.ofbiz.widget.model.ModelMenu
- All Implemented Interfaces:
Serializable
Models the <menu> element. see widget-menu.xsd
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.ofbiz.widget.model.ModelWidget
ModelWidget.NamedBorderType
-
Field Summary
Fields inherited from class org.apache.ofbiz.widget.model.ModelWidget
ENABLE_BOUNDARY_COMMENTS_PARAM
-
Constructor Summary
ConstructorDescriptionModelMenu
(Element menuElement, String menuLocation, VisualTheme visualTheme) XML Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(ModelWidgetVisitor visitor) Gets actions.Returns the widget's name to be used in boundary comments.getCurrentMenuName
(Map<String, Object> context) Gets current menu name.Gets default align.Gets default align style.Gets default associated content id.getDefaultAssociatedContentId
(Map<String, Object> context) Gets default associated content id.Gets default cell width.Gets default disabled title style.Gets default entity name.Gets default hide if selected.Gets default menu item name.Gets default permission entity action.Gets default permission operation.Gets default selected style.Gets default title style.Gets default tooltip style.Gets default widget style.Gets extra index.getExtraIndex
(Map<String, Object> context) Gets extra index.Gets fill style.getId()
Gets id.getMenuContainerStyle
(Map<String, Object> context) Gets menu container style.Gets menu container style exdr.Gets menu item list.Gets menu item map.Gets menu location.Gets menu width.getModelMenuItemByName
(String name) Gets model menu item by name.Gets orientation.Gets parent menu.Gets selected menu item context field name.getSelectedMenuItemContextFieldName
(Map<String, Object> context) Gets selected menu item context field name.Gets target.getTitle()
Gets title.Gets title.Gets tooltip.getType()
Gets type.int
renderedMenuItemCount
(Map<String, Object> context) Rendered menu item count int.void
renderMenuString
(Appendable writer, Map<String, Object> context, MenuStringRenderer menuStringRenderer) Renders this menu to a String, i.e.void
renderSimpleMenuString
(Appendable writer, Map<String, Object> context, MenuStringRenderer menuStringRenderer) Render simple menu string.void
runActions
(Map<String, Object> context) Run actions.Methods inherited from class org.apache.ofbiz.widget.model.ModelWidget
getName, getStartColumn, getStartLine, getSystemId, toString, widgetBoundaryCommentsEnabled, widgetNamedBorderType
-
Constructor Details
-
ModelMenu
XML Constructor
-
-
Method Details
-
accept
- Specified by:
accept
in classModelWidget
- Throws:
Exception
-
getActions
Gets actions.- Returns:
- the actions
-
getBoundaryCommentName
Description copied from class:ModelWidget
Returns the widget's name to be used in boundary comments. The default action is to return the widget's name. Derived classes can override this method to return a customized name.- Overrides:
getBoundaryCommentName
in classModelWidget
- Returns:
- Name to be used in boundary comments
-
getCurrentMenuName
Gets current menu name.- Parameters:
context
- the context- Returns:
- the current menu name
-
getDefaultAlign
Gets default align.- Returns:
- the default align
-
getDefaultAlignStyle
Gets default align style.- Returns:
- the default align style
-
getDefaultAssociatedContentId
Gets default associated content id.- Returns:
- the default associated content id
-
getDefaultAssociatedContentId
Gets default associated content id.- Parameters:
context
- the context- Returns:
- the default associated content id
-
getDefaultCellWidth
Gets default cell width.- Returns:
- the default cell width
-
getDefaultDisabledTitleStyle
Gets default disabled title style.- Returns:
- the default disabled title style
-
getDefaultEntityName
Gets default entity name.- Returns:
- the default entity name
-
getDefaultHideIfSelected
Gets default hide if selected.- Returns:
- the default hide if selected
-
getDefaultMenuItemName
Gets default menu item name.- Returns:
- the default menu item name
-
getDefaultPermissionEntityAction
Gets default permission entity action.- Returns:
- the default permission entity action
-
getDefaultPermissionOperation
Gets default permission operation.- Returns:
- the default permission operation
-
getDefaultSelectedStyle
Gets default selected style.- Returns:
- the default selected style
-
getDefaultTitleStyle
Gets default title style.- Returns:
- the default title style
-
getDefaultTooltipStyle
Gets default tooltip style.- Returns:
- the default tooltip style
-
getDefaultWidgetStyle
Gets default widget style.- Returns:
- the default widget style
-
getExtraIndex
Gets extra index.- Returns:
- the extra index
-
getExtraIndex
Gets extra index.- Parameters:
context
- the context- Returns:
- the extra index
-
getFillStyle
Gets fill style.- Returns:
- the fill style
-
getId
Gets id.- Returns:
- the id
-
getMenuContainerStyle
Gets menu container style.- Parameters:
context
- the context- Returns:
- the menu container style
-
getMenuContainerStyleExdr
Gets menu container style exdr.- Returns:
- the menu container style exdr
-
getMenuItemList
Gets menu item list.- Returns:
- the menu item list
-
getMenuItemMap
Gets menu item map.- Returns:
- the menu item map
-
getMenuLocation
Gets menu location.- Returns:
- the menu location
-
getMenuWidth
Gets menu width.- Returns:
- the menu width
-
getModelMenuItemByName
Gets model menu item by name.- Parameters:
name
- the name- Returns:
- the model menu item by name
-
getOrientation
Gets orientation.- Returns:
- the orientation
-
getParentMenu
Gets parent menu.- Returns:
- the parent menu
-
getSelectedMenuItemContextFieldName
Gets selected menu item context field name.- Returns:
- the selected menu item context field name
-
getSelectedMenuItemContextFieldName
Gets selected menu item context field name.- Parameters:
context
- the context- Returns:
- the selected menu item context field name
-
getTarget
Gets target.- Returns:
- the target
-
getTitle
Gets title.- Returns:
- the title
-
getTitle
Gets title.- Parameters:
context
- the context- Returns:
- the title
-
getTooltip
Gets tooltip.- Returns:
- the tooltip
-
getType
Gets type.- Returns:
- the type
-
renderedMenuItemCount
Rendered menu item count int.- Parameters:
context
- the context- Returns:
- the int
-
renderMenuString
public void renderMenuString(Appendable writer, Map<String, Object> context, MenuStringRenderer menuStringRenderer) throws IOExceptionRenders this menu to a String, i.e. in a text format, as defined with the MenuStringRenderer implementation.- Parameters:
writer
- The Writer that the menu text will be written tocontext
- Map containing the menu context; the following are reserved words in this context: parameters (Map), isError (Boolean), itemIndex (Integer, for lists only, otherwise null), menuName (String, optional alternate name for menu, defaults to the value of the name attribute)menuStringRenderer
- An implementation of the MenuStringRenderer interface that is responsible for the actual text generation for different menu elements; implementing you own makes it possible to use the same menu definitions for many types of menu UIs- Throws:
IOException
- the io exception
-
renderSimpleMenuString
public void renderSimpleMenuString(Appendable writer, Map<String, Object> context, MenuStringRenderer menuStringRenderer) throws IOExceptionRender simple menu string.- Parameters:
writer
- the writercontext
- the contextmenuStringRenderer
- the menu string renderer- Throws:
IOException
- the io exception
-
runActions
Run actions.- Parameters:
context
- the context
-