Class MenuNode
- java.lang.Object
-
- com.znize.platform.model.bean.Component
-
- com.znize.platform.model.menu.MenuNode
-
- All Implemented Interfaces:
ClientBehaviorHolder,DialogListener,java.io.Serializable
- Direct Known Subclasses:
TypedMenuNode
public class MenuNode extends Component implements java.io.Serializable, DialogListener, ClientBehaviorHolder
MenuNode represents an action source in UI. When clicked, a partial behavior request will be sent to server and the action will be handled.A menuNode can have children, so menu node is hierarchical like tree menu. A menu node can open a dialog for user to input data before executing its action.
- Since:
- 2.2
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.znize.platform.model.bean.Component
Component.ComponentVisitor
-
-
Field Summary
-
Fields inherited from class com.znize.platform.model.bean.Component
parentComponent, uiView
-
-
Constructor Summary
Constructors Constructor Description MenuNode(MenuBean menuBean, I18NName name, java.lang.String command, int defaultStyleNumber)Command menu node constructor.MenuNode(MenuBean menuBean, I18NName name, java.lang.String command, RenderStyle renderStyle)Command menu node constructor.MenuNode(MenuBean menuBean, java.lang.String id)ConstructorMenuNode(MenuBean menuBean, java.lang.String name, boolean nameLocalized, java.lang.String command, int defaultStyleNumber)Command menu node constructor.MenuNode(MenuBean menuBean, java.lang.String name, boolean nameLocalized, java.lang.String command, RenderStyle renderStyle)Command menu node constructor.MenuNode(MenuBean menuBean, java.lang.String command, int defaultStyleNumber)Command menu node constructor.MenuNode(MenuBean menuBean, java.lang.String command, RenderStyle renderStyle)Command menu node constructor.MenuNode(MenuBean menuBean, java.lang.String id, I18NName name, java.lang.Integer count, java.lang.String command, java.lang.Object userData, RenderStyle renderStyle, java.lang.Integer pageId)Command menu node constructor.MenuNode(MenuBean menuBean, java.lang.String id, I18NName name, java.lang.String outputLink, boolean addContextPath)Output link menu node constructorMenuNode(MenuBean menuBean, java.lang.String id, java.lang.String name, boolean nameLocalized)Label menuNode constructorMenuNode(MenuBean menuBean, java.lang.String id, java.lang.String name, boolean nameLocalized, RenderStyle renderStyle)Command menu node constructor.MenuNode(MenuBean menuBean, java.lang.String id, java.lang.String name, boolean nameLocalized, java.lang.Integer count, java.lang.String command, java.lang.Object userData, int defaultStyleNumber, java.lang.Integer pageId)Command menu node constructor.MenuNode(MenuBean menuBean, java.lang.String id, java.lang.String name, boolean nameLocalized, java.lang.Integer count, java.lang.String command, java.lang.Object userData, RenderStyle renderStyle, java.lang.Integer pageId)Command menu node constructor.MenuNode(MenuBean menuBean, java.lang.String id, java.lang.String name, boolean nameLocalized, java.lang.String outputLink, boolean addContextPath)Output link menu node constructorMenuNode(MenuBean menuBean, java.lang.String id, java.lang.String name, boolean nameLocalized, java.lang.String command, RenderStyle renderStyle, java.lang.Integer pageId)Command menu node constructor.MenuNode(MenuBean menuBean, java.lang.String name, java.lang.String command, RenderStyle renderStyle)Command menu node constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChild(MenuNode menuNode)Append the child menu node, replacing existing menu node with the same id if any.voidaddChild(java.lang.Integer position, MenuNode menuNode)Add child menu node at the position.voidaddChildren(java.lang.Integer position, java.util.List<MenuNode> menuNodes)Add the list of the menu nodes as children.voidaddChildren(java.util.List<MenuNode> menuNodes)Add the list of the menu nodes as children.voidaddChildren(java.util.List<MenuNode> menuNodes, MenuNodeFactory factory)Add the list of the menu nodes as children.<T extends MapEntity>
EntityCollectionProperty<T>addInputDataCollectionProperty(java.lang.Class propertyType, java.lang.Class memberType, RenderStyle renderStyle, boolean required)Add the single property(collection type) to the inputData that is a MapEntity.<T extends MapEntity>
EntityProperty<T>addInputDataProperty(java.lang.Class propertyType, java.lang.Object propertyValue, PartialBehaviorSupport partialBehaviorSupport, RenderStyle renderStyle, boolean required)Add the single property to the inputData that is a MapEntity.<T extends MapEntity>
EntityProperty<T>addInputDataProperty(java.lang.Class propertyType, java.lang.String visibleName, java.lang.Object propertyValue, PartialBehaviorSupport partialBehaviorSupport, RenderStyle renderStyle, boolean required)Add the single property to the inputData that is a MapEntity.<T extends MapEntity>
EntityProperty<T>addInputDataProperty(java.lang.String propertyName, java.lang.Class propertyType, java.lang.Object propertyValue, PartialBehaviorSupport partialBehaviorSupport, RenderStyle renderStyle, boolean required)Add the property to the inputData that is a MapEntity.VisitTargetasVisitTarget(boolean subTree)Create a VisitTarget for this MenuNode.java.lang.Stringclick()Handle menu node action.PageNavigationclickNode(boolean ignoreDialog, boolean ignoreProgress)Handle menu node action.<T extends MapEntity>
MapEntityBean<T>createInputDataMapEntityBean(ContainerBean containerBean)Create an inputDataBean that uses MapEntity to store data.<T extends MapEntity>
MapEntityBean<T>createInputDataMapEntityBean(ContainerBean containerBean, EntityViewConfig viewConfig)Create an inputDataBean that uses MapEntity to store data.PageNavigationdialogClosed(DialogBean dialogBean, java.lang.Object data)called when dialog closed (success)voidenableContinueCommandForInputDataBean()Enable Continue command for inputDataBean.booleanequals(java.lang.Object menuNode)MenuNodeActionHandlergetActionHandler()Get action handler.MenuNodeActionListenergetActionListener()Get the action listener that will be notified before and after the action of this menu node is handled.PartialBehaviorgetActionPartialBehavior(boolean create)Get the partial behavior for the action event.MenuNodegetChild(int index)Get the child menu node at the indexintgetChildCount()Get number of children.intgetChildIndex(java.lang.String name)Get the index of child menu node with the name (unlocalized).java.util.List<MenuNode>getChildren()Get child menu nodes.java.lang.StringgetClientId(VisitTarget visitTarget)Get the clientId of this component.java.lang.StringgetCommand()Get the command of this MenuNode.ContainerBeangetContainerBean()Get containerBean of this component, that is, the closest ancestor component of ContainerBean type.PartialBehavior.ContainerRenderRegionsgetContainerRenderRegions(ContainerBean defaultContainerBean, java.util.List<java.lang.Integer> defaultRenderRegions, boolean create)Get the ContainerRenderRegions to add action results.MenuNodeContextMenuBeangetContextMenuBean()Get the context menu of this menu node.java.lang.IntegergetCount()Get the count that is meaningful and will be shown with the menu node.DataAccessUnitgetDataAccessUnit(boolean returnNullForBoundDataAccessUnit)Get associated DataAccessUnit.intgetDepth()Get depth.static intgetDepth(MenuNode from, MenuNode to)Get depth: number of menu nodes in the pathjava.lang.StringgetDisplayName()Get the display name.java.lang.StringgetDomEventDynamicHandler(java.lang.String event)Get DOM event dynamic handler that is script, not ajax.DomEventSupportgetDomEventSupport()DOM event support that is not ajax.DomEventSupportgetDomEventSupport(boolean create)Get the DOM vent support of this menu node.MenuNodeFactorygetFactory()Get menu node factory.java.lang.IntegergetIcon()Get icon number.java.lang.StringgetId()Get menu node id that is unique within its MenuBean.PersistenceEntitygetInputData()Get the input data of this MenuNode.EntityBackingBeangetInputDataBean()Get the inputDataBean of this MenuNode that is an EntityBackingBean for user to input data for the action.java.lang.BooleangetInputDataBoolean()Get the input data single value as Booleanjava.util.DategetInputDataDate()Get the input data single value as DateEntityListBackingBean.EntitySelectScopegetInputDataEntitySelectScope(EntityListBackingBean.EntitySelectScope defaultScope)Get the EntitySelectScope of entity list view from the menuNode inputData.java.lang.IntegergetInputDataInteger()Get the input data single value as Integerjava.lang.ObjectgetInputDataSingleValue()Get inputData single value.java.lang.StringgetInputDataString()Get the input data single value as Stringjava.lang.ObjectgetInputDataValue(java.lang.String propertyName)Get the value for the property in the input data that is an entity with a list of properties.MenuNodegetLastChild()Get the last child menu nodeMenuNodeLazyInitializergetLazyInitializer()Get the MenuNodeLazyInitializer that will initialize this menu node and create its child menu nodes(if any) if this menu node is not initialized.ModuleScopedNamegetLicenseFeatureRequired()Get required license feature to execute menuNode command.java.lang.StringgetLocalizedName()Get localized name.MenuBeangetMenuBean()Get the MenuBean of this MenuNodeMenuNodegetMenuNodeWithPath(java.lang.String menuNodePath)Get the menu node with the path.ModuleNodegetModuleNode()Get the module node for this menu node if this menu node belongs to a module menu.I18NNamegetName()Get menuNode name.java.lang.StringgetNamePathAsString(int rootNodeDepth, java.lang.String separator)Get the name path from this node to its ancestor of the specified depth for example, A > B > C(this node).<T extends ViewConfig>
TgetNestedViewConfig(boolean command, java.lang.Class<T> viewConfigType)Get the nested viewConfig for its command or input data bean from the ViewConfig of its MenuBean.java.lang.StringgetOutputLink()Get the output link (hyperlink) for render style: RenderStyle.OUTPUT_LINK.java.lang.IntegergetPageId()Get the page Id for navigation after the action is handledjava.lang.ObjectgetParameter(java.lang.String key)Get the value of the parameter.MenuNodegetParent()Get parent menu nodeComponentgetParentComponent()Get parent componentPartialBehaviorgetPartialBehavior(java.lang.String event, boolean create)Get the partial behavior for the event.PartialBehaviorSupportgetPartialBehaviorSupport()Get the ajax support of this menu node.PartialBehaviorSupportgetPartialBehaviorSupport(boolean create)Get the partial behavior support of this menu node.RenderStylegetRenderStyle()Get renderStyle.java.lang.StringgetStyleClass()Get menu node style classjava.lang.StringgetTitle()Get title that is used as tooltip when mouse over.java.lang.ObjectgetUserData()Get user data that can be any object used by action handler.voidincreaseCount(int number)Increase the count of menu node by the number.voidinit()Initialize this menu node by adding its children.booleanisActionHandlerDelegateToParent()Whether the actionHandler of this menu node is null and delegate to its parent.booleanisAddSeparatorBefore()Whether to add a separator before this menu node? Ignored if this menu node is the first menu node among its siblings.booleanisCaptchaRequired()Is captcha required to perform the action of this menu node? A captcha provides a challenge that requires correct response from user, which is used to prevent Bots from performing the action.booleanisCountPartOfParent()Is the count of this MenuNode a part of the count of its parent menu node? If true, changing the count of this MenuNode will update the count of its parent menu node.booleanisDefaultCommand()Is this menu node the default command in the scope of its closest ancestor component of type EntityBackingBean or EntityListBackingBean.booleanisDisabled()For command menu node, is it disabled?booleanisEntitySelectionRequired()Whether this command is executed on one or more selected entities?booleanisExpanded()Whether this menu node is expanded for tree menu.booleanisIconOnly()Whether to display an icon only without name?booleanisImmediate()Whether the action of this menu node will be handled in JSF apply request value phase, skipping model update.booleanisInitialized()Whether this menu node is initialized? If its children has been created, then it is initialized.booleanisLeaf()Is menu node a leaf without children?booleanisLicenseFeatureInheritted()Whether required license feature is inherited from its parent menuNode.booleanisLocalized()Whether name is localized? If name is not localized, resource bundle will be used to get display name.booleanisLoginRequired()Whether user is required to login before executing the command of this MenuNode?booleanisRenderable()Is the menu node renderable? If this menu node has actionHandler, then delegate toMenuNodeActionHandler.isMenuNodeRenderable(MenuNode).booleanisRoot()Is this menu node the root of its MenuBean.booleanisShowInputDataOnly()Whether to show input data only without showing this menu node.booleanisShowProgress()Whether to show progress while the command is being executed.MenuNoderemoveChild(int position)Remove the child menu node at the positionbooleanremoveChild(MenuNode child)Remove the child menu nodevoidreplaceWith(MenuNode newMenuNode)Replace this menu node in its tree with a new menu node.voidsetActionHandler(MenuNodeActionHandler actionHandler)Set action handler.voidsetActionListener(MenuNodeActionListener actionListener)Set the action listener that will be notified before and after the action of this menu node is handled.voidsetAddSeparatorBefore(boolean addSeparatorBefore)Set whether to add a separator before this menu node.voidsetCaptchaRequired(boolean captchaRequired)Set whether captcha is required to perform the action of this menu node.voidsetChild(int position, MenuNode menuNode)Replace the child menu node at the position with the new menu nodevoidsetClientId(VisitTarget visitTarget, java.lang.String clientId)Set the clientId of this component for the visitTarget.voidsetCommand(java.lang.String command)Set the command of this MenuNode.voidsetConfirmMessage(ParameterizedMessage message)Set confirm dialog message before executing the command of this menu node.voidsetContextMenuBean(MenuNodeContextMenuBean contextMenuBean)Set the context menu of this menu node.voidsetCount(java.lang.Integer count)Set the count that is meaningful and will be shown with the menu node.voidsetCountPartOfParent(boolean countPartOfParent)Set whether the count of this MenuNode is a part of the count of its parent menu node.voidsetDefaultCommand(boolean defaultCommand)Set whether this menu node is the default command in the scope of its closest ancestor component of type EntityBackingBean or EntityListBackingBean.voidsetDisabled(boolean disabled)For command menu node, set it to be disabled or enabledvoidsetEntitySelectionRequired(EntityListBackingBean entityListBackingBean, boolean entitySelectionRequired)Set whether this command is executed on one or more selected entities.voidsetExpanded(boolean expanded)Set whether this menu node is expanded for tree menu.voidsetFactory(MenuNodeFactory factory)Set menu node factory.voidsetFAL(MenuNodeFactory factory, MenuNodeActionHandler actionHandler, MenuNodeLazyInitializer lazyInitializer)Set factory, action handler and initializer.voidsetFALFromParent()Set factory, action handler and initializer from its parent menu node if they are not initialized.voidsetIcon(java.lang.Integer icon)Set icon for commandLink or commandButton.voidsetIcon(java.lang.Integer icon, boolean iconOnly)Set icon and whether to display icon onlyvoidsetIconOnly(boolean iconOnly)Set whether to display an icon only without namevoidsetId(java.lang.String id)Set menu node id that is unique within its MenuBean.voidsetImmediate(boolean immediate)Set whether the action of this menu node will be handled in JSF apply request value phase, skipping model update.voidsetInitialized(boolean initialized)Set whether this menu node is initialized.voidsetInputDataBean(EntityBackingBean inputDataBean)Set the inputDataBean of this MenuNode that is an EntityBackingBean for user to input data for the action.voidsetInputDataDate(java.util.Date inputData)Set the input data single value as DatevoidsetInputDataSingleValue(java.lang.Object value)Set inputData single value.voidsetInputDataString(java.lang.String inputData)Set the input data single value as StringvoidsetLazyInitializer(MenuNodeLazyInitializer lazyInitializer)Set the MenuNodeLazyInitializer that will initialize this menu node and create its child menu nodes(if any) if this menu node is not initialized.voidsetLicenseFeatureRequired(ModuleScopedName licenseFeatureRequired)Set the licenseFeature required to execute the menuNode command.voidsetLoginRequired(boolean loginRequired)Set whether user is required to login before executing the command of this MenuNode.voidsetMenuBean(MenuBean menuBean)Set the MenuBean of this MenuNodevoidsetName(I18NName name)Set menu node namevoidsetName(java.lang.String name, boolean nameLocalized)Set menu node name and whether it is localized.voidsetNameLocalized(boolean nameLocalized)Set whether name is localized.voidsetOnclickJS(java.lang.String onclickJS)Set DOM event handler forDomEventSupport.EVENT_CLICK.voidsetOutputLink(java.lang.String outputLink, boolean addContextPath)Set the output link (hyperlink) for render style: RenderStyle.OUTPUT_LINK.voidsetPageId(java.lang.Integer pageId)Set the page Id for navigation after the action is handledvoidsetParameter(java.lang.String key, java.lang.Object value)Set the value of the parameter.voidsetParent(MenuNode parent)Set parent menu nodevoidsetPartialBehaviorSupport(PartialBehaviorSupport partialBehaviorSupport)Set the partialBehavior support of this menu node.voidsetRenderStyle(RenderStyle renderStyle)Set renderStyle.voidsetShowInputDataOnly(boolean showInputDataOnly)Set whether to show input data only without showing this menu node.voidsetShowProgress(boolean showProgress)Set whether to show progress while the command is being executed.voidsetStyleClass(java.lang.String styleClass)Set menu node style classvoidsetTitle(I18NName title)Set title that is used as tooltip when mouse over.voidsetUserData(java.lang.Object userData)Set user data that can be any object used by action handler.java.lang.StringtoString()voidwalkComponentTree(Component.ComponentVisitor visitor)Walk component tree and call visitor on each visited component.-
Methods inherited from class com.znize.platform.model.bean.Component
existPathToAncestorType, getAuthenticatedUser, getBackingBeanContext, getCalcContext, getChildOfClosestAncestor, getClosestAncestor, getComponentsOnPathTo, getCountryFromCurrentLocale, getCurrencyCode, getCurrentDate, getCurrentLocalDateTime, getDataAccessUnit, getDataConverter, getDisplayValue, getInstanceUser, getLocale, getParameters, getParameters, getPathTo, getPersistenceEntityManager, getPersistenceEntityManager, getPersistenceEntityManager, getPersistenceEntityManager, getQueryHints, getResourceBundle, getRootComponent, getString, getUiView, getUiView, getYearStartDate, isAncestorComponentOf, isEntityI18NEnabled, isInPageContent, setParentComponent, setUiView
-
-
-
-
Constructor Detail
-
MenuNode
public MenuNode(MenuBean menuBean, java.lang.String id)
Constructor- Parameters:
menuBean- the MenuBean of this MenuNodeid- menu node id that is unique within the menuBean
-
MenuNode
public MenuNode(MenuBean menuBean, java.lang.String id, java.lang.String name, boolean nameLocalized)
Label menuNode constructor- Parameters:
menuBean- the MenuBean of this menu nodeid- menu node id that is unique within the menuBeanname- menu node namenameLocalized- if false, translate name for display using resource bundle
-
MenuNode
public MenuNode(MenuBean menuBean, java.lang.String id, java.lang.String name, boolean nameLocalized, java.lang.String outputLink, boolean addContextPath)
Output link menu node constructor- Parameters:
menuBean- the MenuBean of the menu node to createid- menu node id that is unique within the menuBeanname- menu node namenameLocalized- if false, translate name for display using resource bundleoutputLink- absolute URL (http://...) or relative URL starting with /addContextPath- whether to add contextPath. ignored for absolute URLs.
-
MenuNode
public MenuNode(MenuBean menuBean, java.lang.String id, I18NName name, java.lang.String outputLink, boolean addContextPath)
Output link menu node constructor- Parameters:
menuBean- the MenuBean of the menu node to createid- menu node id that is unique within the menuBeanname- menu node nameoutputLink- absolute URL (http://...) or relative URL starting with /addContextPath- whether to add contextPath. ignored for absolute URLs.- Since:
- 5.16
-
MenuNode
public MenuNode(MenuBean menuBean, java.lang.String id, java.lang.String name, boolean nameLocalized, RenderStyle renderStyle)
Command menu node constructor.- Parameters:
menuBean- the MenuBean of the menu node to createid- menu node id that is unique within the menuBeanname- menu node namenameLocalized- if false, translate name for display using resource bundlerenderStyle- menu node RenderStyle
-
MenuNode
public MenuNode(MenuBean menuBean, java.lang.String command, RenderStyle renderStyle)
Command menu node constructor. By default a command menu node is partial behavior enabled, and its execute target is the menu node commandLink or commanButton. Menu node id and name are the same as the command, and name is not localized.- Parameters:
menuBean- the MenuBean of the menu node to createcommand- the command namerenderStyle- menu node RenderStyle
-
MenuNode
public MenuNode(MenuBean menuBean, java.lang.String name, boolean nameLocalized, java.lang.String command, RenderStyle renderStyle)
Command menu node constructor. By default a command menu node is partial behavior enabled, and its execute target is the menu node commandLink or commanButton. Menu node id is the same as the command.- Parameters:
menuBean- the MenuBean of this menu nodename- menu node namenameLocalized- if false, translate name for display using resource bundlecommand- the command namerenderStyle- menu node RenderStyle
-
MenuNode
public MenuNode(MenuBean menuBean, I18NName name, java.lang.String command, RenderStyle renderStyle)
Command menu node constructor. By default a command menu node is partial behavior enabled, and its execute target is the menu node commandLink or commandButton. Menu node id is the same as the command.- Parameters:
menuBean- the MenuBean of this menu nodename- menu node namecommand- the command namerenderStyle- menu node RenderStyle
-
MenuNode
public MenuNode(MenuBean menuBean, java.lang.String name, boolean nameLocalized, java.lang.String command, int defaultStyleNumber)
Command menu node constructor. By default a command menu node is partial behavior enabled, and its execute target is the menu node commandLink or commanButton. Menu node id is the same as the command.- Parameters:
menuBean- the MenuBean of this menu nodename- menu node namenameLocalized- if false, translate name for display using resource bundlecommand- the command namedefaultStyleNumber- the style number for menu node if command style number is not specified in the ViewConfig of its menuBean.
-
MenuNode
public MenuNode(MenuBean menuBean, I18NName name, java.lang.String command, int defaultStyleNumber)
Command menu node constructor. By default a command menu node is partial behavior enabled, and its execute target is the menu node commandLink or commanButton. Menu node id is the same as the command.- Parameters:
menuBean- the MenuBean of this menu nodename- menu node namecommand- the command namedefaultStyleNumber- the style number for menu node if command style number is not specified in the ViewConfig of its menuBean.- Since:
- 5.16
-
MenuNode
public MenuNode(MenuBean menuBean, java.lang.String command, int defaultStyleNumber)
Command menu node constructor. By default a command menu node is partial behavior enabled, and its execute target is the menu node commandLink or commanButton. Menu node id and name are the same as the command, and name is not localized.- Parameters:
menuBean- the MenuBean of this menu nodecommand- the command namedefaultStyleNumber- the style number for menu node if command style number is not specified in the ViewConfig of its menuBean.
-
MenuNode
public MenuNode(MenuBean menuBean, java.lang.String id, java.lang.String name, boolean nameLocalized, java.lang.String command, RenderStyle renderStyle, java.lang.Integer pageId)
Command menu node constructor. By default a command menu node is partial behavior enabled, and its execute target is the menu node commandLink or commanButton.- Parameters:
menuBean- the MenuBean of this menu nodeid- menu node id that is unique within the menuBeanname- menu node namenameLocalized- if false, translate name for display using resource bundlecommand- the command namerenderStyle- menu node RenderStylepageId- the page to navigate to after handling action of this MenuNode
-
MenuNode
public MenuNode(MenuBean menuBean, java.lang.String name, java.lang.String command, RenderStyle renderStyle)
Command menu node constructor. By default a command menu node is partial behavior enabled, and its execute target is the menu node commandLink or commanButton. Menu node id is the same as the command, and name is not localized.- Parameters:
menuBean- the MenuBean of this menu nodename- menu node namecommand- the command namerenderStyle- menu node RenderStyle
-
MenuNode
public MenuNode(MenuBean menuBean, java.lang.String id, java.lang.String name, boolean nameLocalized, java.lang.Integer count, java.lang.String command, java.lang.Object userData, int defaultStyleNumber, java.lang.Integer pageId)
Command menu node constructor. By default a command menu node is partial behavior enabled, and its execute target is the menu node commandLink or commanButton.- Parameters:
menuBean- the MenuBean of this menu nodeid- menu node id that is unique within the menuBeanname- menu node namenameLocalized- if false, translate name for display using resource bundlecount- menu node count valuecommand- the command nameuserData- any data that can be an argument for the commanddefaultStyleNumber- the style number for menu node if command style number is not specified in the ViewConfig of its menuBean.pageId- the page to navigate to after handling action of this MenuNode
-
MenuNode
public MenuNode(MenuBean menuBean, java.lang.String id, java.lang.String name, boolean nameLocalized, java.lang.Integer count, java.lang.String command, java.lang.Object userData, RenderStyle renderStyle, java.lang.Integer pageId)
Command menu node constructor. By default a command menu node is partial behavior enabled, and its execute target is the menu node commandLink or commanButton.- Parameters:
menuBean- the MenuBean of this menu nodeid- menu node id that is unique within the menuBeanname- menu node namenameLocalized- if false, translate name for display using resource bundlecount- menu node count valuecommand- the command nameuserData- any data that can be an argument for the commandrenderStyle- menu node RenderStylepageId- the page to navigate to after handling action of this MenuNode
-
MenuNode
public MenuNode(MenuBean menuBean, java.lang.String id, I18NName name, java.lang.Integer count, java.lang.String command, java.lang.Object userData, RenderStyle renderStyle, java.lang.Integer pageId)
Command menu node constructor. By default a command menu node is partial behavior enabled, and its execute target is the menu node commandLink or commanButton.- Parameters:
menuBean- the MenuBean of this menu nodeid- menu node id that is unique within the menuBeanname- menu node namecount- menu node count valuecommand- the command nameuserData- any data that can be an argument for the commandrenderStyle- menu node RenderStylepageId- the page to navigate to after handling action of this MenuNode- Since:
- 5.16
-
-
Method Detail
-
getLicenseFeatureRequired
public ModuleScopedName getLicenseFeatureRequired()
Get required license feature to execute menuNode command. If licenseFeatureRequired is not set, delegate to parent.- Returns:
- licenseFeature(module.name). return null if not required.
-
isLicenseFeatureInheritted
public boolean isLicenseFeatureInheritted()
Whether required license feature is inherited from its parent menuNode.- Returns:
- true if inherited
-
setLicenseFeatureRequired
public void setLicenseFeatureRequired(ModuleScopedName licenseFeatureRequired)
Set the licenseFeature required to execute the menuNode command. If not required and prevent inheritance from its parent, set to aModuleScopedName(null, null).- Parameters:
licenseFeatureRequired- license feature (module.name)
-
getName
public I18NName getName()
Get menuNode name.- Returns:
- name.
-
setName
public void setName(I18NName name)
Set menu node name- Parameters:
name- the name
-
setName
public void setName(java.lang.String name, boolean nameLocalized)Set menu node name and whether it is localized.- Parameters:
name- node namenameLocalized- whether name is localized- Since:
- 5.13
-
isLocalized
public boolean isLocalized()
Whether name is localized? If name is not localized, resource bundle will be used to get display name.- Returns:
- true if name is localized.
-
setNameLocalized
public void setNameLocalized(boolean nameLocalized)
Set whether name is localized. If name is not localized, resource bundle will be used to get display name.- Parameters:
nameLocalized- true for localized name
-
getDisplayName
public java.lang.String getDisplayName()
Get the display name. If iconOnly is true and icon is not null, return null.- Returns:
- display name
-
getLocalizedName
public java.lang.String getLocalizedName()
Get localized name. If nameLocalized is false, menu node name is translated using resource bundle.- Returns:
- localized name.
-
setIcon
public void setIcon(java.lang.Integer icon)
Set icon for commandLink or commandButton.- Parameters:
icon- icon number that will be mapped to an icon of current view binding. If null, no icon will be defined for this menu node.
-
setIcon
public void setIcon(java.lang.Integer icon, boolean iconOnly)Set icon and whether to display icon only- Parameters:
icon- icon numbericonOnly- true if displaying icon only
-
getIcon
public java.lang.Integer getIcon()
Get icon number.- Returns:
- icon number. return null if no icon is specified.
- Since:
- 6.0
-
isIconOnly
public boolean isIconOnly()
Whether to display an icon only without name?- Returns:
- true if displaying icon only
-
setIconOnly
public void setIconOnly(boolean iconOnly)
Set whether to display an icon only without name- Parameters:
iconOnly- true for displaying icon only
-
isDisabled
public boolean isDisabled()
For command menu node, is it disabled?- Returns:
- true if disabled
-
setDisabled
public void setDisabled(boolean disabled)
For command menu node, set it to be disabled or enabled- Parameters:
disabled- true for disabled
-
getTitle
public java.lang.String getTitle()
Get title that is used as tooltip when mouse over.- Returns:
- title. return null if title is not set and menu node is not iconOnly
-
setTitle
public void setTitle(I18NName title)
Set title that is used as tooltip when mouse over.- Parameters:
title- title- Since:
- 5.13
-
getStyleClass
public java.lang.String getStyleClass()
Get menu node style class- Returns:
- style class
-
setStyleClass
public void setStyleClass(java.lang.String styleClass)
Set menu node style class- Parameters:
styleClass- style class
-
getId
public java.lang.String getId()
Get menu node id that is unique within its MenuBean.- Returns:
- menu node id
-
setId
public void setId(java.lang.String id)
Set menu node id that is unique within its MenuBean.- Parameters:
id- menu node id
-
getRenderStyle
public RenderStyle getRenderStyle()
Get renderStyle. Default is commandLink- Returns:
- render style
-
setRenderStyle
public void setRenderStyle(RenderStyle renderStyle)
Set renderStyle.- Parameters:
renderStyle- render style
-
isLeaf
public boolean isLeaf()
Is menu node a leaf without children?- Returns:
- true if it is a leaf.
-
getChildren
public java.util.List<MenuNode> getChildren()
Get child menu nodes. If menuBean.isContextMenuAsChildren() returns true, children will include its contextMenu top menu nodes.- Returns:
- child menu nodes
-
getActionHandler
public MenuNodeActionHandler getActionHandler()
Get action handler. If the action handler of this menu node is null, delegate to the action handler of its parent menu node.- Returns:
- actionHandler the handler to handle action of this menu node
-
isActionHandlerDelegateToParent
public boolean isActionHandlerDelegateToParent()
Whether the actionHandler of this menu node is null and delegate to its parent.- Returns:
- true if delegating to its parent.
-
setActionHandler
public void setActionHandler(MenuNodeActionHandler actionHandler)
Set action handler. If the action handler of this menu node is null, default to the action handler of its parent menu node.- Parameters:
actionHandler- the action handler to set
-
getActionListener
public MenuNodeActionListener getActionListener()
Get the action listener that will be notified before and after the action of this menu node is handled.- Returns:
- a MenuNodeActionListener, can be null
-
setActionListener
public void setActionListener(MenuNodeActionListener actionListener)
Set the action listener that will be notified before and after the action of this menu node is handled.- Parameters:
actionListener- a MenuNodeActionListener
-
getLazyInitializer
public MenuNodeLazyInitializer getLazyInitializer()
Get the MenuNodeLazyInitializer that will initialize this menu node and create its child menu nodes(if any) if this menu node is not initialized.- Returns:
- the MenuNodeLazyInitializer, can be null.
-
setLazyInitializer
public void setLazyInitializer(MenuNodeLazyInitializer lazyInitializer)
Set the MenuNodeLazyInitializer that will initialize this menu node and create its child menu nodes(if any) if this menu node is not initialized.- Parameters:
lazyInitializer- the MenuNodeLazyInitializer
-
getFactory
public MenuNodeFactory getFactory()
Get menu node factory. If null, same as the the MenuNodeFactory of its parent menu node.- Returns:
- menu node factory, can be null.
-
setFactory
public void setFactory(MenuNodeFactory factory)
Set menu node factory. If null, same as the the MenuNodeFactory of its parent menu node.- Parameters:
factory- the MenuNodeFactory to set
-
setFAL
public void setFAL(MenuNodeFactory factory, MenuNodeActionHandler actionHandler, MenuNodeLazyInitializer lazyInitializer)
Set factory, action handler and initializer.- Parameters:
factory- Menu node factoryactionHandler- action handlerlazyInitializer- lazy initializer
-
setFALFromParent
public void setFALFromParent()
Set factory, action handler and initializer from its parent menu node if they are not initialized. Their getter methods are delegated to its parent menu node. But when a menu node is extracted and inserted into another subtree, its factory, action handler and initializer need to be set.- Since:
- 5.13
-
getContextMenuBean
public MenuNodeContextMenuBean getContextMenuBean()
Get the context menu of this menu node. If context menu is inheritable, it can inherit context menu from its parent menu node.- Returns:
- context menu. can be null.
-
setContextMenuBean
public void setContextMenuBean(MenuNodeContextMenuBean contextMenuBean)
Set the context menu of this menu node. If context menu is inheritable, its descendant children will inherit the context menu- Parameters:
contextMenuBean- context menu
-
getParent
public MenuNode getParent()
Get parent menu node- Returns:
- parent menu node. return null if there is no parent.
-
setParent
public void setParent(MenuNode parent)
Set parent menu node- Parameters:
parent- parent menu node
-
getCommand
public java.lang.String getCommand()
Get the command of this MenuNode.- Returns:
- command name. return null for label or outputLink.
-
setCommand
public void setCommand(java.lang.String command)
Set the command of this MenuNode.- Parameters:
command- the command to set
-
isDefaultCommand
public boolean isDefaultCommand()
Is this menu node the default command in the scope of its closest ancestor component of type EntityBackingBean or EntityListBackingBean. Default command will be invoked if ENTER key is pressed on any input field within the scope.- Returns:
- true if it is the default, false otherwise
-
setDefaultCommand
public void setDefaultCommand(boolean defaultCommand)
Set whether this menu node is the default command in the scope of its closest ancestor component of type EntityBackingBean or EntityListBackingBean. Default command will be invoked if ENTER key is pressed on any input field within the scope.- Parameters:
defaultCommand- true for default command, false otherwise.
-
getCount
public java.lang.Integer getCount()
Get the count that is meaningful and will be shown with the menu node.- Returns:
- a number, return null if not set
-
setCount
public void setCount(java.lang.Integer count)
Set the count that is meaningful and will be shown with the menu node.- Parameters:
count- a number
-
setOnclickJS
public void setOnclickJS(java.lang.String onclickJS)
Set DOM event handler forDomEventSupport.EVENT_CLICK. The handler(javascript code) will be executed when this MenuNode is clicked.- Parameters:
onclickJS- javascript code
-
setConfirmMessage
public void setConfirmMessage(ParameterizedMessage message)
Set confirm dialog message before executing the command of this menu node. If user clicks No or Cancel, the command will not be executed.- Parameters:
message- the message to show. remove existing confirm message if null.- Since:
- 5.5
-
isImmediate
public boolean isImmediate()
Whether the action of this menu node will be handled in JSF apply request value phase, skipping model update.- Returns:
- true if handled in JSF apply request value phase
-
setImmediate
public void setImmediate(boolean immediate)
Set whether the action of this menu node will be handled in JSF apply request value phase, skipping model update.- Parameters:
immediate- true if handled in JSF apply request value phase
-
getUserData
public java.lang.Object getUserData()
Get user data that can be any object used by action handler.- Returns:
- user data
-
setUserData
public void setUserData(java.lang.Object userData)
Set user data that can be any object used by action handler.- Parameters:
userData- any object
-
getOutputLink
public java.lang.String getOutputLink()
Get the output link (hyperlink) for render style: RenderStyle.OUTPUT_LINK.- Returns:
- link URL
-
setOutputLink
public void setOutputLink(java.lang.String outputLink, boolean addContextPath)Set the output link (hyperlink) for render style: RenderStyle.OUTPUT_LINK.- Parameters:
outputLink- absolute URL (http://...) or relative URL starting with /addContextPath- whether to add contextPath. ignored for absolute URLs.
-
getPageId
public java.lang.Integer getPageId()
Get the page Id for navigation after the action is handled- Returns:
- page id such as /myPage.xhtml. null for staying in the same page.
-
setPageId
public void setPageId(java.lang.Integer pageId)
Set the page Id for navigation after the action is handled- Parameters:
pageId- page id
-
click
public java.lang.String click()
Handle menu node action.- Returns:
- navigation outcome. return null for staying in the same page.
-
clickNode
public PageNavigation clickNode(boolean ignoreDialog, boolean ignoreProgress) throws SystemException
Handle menu node action. Check license feature if required.- Parameters:
ignoreDialog- whether to ignore input dialogignoreProgress- whether to ignore progress- Returns:
- a PageNavigation
- Throws:
SystemException- throw if an error occurs when handling the action
-
getDepth
public int getDepth()
Get depth. The root depth is 1.- Returns:
- depth.
-
getDepth
public static int getDepth(MenuNode from, MenuNode to)
Get depth: number of menu nodes in the path- Parameters:
from- start nodeto- end ancestor node- Returns:
- depth
-
getMenuBean
public MenuBean getMenuBean()
Get the MenuBean of this MenuNode- Returns:
- MenuBean instance
-
setMenuBean
public void setMenuBean(MenuBean menuBean)
Set the MenuBean of this MenuNode- Parameters:
menuBean- MenuBean instance
-
addChild
public void addChild(MenuNode menuNode)
Append the child menu node, replacing existing menu node with the same id if any.- Parameters:
menuNode- the child menu node to add
-
getContainerRenderRegions
public PartialBehavior.ContainerRenderRegions getContainerRenderRegions(ContainerBean defaultContainerBean, java.util.List<java.lang.Integer> defaultRenderRegions, boolean create)
Get the ContainerRenderRegions to add action results.ContainerRenderRegions can be defined in current ActionContext or action PartialBehavior. If it is set in current ActionContext, then return it. Otherwise, check action PartialBehavior.
If menu node
RenderStyle.isOpenDialogOnShowResults()is true, a DialogBean will be opened to show the action results.- Parameters:
defaultContainerBean- default containerBean. If null, default containerBean is the ContainerBean of its MenuBean.defaultRenderRegions- default render regionscreate- whether to create one if not defined- Returns:
- ContainerRenderRegions instance. return null if not defined and create is false.
- See Also:
ActionContext.getContainerRenderRegions(),PartialBehavior.getContainerRenderRegions(ContainerBean, List, boolean),RenderStyle.isOpenDialogOnShowResults()
-
addChildren
public void addChildren(java.util.List<MenuNode> menuNodes)
Add the list of the menu nodes as children. Replace existing child menu nodes with the same id(s) if any.- Parameters:
menuNodes- a list of child menu nodes to add
-
addChildren
public void addChildren(java.lang.Integer position, java.util.List<MenuNode> menuNodes)Add the list of the menu nodes as children. Replace existing child menu nodes with the same id(s) if any.- Parameters:
position- zero-based position to add the menu nodes, null to appendmenuNodes- a list of child menu nodes to add
-
addChildren
public void addChildren(java.util.List<MenuNode> menuNodes, MenuNodeFactory factory)
Add the list of the menu nodes as children. Replace existing child menu nodes with the same id(s) if any. Set the default lazyInitializer and actionHandler of the menu nodes to be the factory if the factory is also a MenuNodeLazyInitializer and/or MenuNodeActionHandler.- Parameters:
menuNodes- a list of child menu nodes to addfactory- menu node factory
-
addChild
public void addChild(java.lang.Integer position, MenuNode menuNode)Add child menu node at the position. Replace the menu node with the same id if any. MenuBean.canAddMenuNodeToMenuBean(String, String, MenuBean) will be called to check if the menu node can be added.- Parameters:
position- the index to add menu node, null to appendmenuNode- the child menu node to add- See Also:
MenuBean.canAddMenuNodeToMenuBean(String, String, MenuBean)
-
setChild
public void setChild(int position, MenuNode menuNode)Replace the child menu node at the position with the new menu node- Parameters:
position- the index of menu node to be replacedmenuNode- the new menu node
-
removeChild
public MenuNode removeChild(int position)
Remove the child menu node at the position- Parameters:
position- the index of child menu node to be removed- Returns:
- the menu node removed. null if not found.
-
removeChild
public boolean removeChild(MenuNode child)
Remove the child menu node- Parameters:
child- the child menu node to be removed- Returns:
- true if removed
-
isInitialized
public boolean isInitialized()
Whether this menu node is initialized? If its children has been created, then it is initialized. If false, its LazyInitializer will be called to create its subtree on demand.- Returns:
- true if initialized. default is true.
-
setInitialized
public void setInitialized(boolean initialized)
Set whether this menu node is initialized. If its children has been created, then it is set to be initialized. For lazy initialization, set to false and its LazyInitializer will be called to create its subtree on demand.- Parameters:
initialized- true if initialized
-
init
public void init() throws SystemExceptionInitialize this menu node by adding its children.- Throws:
SystemException- throw if an error occurs in creating descendant menu nodes
-
isRoot
public boolean isRoot()
Is this menu node the root of its MenuBean.- Returns:
- true if it is the root
-
getChild
public MenuNode getChild(int index)
Get the child menu node at the index- Parameters:
index- the index of child menu node to get- Returns:
- child menu node. null if not found or the index is out of range
-
getLastChild
public MenuNode getLastChild()
Get the last child menu node- Returns:
- menu node, null if there is no children.
-
equals
public boolean equals(java.lang.Object menuNode)
- Overrides:
equalsin classjava.lang.Object
-
getChildCount
public int getChildCount()
Get number of children.- Returns:
- child count
- See Also:
getChildren()
-
increaseCount
public void increaseCount(int number)
Increase the count of menu node by the number. The meaning of the count is application specific. For example, the count is the number of entities.- Parameters:
number- the number to increase
-
getNamePathAsString
public java.lang.String getNamePathAsString(int rootNodeDepth, java.lang.String separator)Get the name path from this node to its ancestor of the specified depth for example, A > B > C(this node).- Parameters:
rootNodeDepth- the root node depthseparator- name component separator- Returns:
- name path
-
isLoginRequired
public boolean isLoginRequired()
Whether user is required to login before executing the command of this MenuNode?- Returns:
- true if login is required
-
setLoginRequired
public void setLoginRequired(boolean loginRequired)
Set whether user is required to login before executing the command of this MenuNode.- Parameters:
loginRequired- true if login is required
-
isEntitySelectionRequired
public boolean isEntitySelectionRequired()
Whether this command is executed on one or more selected entities?- Returns:
- true if one or more selected entities are required
-
setEntitySelectionRequired
public void setEntitySelectionRequired(EntityListBackingBean entityListBackingBean, boolean entitySelectionRequired)
Set whether this command is executed on one or more selected entities. if true, the command default execute target will be set to the entityListBackingBean.- Parameters:
entityListBackingBean- entity list backing beanentitySelectionRequired- true if required, or false if not required.
-
isCountPartOfParent
public boolean isCountPartOfParent()
Is the count of this MenuNode a part of the count of its parent menu node? If true, changing the count of this MenuNode will update the count of its parent menu node.- Returns:
- true if the count of this MenuNode is a part of the count of its parent menu node
-
setCountPartOfParent
public void setCountPartOfParent(boolean countPartOfParent)
Set whether the count of this MenuNode is a part of the count of its parent menu node. If true, changing the count of this MenuNode will update the count of its parent menu node.- Parameters:
countPartOfParent- true if the count of this MenuNode is a part of the count of its parent menu node
-
isRenderable
public boolean isRenderable() throws SystemExceptionIs the menu node renderable? If this menu node has actionHandler, then delegate toMenuNodeActionHandler.isMenuNodeRenderable(MenuNode).- Returns:
- true if renderable. default is true.
- Throws:
SystemException- throw if an error occurs
-
replaceWith
public void replaceWith(MenuNode newMenuNode)
Replace this menu node in its tree with a new menu node.- Parameters:
newMenuNode- a new menu node
-
getInputData
public PersistenceEntity getInputData()
Get the input data of this MenuNode.- Returns:
- the entity of inputDataBean. return null if inputDataBean is null.
-
getInputDataBean
public EntityBackingBean getInputDataBean()
Get the inputDataBean of this MenuNode that is an EntityBackingBean for user to input data for the action.- Returns:
- EntityBackingBean instance.
-
setInputDataBean
public void setInputDataBean(EntityBackingBean inputDataBean)
Set the inputDataBean of this MenuNode that is an EntityBackingBean for user to input data for the action.- Parameters:
inputDataBean- EntityBackingBean instance.
-
isShowInputDataOnly
public boolean isShowInputDataOnly()
Whether to show input data only without showing this menu node.- Returns:
- true if showing input data only
-
setShowInputDataOnly
public void setShowInputDataOnly(boolean showInputDataOnly)
Set whether to show input data only without showing this menu node.- Parameters:
showInputDataOnly- true for showing input data only
-
getInputDataValue
public java.lang.Object getInputDataValue(java.lang.String propertyName)
Get the value for the property in the input data that is an entity with a list of properties. if input data is a MapEntity, the propretyName is a key for the mapEntity. otherwise, return null.- Parameters:
propertyName- property name- Returns:
- property value
-
getInputDataEntitySelectScope
public EntityListBackingBean.EntitySelectScope getInputDataEntitySelectScope(EntityListBackingBean.EntitySelectScope defaultScope) throws SystemException
Get the EntitySelectScope of entity list view from the menuNode inputData.- Parameters:
defaultScope- default EntitySelectScope if not exist- Returns:
- entity select scope
- Throws:
SystemException- throw if an error occurs
-
getInputDataSingleValue
public java.lang.Object getInputDataSingleValue()
Get inputData single value. There is only one property for the input data(MapEntity). The input data MapEntity can have many properties to hold many input values.- Returns:
- the single value that can be of any type.
-
setInputDataSingleValue
public void setInputDataSingleValue(java.lang.Object value)
Set inputData single value. There is only one property for the input data that is a MapEntity.- Parameters:
value- the value for input data
-
getInputDataBoolean
public java.lang.Boolean getInputDataBoolean()
Get the input data single value as Boolean- Returns:
- input data single value
-
getInputDataInteger
public java.lang.Integer getInputDataInteger()
Get the input data single value as Integer- Returns:
- input data single value
-
getInputDataString
public java.lang.String getInputDataString()
Get the input data single value as String- Returns:
- input data single value
-
setInputDataString
public void setInputDataString(java.lang.String inputData)
Set the input data single value as String- Parameters:
inputData- input data single value
-
getInputDataDate
public java.util.Date getInputDataDate()
Get the input data single value as Date- Returns:
- input data single value
-
setInputDataDate
public void setInputDataDate(java.util.Date inputData)
Set the input data single value as Date- Parameters:
inputData- input data single value
-
enableContinueCommandForInputDataBean
public void enableContinueCommandForInputDataBean() throws SystemExceptionEnable Continue command for inputDataBean. Call this method before adding input data properties to inputDataBean if the Continue command is needed. The Continue command will invoke the action of this menu node.- Throws:
SystemException- throw if an error occurs- Since:
- 5.20
-
createInputDataMapEntityBean
public <T extends MapEntity> MapEntityBean<T> createInputDataMapEntityBean(ContainerBean containerBean) throws SystemException
Create an inputDataBean that uses MapEntity to store data. A MapEntity can store as many as name/value pairs as needed.The nested viewConfig getNestedViewConfig(boolean, Class) for inputData will be used. If not defined, default viewConfig will be created.
- Parameters:
containerBean- the containerBean of the inputDataBean- Returns:
- MapEntityBean instance
- Throws:
SystemException- throw if an error occurs in creating MapEntityBean
-
createInputDataMapEntityBean
public <T extends MapEntity> MapEntityBean<T> createInputDataMapEntityBean(ContainerBean containerBean, EntityViewConfig viewConfig) throws SystemException
Create an inputDataBean that uses MapEntity to store data. A MapEntity can store as many as name/value pairs as needed.If the viewConfig is null, the nested viewConfig getNestedViewConfig(boolean, Class) for inputData will be used. If not defined, default viewConfig will be created.
- Parameters:
containerBean- the containerBean of the inputDataBeanviewConfig- entity viewConfig that can be null.- Returns:
- MapEntityBean instance
- Throws:
SystemException- throw if an error occurs in creating MapEntityBean
-
addInputDataProperty
public <T extends MapEntity> EntityProperty<T> addInputDataProperty(java.lang.Class propertyType, java.lang.Object propertyValue, PartialBehaviorSupport partialBehaviorSupport, RenderStyle renderStyle, boolean required) throws SystemException
Add the single property to the inputData that is a MapEntity. propertyName is the default inputData single value property name. Its value can be obtained usinggetInputDataSingleValue(). property name is not visible.- Parameters:
propertyType- property typepropertyValue- property valuepartialBehaviorSupport- property partial behavior supportrenderStyle- property render stylerequired- whether property value is required- Returns:
- EntityProperty instance
- Throws:
SystemException- throw if an error occurs
-
addInputDataProperty
public <T extends MapEntity> EntityProperty<T> addInputDataProperty(java.lang.Class propertyType, java.lang.String visibleName, java.lang.Object propertyValue, PartialBehaviorSupport partialBehaviorSupport, RenderStyle renderStyle, boolean required) throws SystemException
Add the single property to the inputData that is a MapEntity. propertyName is the default inputData single value property name. Its value can be obtained usinggetInputDataSingleValue().- Parameters:
propertyType- property typevisibleName- property visible name, not localizedpropertyValue- property valuepartialBehaviorSupport- property partial behavior supportrenderStyle- property render stylerequired- whether property value is required- Returns:
- EntityProperty instance
- Throws:
SystemException- throw if an error occurs
-
addInputDataCollectionProperty
public <T extends MapEntity> EntityCollectionProperty<T> addInputDataCollectionProperty(java.lang.Class propertyType, java.lang.Class memberType, RenderStyle renderStyle, boolean required) throws SystemException
Add the single property(collection type) to the inputData that is a MapEntity. propertyName is the default inputData single value property name. Its value can be obtained usinggetInputDataSingleValue().- Parameters:
propertyType- collection type such as List or Set.memberType- collection member typerenderStyle- property render stylerequired- where the property is required.- Returns:
- added EntityCollectionProperty instance
- Throws:
SystemException- throw if an error occurs
-
addInputDataProperty
public <T extends MapEntity> EntityProperty<T> addInputDataProperty(java.lang.String propertyName, java.lang.Class propertyType, java.lang.Object propertyValue, PartialBehaviorSupport partialBehaviorSupport, RenderStyle renderStyle, boolean required) throws SystemException
Add the property to the inputData that is a MapEntity. create a MapEntityBean as the inputDataBean if inputDataBean is null.- Parameters:
propertyName- property namepropertyType- property typepropertyValue- property valuepartialBehaviorSupport- property partialBehavior supportrenderStyle- property render stylerequired- whether property value is required- Returns:
- EntityProperty instance
- Throws:
SystemException- throw if an error occurs
-
getParameter
public java.lang.Object getParameter(java.lang.String key)
Get the value of the parameter. A menu node has a map of name/value pairs.- Parameters:
key- parameter name- Returns:
- parameter value
-
setParameter
public void setParameter(java.lang.String key, java.lang.Object value)Set the value of the parameter. A menu node has a map of name/value pairs.- Parameters:
key- parameter namevalue- parameter value
-
dialogClosed
public PageNavigation dialogClosed(DialogBean dialogBean, java.lang.Object data) throws SystemException
Description copied from interface:DialogListenercalled when dialog closed (success)- Specified by:
dialogClosedin interfaceDialogListener- Parameters:
dialogBean- dialogBeandata- entity created or selections.- Returns:
- a PageNavigation
- Throws:
SystemException- throw if an error occurs
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
asVisitTarget
public VisitTarget asVisitTarget(boolean subTree)
Create a VisitTarget for this MenuNode. The visit target includes this MenuNode itself and its input data bean.- Parameters:
subTree- whether to include subtree of this menu node.- Returns:
- VisitTarget instance
-
getParentComponent
public Component getParentComponent()
Description copied from class:ComponentGet parent component- Overrides:
getParentComponentin classComponent- Returns:
- parent component. return null if there is no parent.
-
getContainerBean
public ContainerBean getContainerBean()
Description copied from class:ComponentGet containerBean of this component, that is, the closest ancestor component of ContainerBean type.- Overrides:
getContainerBeanin classComponent- Returns:
- containerBean. return null if not exists.
-
isCaptchaRequired
public boolean isCaptchaRequired()
Is captcha required to perform the action of this menu node? A captcha provides a challenge that requires correct response from user, which is used to prevent Bots from performing the action.- Returns:
- true if required
-
setCaptchaRequired
public void setCaptchaRequired(boolean captchaRequired)
Set whether captcha is required to perform the action of this menu node. A captcha provides a challenge that requires correct response from user, which is used to prevent Bots from performing the action.- Parameters:
captchaRequired- true if required
-
isShowProgress
public boolean isShowProgress()
Whether to show progress while the command is being executed.- Returns:
- true for showing progress
-
setShowProgress
public void setShowProgress(boolean showProgress)
Set whether to show progress while the command is being executed.- Parameters:
showProgress- true to show progress
-
getPartialBehaviorSupport
public PartialBehaviorSupport getPartialBehaviorSupport()
Get the ajax support of this menu node.- Specified by:
getPartialBehaviorSupportin interfaceClientBehaviorHolder- Returns:
- PartialBehaviorSupport instance, can be null
-
getPartialBehaviorSupport
public PartialBehaviorSupport getPartialBehaviorSupport(boolean create)
Get the partial behavior support of this menu node.- Parameters:
create- whether to create one if null- Returns:
- PartialBehaviorSupport instance
-
setPartialBehaviorSupport
public void setPartialBehaviorSupport(PartialBehaviorSupport partialBehaviorSupport)
Set the partialBehavior support of this menu node.- Parameters:
partialBehaviorSupport- PartialBehaviorSupport instance
-
getPartialBehavior
public PartialBehavior getPartialBehavior(java.lang.String event, boolean create)
Get the partial behavior for the event.- Parameters:
event- event name that is defined inPartialBehaviorEventcreate- whether to create default partial behavior behavior if not defined. the execute target of default partial behavior is commandLink or commandButton.- Returns:
- the PartialBehavior for the event
-
getActionPartialBehavior
public PartialBehavior getActionPartialBehavior(boolean create)
Get the partial behavior for the action event.- Parameters:
create- whether to create default partial behavior if not defined. the execute target of default partial behavior is commandLink or commandButton.- Returns:
- the PartialBehavior for the action event
-
getDomEventSupport
public DomEventSupport getDomEventSupport()
Description copied from interface:ClientBehaviorHolderDOM event support that is not ajax.- Specified by:
getDomEventSupportin interfaceClientBehaviorHolder- Returns:
- DomEventSupport instance. null if not supported
-
getDomEventSupport
public DomEventSupport getDomEventSupport(boolean create)
Get the DOM vent support of this menu node.- Parameters:
create- whether to create one if null- Returns:
- DomEventSupport instance
-
getDomEventDynamicHandler
public java.lang.String getDomEventDynamicHandler(java.lang.String event) throws SystemExceptionDescription copied from interface:ClientBehaviorHolderGet DOM event dynamic handler that is script, not ajax. The event handler is dynamic and can not be put in DomEventSupport statically.- Specified by:
getDomEventDynamicHandlerin interfaceClientBehaviorHolder- Parameters:
event- dom event name- Returns:
- event handler
- Throws:
SystemException- throw if an error occurs
-
isExpanded
public boolean isExpanded()
Whether this menu node is expanded for tree menu. Default: rootMenuNode is expanded.- Returns:
- true if expanded.
-
setExpanded
public void setExpanded(boolean expanded)
Set whether this menu node is expanded for tree menu.- Parameters:
expanded- true for expanded
-
getClientId
public java.lang.String getClientId(VisitTarget visitTarget)
Description copied from class:ComponentGet the clientId of this component. A component has a clientId while being visited by lifecycle. A component may have more than one visitTarget.- Overrides:
getClientIdin classComponent- Parameters:
visitTarget- a visitTarget of this component- Returns:
- clientId
-
setClientId
public void setClientId(VisitTarget visitTarget, java.lang.String clientId)
Description copied from class:ComponentSet the clientId of this component for the visitTarget. A component may have more than one visitTarget.- Overrides:
setClientIdin classComponent- Parameters:
visitTarget- a visitTarget of this componentclientId- clientId to set
-
getModuleNode
public ModuleNode getModuleNode()
Get the module node for this menu node if this menu node belongs to a module menu. The module node is mapped to a root menu node created by a ModuleMenuNodeFactory, and the root menu node is the closest ancestor of this menu node if any.- Returns:
- ModuleNode instance. return null if not found.
-
getNestedViewConfig
public <T extends ViewConfig> T getNestedViewConfig(boolean command, java.lang.Class<T> viewConfigType)
Get the nested viewConfig for its command or input data bean from the ViewConfig of its MenuBean.The nested viewConfig name: [menuNodeIdentifier]:[command or inputData]. For example, cmd.Create:command for command, id.Create:inputData for inputData bean.
How a nested viewConfig for command is used depends on its action handler.
- Parameters:
command- true for command, false for inputData.viewConfigType- viewConfig type- Returns:
- nested viewConfig. return null if not defined or viewConfig type does not match.
- Since:
- 5.4
-
isAddSeparatorBefore
public boolean isAddSeparatorBefore()
Whether to add a separator before this menu node? Ignored if this menu node is the first menu node among its siblings.- Returns:
- true to add a separator, false otherwise.
- Since:
- 5.5
-
setAddSeparatorBefore
public void setAddSeparatorBefore(boolean addSeparatorBefore)
Set whether to add a separator before this menu node. Ignored if this menu node is the first menu node among its siblings.- Parameters:
addSeparatorBefore- true to add a separator, false otherwise.- Since:
- 5.5
-
getMenuNodeWithPath
public MenuNode getMenuNodeWithPath(java.lang.String menuNodePath)
Get the menu node with the path. The path format is MenuNode1/MenuNode2/... where each component is menu node name (unlocalized). If the path is null, return this menuNode.- Parameters:
menuNodePath- menu node path, e.g MenuNode1/menuNode2- Returns:
- MenuNode instance.
- Throws:
java.lang.IllegalArgumentException- throw if not found- Since:
- 5.13
-
getChildIndex
public int getChildIndex(java.lang.String name)
Get the index of child menu node with the name (unlocalized).- Parameters:
name- child menu node name- Returns:
- zero-based index. return -1 if not found
- Since:
- 5.14
-
walkComponentTree
public void walkComponentTree(Component.ComponentVisitor visitor) throws SystemException
Description copied from class:ComponentWalk component tree and call visitor on each visited component.- Specified by:
walkComponentTreein classComponent- Parameters:
visitor- component visitor- Throws:
SystemException- throw if an error occurs
-
getDataAccessUnit
public DataAccessUnit getDataAccessUnit(boolean returnNullForBoundDataAccessUnit)
Description copied from class:ComponentGet associated DataAccessUnit. If this component has a parent, return parent's DataAccessUnit.- Overrides:
getDataAccessUnitin classComponent- Parameters:
returnNullForBoundDataAccessUnit- whether to return null for current bound dataAccessUnit.- Returns:
- DataAccessUnit instance. return null if it is current bound dataAccessUnit and returnNullForBoundDataAccessUnit is true.
-
-