com.infragistics.faces.menu.component
Class MenuItem

java.lang.Object
  extended byjavax.faces.component.UIComponent
      extended byjavax.faces.component.UIComponentBase
          extended bycom.infragistics.faces.shared.component.DataRepeater
              extended bycom.infragistics.faces.menu.component.MenuItem
All Implemented Interfaces:
javax.faces.component.ActionSource, javax.faces.component.NamingContainer, javax.faces.component.StateHolder, javax.faces.component.ValueHolder
Direct Known Subclasses:
HtmlMenuItem, MenuItemCheckmark

public class MenuItem
extends DataRepeater
implements javax.faces.component.ActionSource, javax.faces.component.ValueHolder

Represents an individual menu item and defines the following basics functionalities :

Bound and unbound mode
Just like menus, menu items supports bound as well as unbound mode. In unbound mode, menu items are created declaratively (in a JSP page) or added programmatically.
In bound mode (whenever the dataSource property points to a valid data model of a backing bean) menu items are automatically created, one node for each row of the data model.

Look and Feel
An icon can also be displayed next to a menu item by calling setIconUrl(String) and setHoverIconUrl(String).
Emits ActionEvent whenever clicked-on


Field Summary
static java.lang.String COMPONENT_FAMILY
           
static java.lang.String COMPONENT_TYPE
           
static java.lang.String RENDERER_TYPE
           
 
Fields inherited from class com.infragistics.faces.shared.component.DataRepeater
DATA_ROW
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
MenuItem()
           
 
Method Summary
 void addActionListener(javax.faces.event.ActionListener listener)
           
 void broadcast(javax.faces.event.FacesEvent event)
           
 javax.faces.el.MethodBinding getAction()
           
 javax.faces.el.MethodBinding getActionListener()
           
 javax.faces.event.ActionListener[] getActionListeners()
           
 javax.faces.convert.Converter getConverter()
           
 java.lang.String getFamily()
           
 java.lang.String getHoverIconUrl()
          Returns the URL for image displayed when the mouse is moves over the item
 java.lang.String getIconUrl()
          Returns the URL for image displayed by default in the item
 java.lang.Object getLocalValue()
           
 Menu getMenu()
          Returns the Menu this item belongs to
 java.lang.String getShortcut()
          Returns the shortcut key associated with this menu item.
 java.util.List getSiblings()
          Returns a list of all siblings nodes
 java.lang.String getTooltip()
          Returns the tooltip that is displayed
 java.lang.Object getValue()
           
 boolean isDisabled()
          Returns the state of this node: true if disabled, false otherwise
 boolean isImmediate()
           
 boolean isRoot()
          Returns whether this is a root node or not.
 void queueEvent(javax.faces.event.FacesEvent event)
           
 void removeActionListener(javax.faces.event.ActionListener listener)
           
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setAction(javax.faces.el.MethodBinding action)
           
 void setActionListener(javax.faces.el.MethodBinding actionListener)
           
 void setConverter(javax.faces.convert.Converter converter)
           
 void setDisabled(boolean disabled)
          Sets the state of this node: true if disabled, false otherwise
 void setHoverIconUrl(java.lang.String hoverIconUrl)
          Sets the URL for image displayed when the mouse is moves over the item
 void setIconUrl(java.lang.String iconUrl)
          Sets the URL for image displayed by default in the item
 void setImmediate(boolean immediate)
           
 void setShortcut(java.lang.String shortcut)
          Sets the shortcut key associated with this menu item
 void setTooltip(java.lang.String tooltip)
          Sets the tooltip that is displayed
 void setValue(java.lang.Object value)
           
 
Methods inherited from class com.infragistics.faces.shared.component.DataRepeater
dataBind, encodeBegin, encodeEnd, export, getDataKeyName, getDataKeyValue, getDataSource, getTemplateItems, popDataRow, processUpdates, processValidators, pushDataRow, setDataKeyName, setDataSource, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponentBase
decode, encodeChildren, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPONENT_FAMILY

public static java.lang.String COMPONENT_FAMILY

COMPONENT_TYPE

public static java.lang.String COMPONENT_TYPE

RENDERER_TYPE

public static java.lang.String RENDERER_TYPE
Constructor Detail

MenuItem

public MenuItem()
Method Detail

addActionListener

public void addActionListener(javax.faces.event.ActionListener listener)
Specified by:
addActionListener in interface javax.faces.component.ActionSource

broadcast

public void broadcast(javax.faces.event.FacesEvent event)
               throws javax.faces.event.AbortProcessingException
Overrides:
broadcast in class DataRepeater
Throws:
javax.faces.event.AbortProcessingException

getAction

public javax.faces.el.MethodBinding getAction()
Specified by:
getAction in interface javax.faces.component.ActionSource

getActionListener

public javax.faces.el.MethodBinding getActionListener()
Specified by:
getActionListener in interface javax.faces.component.ActionSource

getActionListeners

public javax.faces.event.ActionListener[] getActionListeners()
Specified by:
getActionListeners in interface javax.faces.component.ActionSource

getConverter

public javax.faces.convert.Converter getConverter()
Specified by:
getConverter in interface javax.faces.component.ValueHolder

getFamily

public java.lang.String getFamily()
Overrides:
getFamily in class DataRepeater

getLocalValue

public java.lang.Object getLocalValue()
Specified by:
getLocalValue in interface javax.faces.component.ValueHolder

getMenu

public Menu getMenu()
Returns the Menu this item belongs to

Returns:
the parent menu

getShortcut

public java.lang.String getShortcut()
Returns the shortcut key associated with this menu item.

Returns:
Returns the shortcut.

getSiblings

public java.util.List getSiblings()
Returns a list of all siblings nodes

Returns:
siblings items

getTooltip

public java.lang.String getTooltip()
Returns the tooltip that is displayed

Returns:
Returns the tooltip.

getValue

public java.lang.Object getValue()
Specified by:
getValue in interface javax.faces.component.ValueHolder

isDisabled

public boolean isDisabled()
Returns the state of this node: true if disabled, false otherwise

Returns:
true || false

getHoverIconUrl

public java.lang.String getHoverIconUrl()
Returns the URL for image displayed when the mouse is moves over the item

Returns:
java.lang.String

getIconUrl

public java.lang.String getIconUrl()
Returns the URL for image displayed by default in the item

Returns:
java.lang.String

isImmediate

public boolean isImmediate()
Specified by:
isImmediate in interface javax.faces.component.ActionSource

isRoot

public boolean isRoot()
Returns whether this is a root node or not. A root node is always nested inside a menu.

Returns:
true || false

queueEvent

public void queueEvent(javax.faces.event.FacesEvent event)
Overrides:
queueEvent in class DataRepeater

removeActionListener

public void removeActionListener(javax.faces.event.ActionListener listener)
Specified by:
removeActionListener in interface javax.faces.component.ActionSource

restoreState

public void restoreState(javax.faces.context.FacesContext context,
                         java.lang.Object state)
Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class DataRepeater

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext context)
Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class DataRepeater

setAction

public void setAction(javax.faces.el.MethodBinding action)
Specified by:
setAction in interface javax.faces.component.ActionSource

setActionListener

public void setActionListener(javax.faces.el.MethodBinding actionListener)
Specified by:
setActionListener in interface javax.faces.component.ActionSource

setConverter

public void setConverter(javax.faces.convert.Converter converter)
Specified by:
setConverter in interface javax.faces.component.ValueHolder

setDisabled

public void setDisabled(boolean disabled)
Sets the state of this node: true if disabled, false otherwise

Parameters:
disabled -

setHoverIconUrl

public void setHoverIconUrl(java.lang.String hoverIconUrl)
Sets the URL for image displayed when the mouse is moves over the item

Parameters:
hoverIconUrl - String

setIconUrl

public void setIconUrl(java.lang.String iconUrl)
Sets the URL for image displayed by default in the item

Parameters:
iconUrl - String

setImmediate

public void setImmediate(boolean immediate)
Specified by:
setImmediate in interface javax.faces.component.ActionSource

setShortcut

public void setShortcut(java.lang.String shortcut)
Sets the shortcut key associated with this menu item

Parameters:
shortcut - The shortcut to set.

setTooltip

public void setTooltip(java.lang.String tooltip)
Sets the tooltip that is displayed

Parameters:
tooltip - The tooltip to set.

setValue

public void setValue(java.lang.Object value)
Specified by:
setValue in interface javax.faces.component.ValueHolder