Package org.primefaces.model.menu
Class DefaultMenuItem
- java.lang.Object
-
- org.primefaces.model.menu.DefaultMenuItem
-
- All Implemented Interfaces:
Serializable
,AjaxSource
,Confirmable
,UIOutcomeTarget
,MenuElement
,MenuItem
public class DefaultMenuItem extends Object implements MenuItem, UIOutcomeTarget, AjaxSource, Serializable
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultMenuItem.Builder
-
Constructor Summary
Constructors Constructor Description DefaultMenuItem()
Creates a new menu item without value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DefaultMenuItem.Builder
builder()
List<javax.faces.component.UIComponent>
getChildren()
String
getClientId()
String
getCommand()
AMethodExpression
in the form of a string which is called after the menu item has been clicked.String
getConfirmationScript()
String
getContainerStyle()
String
getContainerStyleClass()
String
getDelay()
String
getForm()
String
getFragment()
SerializableFunction<MenuItem,String>
getFunction()
Lambda alternative to theMenuItem.getCommand()
.String
getHref()
String
getIcon()
String
getIconPos()
String
getId()
Allows access the id property which is managed and auto-assigned by callers like menu model implementations and used to identify the element.String
getOnclick()
String
getOncomplete()
String
getOnerror()
String
getOnstart()
String
getOnsuccess()
String
getOutcome()
The JSF outcome of a navigation case which is resolved by the configuredNavigationHandler
.Map<String,List<String>>
getParams()
String
getPartialSubmitFilter()
String
getProcess()
String
getRel()
String
getStyle()
String
getStyleClass()
String
getTarget()
int
getTimeout()
String
getTitle()
String
getUpdate()
String
getUrl()
The URL to redirect to after the menu item has been clicked.Object
getValue()
boolean
isAjax()
boolean
isAjaxified()
boolean
isAsync()
boolean
isDisableClientWindow()
boolean
isDisabled()
boolean
isDynamic()
boolean
isEscape()
boolean
isGlobal()
boolean
isIgnoreAutoUpdate()
boolean
isIgnoreComponentNotFound()
boolean
isImmediate()
boolean
isIncludeViewParams()
boolean
isPartialSubmit()
boolean
isPartialSubmitSet()
boolean
isRendered()
boolean
isResetValues()
boolean
isResetValuesSet()
boolean
requiresConfirmation()
void
setAjax(boolean ajax)
void
setAsync(boolean async)
void
setCommand(String command)
void
setConfirmationScript(String confirmationScript)
void
setContainerStyle(String containerStyle)
void
setContainerStyleClass(String containerStyleClass)
void
setDelay(String delay)
void
setDisableClientWindow(boolean disableClientWindow)
void
setDisabled(boolean disabled)
void
setEscape(boolean escape)
void
setForm(String form)
void
setFragment(String fragment)
void
setFunction(SerializableFunction<MenuItem,String> function)
void
setGlobal(boolean global)
void
setHref(String href)
void
setIcon(String icon)
void
setIconPos(String iconPos)
void
setId(String id)
Sets the id property which is described inMenuElement.getId()
.void
setIgnoreAutoUpdate(boolean ignoreAutoUpdate)
void
setIgnoreComponentNotFound(boolean ignoreComponentNotFound)
void
setImmediate(boolean immediate)
void
setIncludeViewParams(boolean includeViewParams)
void
setOnclick(String onclick)
void
setOncomplete(String oncomplete)
void
setOnerror(String onerror)
void
setOnstart(String onstart)
void
setOnsuccess(String onsuccess)
void
setOutcome(String outcome)
void
setParam(String key, Object value)
void
setParams(Map<String,List<String>> params)
void
setPartialSubmit(boolean partialSubmit)
void
setPartialSubmitFilter(String partialSubmitFilter)
void
setProcess(String process)
void
setRel(String rel)
void
setRendered(boolean rendered)
void
setResetValues(boolean resetValues)
void
setStyle(String style)
void
setStyleClass(String styleClass)
void
setTarget(String target)
void
setTimeout(int timeout)
void
setTitle(String title)
void
setUpdate(String update)
void
setUrl(String url)
void
setValue(Object value)
boolean
shouldRenderChildren()
-
-
-
Method Detail
-
getId
public String getId()
Description copied from interface:MenuElement
Allows access the id property which is managed and auto-assigned by callers like menu model implementations and used to identify the element. The property is unrelated to theid
attribute in the generated XHTML.- Specified by:
getId
in interfaceMenuElement
- Returns:
- the id property
-
setId
public void setId(String id)
Description copied from interface:MenuElement
Sets the id property which is described inMenuElement.getId()
. You should have a good reason to call this if you're not extending, but only using PrimeFaces. The property is unrelated to theid
attribute in the generated XHTML.- Specified by:
setId
in interfaceMenuElement
- Parameters:
id
- the id value
-
getIconPos
public String getIconPos()
- Specified by:
getIconPos
in interfaceMenuItem
-
setIconPos
public void setIconPos(String iconPos)
-
setIcon
public void setIcon(String icon)
-
setTitle
public void setTitle(String title)
-
isDisabled
public boolean isDisabled()
- Specified by:
isDisabled
in interfaceMenuItem
-
setDisabled
public void setDisabled(boolean disabled)
-
getOnclick
public String getOnclick()
- Specified by:
getOnclick
in interfaceMenuItem
-
setOnclick
public void setOnclick(String onclick)
-
setStyle
public void setStyle(String style)
-
getStyleClass
public String getStyleClass()
- Specified by:
getStyleClass
in interfaceMenuItem
-
setStyleClass
public void setStyleClass(String styleClass)
- Specified by:
setStyleClass
in interfaceMenuItem
-
getHref
public String getHref()
- Specified by:
getHref
in interfaceUIOutcomeTarget
-
setHref
public void setHref(String href)
-
getUrl
public String getUrl()
Description copied from interface:MenuItem
The URL to redirect to after the menu item has been clicked. Similar tooutcome
which allows to specify a navigation case, but the value is not touched (no prepending of the contextPath, not appending the sessionId or windowId), just encoded. Specifying aurl
which is notnull
causescommand
to be ignored.
-
setUrl
public void setUrl(String url)
-
setTarget
public void setTarget(String target)
-
getOutcome
public String getOutcome()
Description copied from interface:MenuItem
The JSF outcome of a navigation case which is resolved by the configuredNavigationHandler
. Similar tourl
, buturl
allows to specify fully qualified URLs.- Specified by:
getOutcome
in interfaceMenuItem
- Specified by:
getOutcome
in interfaceUIOutcomeTarget
- Returns:
- the outcome.
-
setOutcome
public void setOutcome(String outcome)
-
setAjax
public void setAjax(boolean ajax)
-
setValue
public void setValue(Object value)
-
isIncludeViewParams
public boolean isIncludeViewParams()
- Specified by:
isIncludeViewParams
in interfaceMenuItem
- Specified by:
isIncludeViewParams
in interfaceUIOutcomeTarget
-
setIncludeViewParams
public void setIncludeViewParams(boolean includeViewParams)
-
getFragment
public String getFragment()
- Specified by:
getFragment
in interfaceMenuItem
- Specified by:
getFragment
in interfaceUIOutcomeTarget
-
setFragment
public void setFragment(String fragment)
-
getParams
public Map<String,List<String>> getParams()
- Specified by:
getParams
in interfaceMenuItem
- Specified by:
getParams
in interfaceUIOutcomeTarget
-
shouldRenderChildren
public boolean shouldRenderChildren()
- Specified by:
shouldRenderChildren
in interfaceMenuItem
-
getChildren
public List<javax.faces.component.UIComponent> getChildren()
- Specified by:
getChildren
in interfaceUIOutcomeTarget
-
getCommand
public String getCommand()
Description copied from interface:MenuItem
AMethodExpression
in the form of a string which is called after the menu item has been clicked. It is ignored whenurl
is notnull
.- Specified by:
getCommand
in interfaceMenuItem
- Returns:
- The outcome, which will be used for navigation.
-
setCommand
public void setCommand(String command)
-
getFunction
public SerializableFunction<MenuItem,String> getFunction()
Description copied from interface:MenuItem
Lambda alternative to theMenuItem.getCommand()
.- Specified by:
getFunction
in interfaceMenuItem
- Returns:
- The outcome, which will be used for navigation.
-
setFunction
public void setFunction(SerializableFunction<MenuItem,String> function)
-
isRendered
public boolean isRendered()
- Specified by:
isRendered
in interfaceMenuElement
-
setRendered
public void setRendered(boolean rendered)
-
getOnstart
public String getOnstart()
- Specified by:
getOnstart
in interfaceAjaxSource
-
setOnstart
public void setOnstart(String onstart)
-
getOnerror
public String getOnerror()
- Specified by:
getOnerror
in interfaceAjaxSource
-
setOnerror
public void setOnerror(String onerror)
-
getOnsuccess
public String getOnsuccess()
- Specified by:
getOnsuccess
in interfaceAjaxSource
-
setOnsuccess
public void setOnsuccess(String onsuccess)
-
getOncomplete
public String getOncomplete()
- Specified by:
getOncomplete
in interfaceAjaxSource
-
setOncomplete
public void setOncomplete(String oncomplete)
-
getUpdate
public String getUpdate()
- Specified by:
getUpdate
in interfaceAjaxSource
-
setUpdate
public void setUpdate(String update)
-
getProcess
public String getProcess()
- Specified by:
getProcess
in interfaceAjaxSource
-
setProcess
public void setProcess(String process)
-
isPartialSubmit
public boolean isPartialSubmit()
- Specified by:
isPartialSubmit
in interfaceAjaxSource
-
setPartialSubmit
public void setPartialSubmit(boolean partialSubmit)
-
isResetValues
public boolean isResetValues()
- Specified by:
isResetValues
in interfaceAjaxSource
-
setResetValues
public void setResetValues(boolean resetValues)
-
isGlobal
public boolean isGlobal()
- Specified by:
isGlobal
in interfaceAjaxSource
-
setGlobal
public void setGlobal(boolean global)
-
isAsync
public boolean isAsync()
- Specified by:
isAsync
in interfaceAjaxSource
-
setAsync
public void setAsync(boolean async)
-
isPartialSubmitSet
public boolean isPartialSubmitSet()
- Specified by:
isPartialSubmitSet
in interfaceAjaxSource
-
isResetValuesSet
public boolean isResetValuesSet()
- Specified by:
isResetValuesSet
in interfaceAjaxSource
-
isIgnoreAutoUpdate
public boolean isIgnoreAutoUpdate()
- Specified by:
isIgnoreAutoUpdate
in interfaceAjaxSource
-
setIgnoreAutoUpdate
public void setIgnoreAutoUpdate(boolean ignoreAutoUpdate)
-
isImmediate
public boolean isImmediate()
- Specified by:
isImmediate
in interfaceMenuItem
-
setImmediate
public void setImmediate(boolean immediate)
-
isAjaxified
public boolean isAjaxified()
- Specified by:
isAjaxified
in interfaceAjaxSource
-
getDelay
public String getDelay()
- Specified by:
getDelay
in interfaceAjaxSource
-
setDelay
public void setDelay(String delay)
-
isDisableClientWindow
public boolean isDisableClientWindow()
- Specified by:
isDisableClientWindow
in interfaceUIOutcomeTarget
-
setDisableClientWindow
public void setDisableClientWindow(boolean disableClientWindow)
-
getContainerStyle
public String getContainerStyle()
- Specified by:
getContainerStyle
in interfaceMenuItem
-
setContainerStyle
public void setContainerStyle(String containerStyle)
-
getContainerStyleClass
public String getContainerStyleClass()
- Specified by:
getContainerStyleClass
in interfaceMenuItem
-
setContainerStyleClass
public void setContainerStyleClass(String containerStyleClass)
-
getClientId
public String getClientId()
- Specified by:
getClientId
in interfaceMenuItem
-
getTimeout
public int getTimeout()
- Specified by:
getTimeout
in interfaceAjaxSource
-
setTimeout
public void setTimeout(int timeout)
-
getPartialSubmitFilter
public String getPartialSubmitFilter()
- Specified by:
getPartialSubmitFilter
in interfaceAjaxSource
-
setPartialSubmitFilter
public void setPartialSubmitFilter(String partialSubmitFilter)
-
getForm
public String getForm()
- Specified by:
getForm
in interfaceAjaxSource
-
setForm
public void setForm(String form)
-
getConfirmationScript
public String getConfirmationScript()
- Specified by:
getConfirmationScript
in interfaceConfirmable
-
setConfirmationScript
public void setConfirmationScript(String confirmationScript)
- Specified by:
setConfirmationScript
in interfaceConfirmable
-
requiresConfirmation
public boolean requiresConfirmation()
- Specified by:
requiresConfirmation
in interfaceConfirmable
-
setEscape
public void setEscape(boolean escape)
-
setRel
public void setRel(String rel)
-
isIgnoreComponentNotFound
public boolean isIgnoreComponentNotFound()
- Specified by:
isIgnoreComponentNotFound
in interfaceAjaxSource
-
setIgnoreComponentNotFound
public void setIgnoreComponentNotFound(boolean ignoreComponentNotFound)
-
builder
public static DefaultMenuItem.Builder builder()
-
-