org.rcfaces.core.component
Class MenuComponent

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UIOutput
              extended by javax.faces.component.UIInput
                  extended by javax.faces.component.UISelectMany
                      extended by org.rcfaces.core.internal.component.CameliaSelectManyComponent
                          extended by org.rcfaces.core.component.MenuComponent
All Implemented Interfaces:
EditableValueHolder, StateHolder, ValueHolder, ICheckedValuesCapability, ICheckEventCapability, IMenuEventCapability, IPreloadedLevelDepthCapability, ISelectionEventCapability, IMenuComponent, org.rcfaces.core.internal.capability.ICheckComponent, org.rcfaces.core.internal.capability.IComponentLifeCycle, org.rcfaces.core.internal.capability.IConvertValueHolder, org.rcfaces.core.internal.capability.IRCFacesComponent, org.rcfaces.core.internal.manager.IContainerManager, org.rcfaces.core.internal.manager.ITransientAttributesManager, org.rcfaces.core.internal.tools.CollectionTools.IComponentValueTypeCapability, ICheckProvider

public class MenuComponent
extends org.rcfaces.core.internal.component.CameliaSelectManyComponent
implements IPreloadedLevelDepthCapability, IMenuEventCapability, ISelectionEventCapability, ICheckEventCapability, ICheckedValuesCapability, org.rcfaces.core.internal.capability.ICheckComponent, IMenuComponent, org.rcfaces.core.internal.tools.CollectionTools.IComponentValueTypeCapability

The menu Component provides a way of creating desktop style menus on web pages. It allows sub-menus, check and radio menu items and image menus. It also provides pop-up menus.

The menu Component has the following capabilities :

The default menu renderer is linked to the f_menu javascript class. f_menu extends f_menuBase

Table of component style classes:

Style Name Description
f_menu Defines styles for the wrapper UL element. Coantains f_grid_popup and f_menu_item styles


Field Summary
protected static Set CAMELIA_ATTRIBUTES
           
static String COMPONENT_TYPE
           
 
Fields inherited from class org.rcfaces.core.internal.component.CameliaSelectManyComponent
engine
 
Fields inherited from class javax.faces.component.UISelectMany
COMPONENT_FAMILY, INVALID_MESSAGE_ID
 
Fields inherited from class javax.faces.component.UIInput
CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID
 
Fields inherited from class javax.faces.component.UIComponent
bindings
 
Constructor Summary
MenuComponent()
           
MenuComponent(String componentId)
           
 
Method Summary
 void addCheckListener(ICheckListener listener)
          Adds a listener to the component for the checked event
 void addMenuListener(IMenuListener listener)
          Adds a listener to the component for the menu event
 void addSelectionListener(ISelectionListener listener)
          Adds a listener to the component for the selection event
 void check(Object value)
           
 void checkAll()
           
protected  Set getCameliaFields()
           
 Object getCheckedValues()
           
 Object getCheckedValues(FacesContext facesContext)
          See getCheckedValues() for more details
 int getCheckedValuesCount()
           
 Class getCheckedValuesType(FacesContext facesContext)
          Return the type of the property represented by the ValueExpression, relative to the specified FacesContext.
 org.rcfaces.core.internal.tools.CollectionTools.IComponentValueType getComponentValueType()
           
 Object getFirstCheckedValue()
           
 String getMenuId()
          Returns an id used to retreive a specific menu.
 String getMenuId(FacesContext facesContext)
          Returns an id used to retreive a specific menu.
 int getPreloadedLevelDepth()
           
 int getPreloadedLevelDepth(FacesContext facesContext)
          See getPreloadedLevelDepth() for more details
 boolean isCheckedValuesSetted()
          Returns true if the attribute "checkedValues" is set.
 boolean isMenuIdSetted()
          Returns true if the attribute "menuId" is set.
 boolean isPreloadedLevelDepthSetted()
          Returns true if the attribute "preloadedLevelDepth" is set.
 boolean isRemoveAllWhenShown()
          Returns a boolean value specifying wether the content of the component must be remove before the listener is called and the component displayed.
 boolean isRemoveAllWhenShown(FacesContext facesContext)
          Returns a boolean value specifying wether the content of the component must be remove before the listener is called and the component displayed.
 boolean isRemoveAllWhenShownSetted()
          Returns true if the attribute "removeAllWhenShown" is set.
 Object[] listCheckedValues()
           
 FacesListener[] listCheckListeners()
          Returns the list of check listener for the component
 IMenuItemIterator listMenuItems()
           
 FacesListener[] listMenuListeners()
          Returns a list of menu listener for the component
 FacesListener[] listSelectionListeners()
          Returns a list of selection listener for the component
 void removeCheckListener(ICheckListener listener)
          Removes a listener from the list of listeners
 void removeMenuListener(IMenuListener listener)
          Removes a listener from the component for the menu event
 void removeSelectionListener(ISelectionListener listener)
          Removes a listener from the component for the selection event
 void setCheckedValues(Object checkedValues)
           
 void setMenuId(String menuId)
          Sets an id used to retreive a specific menu.
 void setPreloadedLevelDepth(int preloadedLevelDepth)
           
 void setRemoveAllWhenShown(boolean removeAllWhenShown)
          Sets a boolean value specifying wether the content of the component must be remove before the listener is called and the component displayed.
 void uncheck(Object value)
           
 void uncheckAll()
           
 
Methods inherited from class org.rcfaces.core.internal.component.CameliaSelectManyComponent
clearListeners, confirmListenerAppend, constructPhase, constructTemplate, decodePhase, encodeBegin, encodeChildren, encodeEnd, getAsyncRenderer, getCameliaValueAlias, getChildren, getChildrenListState, getFamily, getRendererType, getTransientAttribute, getValueExpression, hasDefaultProperties, initializeComponent, initializePhase, isClientRendered, isRendered, isTemplateComponent, processDecodes, processEngineUpdates, processEngineValidators, processUpdates, processValidators, queueEvent, renderPhase, restoreState, saveState, setConverter, setConverter, setDefaultProperties, setRendered, setTransientAttribute, setValueExpression, toString, updatePhase, validationPhase, verifyAsyncDecode
 
Methods inherited from class javax.faces.component.UISelectMany
compareValues, getSelectedValues, getValueBinding, setSelectedValues, setValueBinding, validateValue
 
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, decode, getConvertedValue, getConverterMessage, getRequiredMessage, getSubmittedValue, getValidator, getValidatorMessage, getValidators, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, removeValidator, removeValueChangeListener, resetValue, setConverterMessage, setImmediate, setLocalValueSet, setRequired, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, updateModel, validate
 
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, getValue, setConverter
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, findComponent, getAttributes, getChildCount, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendersChildren, invokeOnComponent, isTransient, processRestoreState, processSaveState, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.rcfaces.core.internal.manager.IContainerManager
getChildCount
 
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, getValue, setConverter, setValue
 

Field Detail

COMPONENT_TYPE

public static final String COMPONENT_TYPE
See Also:
Constant Field Values

CAMELIA_ATTRIBUTES

protected static final Set CAMELIA_ATTRIBUTES
Constructor Detail

MenuComponent

public MenuComponent()

MenuComponent

public MenuComponent(String componentId)
Method Detail

listMenuItems

public IMenuItemIterator listMenuItems()
Specified by:
listMenuItems in interface IMenuComponent

getComponentValueType

public org.rcfaces.core.internal.tools.CollectionTools.IComponentValueType getComponentValueType()
Specified by:
getComponentValueType in interface org.rcfaces.core.internal.tools.CollectionTools.IComponentValueTypeCapability

check

public void check(Object value)
Specified by:
check in interface org.rcfaces.core.internal.capability.ICheckComponent

checkAll

public void checkAll()
Specified by:
checkAll in interface org.rcfaces.core.internal.capability.ICheckComponent

uncheck

public void uncheck(Object value)
Specified by:
uncheck in interface org.rcfaces.core.internal.capability.ICheckComponent

uncheckAll

public void uncheckAll()
Specified by:
uncheckAll in interface org.rcfaces.core.internal.capability.ICheckComponent

getPreloadedLevelDepth

public int getPreloadedLevelDepth()
Specified by:
getPreloadedLevelDepth in interface IPreloadedLevelDepthCapability

getPreloadedLevelDepth

public int getPreloadedLevelDepth(FacesContext facesContext)
See getPreloadedLevelDepth() for more details


isPreloadedLevelDepthSetted

public final boolean isPreloadedLevelDepthSetted()
Returns true if the attribute "preloadedLevelDepth" is set.

Returns:
true if the attribute is set.

setPreloadedLevelDepth

public void setPreloadedLevelDepth(int preloadedLevelDepth)
Specified by:
setPreloadedLevelDepth in interface IPreloadedLevelDepthCapability

addMenuListener

public final void addMenuListener(IMenuListener listener)
Description copied from interface: IMenuEventCapability
Adds a listener to the component for the menu event

Specified by:
addMenuListener in interface IMenuEventCapability
Parameters:
listener - the menu listener to add

removeMenuListener

public final void removeMenuListener(IMenuListener listener)
Description copied from interface: IMenuEventCapability
Removes a listener from the component for the menu event

Specified by:
removeMenuListener in interface IMenuEventCapability
Parameters:
listener - the menu listener to remove

listMenuListeners

public final FacesListener[] listMenuListeners()
Description copied from interface: IMenuEventCapability
Returns a list of menu listener for the component

Specified by:
listMenuListeners in interface IMenuEventCapability
Returns:
menu listeners' list

addSelectionListener

public final void addSelectionListener(ISelectionListener listener)
Description copied from interface: ISelectionEventCapability
Adds a listener to the component for the selection event

Specified by:
addSelectionListener in interface ISelectionEventCapability
Parameters:
listener - the selection listener to add

removeSelectionListener

public final void removeSelectionListener(ISelectionListener listener)
Description copied from interface: ISelectionEventCapability
Removes a listener from the component for the selection event

Specified by:
removeSelectionListener in interface ISelectionEventCapability
Parameters:
listener - the selection listener to remove

listSelectionListeners

public final FacesListener[] listSelectionListeners()
Description copied from interface: ISelectionEventCapability
Returns a list of selection listener for the component

Specified by:
listSelectionListeners in interface ISelectionEventCapability
Returns:
selection listeners' list

addCheckListener

public final void addCheckListener(ICheckListener listener)
Description copied from interface: ICheckEventCapability
Adds a listener to the component for the checked event

Specified by:
addCheckListener in interface ICheckEventCapability
Parameters:
listener - the listener to add

removeCheckListener

public final void removeCheckListener(ICheckListener listener)
Description copied from interface: ICheckEventCapability
Removes a listener from the list of listeners

Specified by:
removeCheckListener in interface ICheckEventCapability
Parameters:
listener - the listener to remove

listCheckListeners

public final FacesListener[] listCheckListeners()
Description copied from interface: ICheckEventCapability
Returns the list of check listener for the component

Specified by:
listCheckListeners in interface ICheckEventCapability
Returns:
check listeners' list

getCheckedValues

public Object getCheckedValues()
Specified by:
getCheckedValues in interface ICheckProvider

getCheckedValues

public Object getCheckedValues(FacesContext facesContext)
See getCheckedValues() for more details


isCheckedValuesSetted

public final boolean isCheckedValuesSetted()
Returns true if the attribute "checkedValues" is set.

Returns:
true if the attribute is set.

setCheckedValues

public void setCheckedValues(Object checkedValues)
Specified by:
setCheckedValues in interface ICheckProvider

getCheckedValuesType

public Class getCheckedValuesType(FacesContext facesContext)
Return the type of the property represented by the ValueExpression, relative to the specified FacesContext.

Specified by:
getCheckedValuesType in interface ICheckedValuesCapability

getFirstCheckedValue

public Object getFirstCheckedValue()
Specified by:
getFirstCheckedValue in interface ICheckProvider

getCheckedValuesCount

public int getCheckedValuesCount()
Specified by:
getCheckedValuesCount in interface ICheckProvider

listCheckedValues

public Object[] listCheckedValues()
Specified by:
listCheckedValues in interface ICheckProvider

getMenuId

public String getMenuId()
Returns an id used to retreive a specific menu. For example, "#node" is used to call a menu on a tree node while "#body" is used for the menu boody.

Returns:
menu Id

getMenuId

public String getMenuId(FacesContext facesContext)
Returns an id used to retreive a specific menu. For example, "#node" is used to call a menu on a tree node while "#body" is used for the menu boody.

Returns:
menu Id

setMenuId

public void setMenuId(String menuId)
Sets an id used to retreive a specific menu. For example, "#node" is used to call a menu on a tree node while "#body" is used for the menu boody.

Parameters:
menuId - menu Id

isMenuIdSetted

public boolean isMenuIdSetted()
Returns true if the attribute "menuId" is set.

Returns:
true if the attribute is set.

isRemoveAllWhenShown

public boolean isRemoveAllWhenShown()
Returns a boolean value specifying wether the content of the component must be remove before the listener is called and the component displayed.

Specified by:
isRemoveAllWhenShown in interface IMenuComponent
Returns:
true if content is removed when shown

isRemoveAllWhenShown

public boolean isRemoveAllWhenShown(FacesContext facesContext)
Returns a boolean value specifying wether the content of the component must be remove before the listener is called and the component displayed.

Returns:
true if content is removed when shown

setRemoveAllWhenShown

public void setRemoveAllWhenShown(boolean removeAllWhenShown)
Sets a boolean value specifying wether the content of the component must be remove before the listener is called and the component displayed.

Specified by:
setRemoveAllWhenShown in interface IMenuComponent
Parameters:
removeAllWhenShown - true if content is to be removed when shown

isRemoveAllWhenShownSetted

public boolean isRemoveAllWhenShownSetted()
Returns true if the attribute "removeAllWhenShown" is set.

Returns:
true if the attribute is set.

getCameliaFields

protected Set getCameliaFields()
Overrides:
getCameliaFields in class org.rcfaces.core.internal.component.CameliaSelectManyComponent


Copyright © 2006-2011 Vedana. All Rights Reserved.