com.infragistics.faces.menu.component
Class MenuItemCheckmark

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
                  extended bycom.infragistics.faces.menu.component.MenuItemCheckmark
All Implemented Interfaces:
javax.faces.component.ActionSource, javax.faces.component.NamingContainer, javax.faces.component.StateHolder, javax.faces.component.ValueHolder
Direct Known Subclasses:
HtmlMenuItemCheckmark

public class MenuItemCheckmark
extends MenuItem

Extends regular menu item to support checkmarks and/or radio buttons.

Checkmark or radio button
By default MenuItemCheckmarks behave as checkmarks. However, they can also behave as radioButtons by calling setRadioButton(true).

Grouped items
Menu items can be grouped together by calling setGroupName(java.lang.String) so that only one item is selectable at a time.


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
MenuItemCheckmark()
           
 
Method Summary
 java.lang.String getFamily()
           
 java.lang.String getGroupName()
          Return the name of the group this item belongs to
 java.util.Iterator getOtherItemsInGroup()
          Returns an iterator of menu items which belong to the same group The collection returned doesn't not contain the current item
 boolean isChecked()
          Returns true whenever the item is checked, false otherwise
 boolean isRadioButton()
          Returns true if the item is displayed as a radio button
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setChecked(boolean checked)
          Sets the checked property as follow: if the item is a radio buton then if the value of the checked parameter iquals true then uncheck the previously checked radio button otherwise set the checked property
 void setGroupName(java.lang.String groupName)
          Sets the name of the group this item belongs to
 void setRadioButton(boolean isRadioButton)
          Sets a flag which indicates if an item is displayed as a radio button
 
Methods inherited from class com.infragistics.faces.menu.component.MenuItem
addActionListener, broadcast, getAction, getActionListener, getActionListeners, getConverter, getHoverIconUrl, getIconUrl, getLocalValue, getMenu, getShortcut, getSiblings, getTooltip, getValue, isDisabled, isImmediate, isRoot, queueEvent, removeActionListener, setAction, setActionListener, setConverter, setDisabled, setHoverIconUrl, setIconUrl, setImmediate, setShortcut, setTooltip, setValue
 
Methods inherited from class com.infragistics.faces.shared.component.DataRepeater
dataBind, encodeBegin, encodeEnd, getDataKeyName, getDataKeyValue, getDataSource, getTemplateItems, processUpdates, processValidators, 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

MenuItemCheckmark

public MenuItemCheckmark()
Method Detail

getFamily

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

getGroupName

public java.lang.String getGroupName()
Return the name of the group this item belongs to

Returns:
the group name

getOtherItemsInGroup

public java.util.Iterator getOtherItemsInGroup()
Returns an iterator of menu items which belong to the same group The collection returned doesn't not contain the current item

Returns:
Iterator

isChecked

public boolean isChecked()
Returns true whenever the item is checked, false otherwise

Returns:
true || false

isRadioButton

public boolean isRadioButton()
Returns true if the item is displayed as a radio button

Returns:
true || false

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 MenuItem

saveState

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

setChecked

public void setChecked(boolean checked)
Sets the checked property as follow: if the item is a radio buton then if the value of the checked parameter iquals true then uncheck the previously checked radio button otherwise set the checked property

Parameters:
checked -

setGroupName

public void setGroupName(java.lang.String groupName)
Sets the name of the group this item belongs to

Parameters:
groupName -

setRadioButton

public void setRadioButton(boolean isRadioButton)
Sets a flag which indicates if an item is displayed as a radio button

Parameters:
isRadioButton -