com.sun.rave.web.ui.component
Class Selector

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 com.sun.rave.web.ui.component.SelectorBase
                      extended by com.sun.rave.web.ui.component.Selector
All Implemented Interfaces:
SelectorManager, javax.faces.component.EditableValueHolder, javax.faces.component.StateHolder, javax.faces.component.ValueHolder
Direct Known Subclasses:
CheckboxGroupBase, ListSelectorBase, RadioButtonGroupBase, RbCbSelectorBase

public class Selector
extends SelectorBase
implements SelectorManager


Field Summary
protected  ValueTypeEvaluator valueTypeEvaluator
           
 
Fields inherited from class javax.faces.component.UIInput
COMPONENT_FAMILY, COMPONENT_TYPE, CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID
 
Fields inherited from class javax.faces.component.UIComponent
bindings
 
Constructor Summary
Selector()
           
 
Method Summary
protected  boolean compareValues(java.lang.Object previous, java.lang.Object value)
          Return true if the new value is different from the previous value.
 java.lang.Object getConvertedValue(javax.faces.context.FacesContext context, java.lang.Object submittedValue)
          Retrieve the value of this component (the "selected" property) as an object.
 int getLabelLevel()
          Sets the style level for the generated label, provided the label attribute has been set.
 boolean getRendersChildren()
          Return a flag indicating whether this component is responsible for rendering its child components.
protected  java.lang.String getValueAsReadOnly(javax.faces.context.FacesContext context)
          Return a string suitable for displaying the value in read only mode.
 boolean isMultiple()
          Getter for property multiple.
 void setMultiple(boolean multiple)
          Setter for property multiple.
 void setSelected(java.lang.Object selected)
          The object that represents the selections made from the available options.
 java.lang.String toString()
          Public method toString()
 
Methods inherited from class com.sun.rave.web.ui.component.SelectorBase
getFamily, getItems, getLabel, getOnBlur, getOnChange, getOnClick, getOnDblClick, getOnFocus, getOnKeyDown, getOnKeyPress, getOnKeyUp, getOnMouseDown, getOnMouseMove, getOnMouseOut, getOnMouseOver, getOnMouseUp, getOnSelect, getSelected, getStyle, getStyleClass, getTabIndex, getToolTip, getValueBinding, isDisabled, isReadOnly, isVisible, restoreState, saveState, setDisabled, setItems, setLabel, setLabelLevel, setOnBlur, setOnChange, setOnClick, setOnDblClick, setOnFocus, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setOnSelect, setReadOnly, setStyle, setStyleClass, setTabIndex, setToolTip, setValueBinding, setVisible
 
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, decode, getConverterMessage, getRequiredMessage, getSubmittedValue, getValidator, getValidatorMessage, getValidators, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, resetValue, setConverterMessage, setImmediate, setLocalValueSet, setRequired, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, updateModel, validate, validateValue
 
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, getValue, setConverter
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.sun.rave.web.ui.component.SelectorManager
getClientId, getOnChange, getStyle, getStyleClass, getTabIndex, isDisabled, isReadOnly
 
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, getValue, setConverter
 

Field Detail

valueTypeEvaluator

protected ValueTypeEvaluator valueTypeEvaluator
Constructor Detail

Selector

public Selector()
Method Detail

getRendersChildren

public boolean getRendersChildren()

Return a flag indicating whether this component is responsible for rendering its child components. The default implementation in UIComponentBase#getRendersChildren tries to find the renderer for this component. If it does, it calls Renderer#getRendersChildren and returns the result. If it doesn't, it returns false. As of version 1.2 of the JavaServer Faces Specification, component authors are encouraged to return true from this method and rely on UIComponentBase#encodeChildren.

Overrides:
getRendersChildren in class javax.faces.component.UIComponentBase

getConvertedValue

public java.lang.Object getConvertedValue(javax.faces.context.FacesContext context,
                                          java.lang.Object submittedValue)
                                   throws javax.faces.convert.ConverterException
Retrieve the value of this component (the "selected" property) as an object. This method is invoked by the JSF engine during the validation phase. The JSF default behaviour is for components to defer the conversion and validation to the renderer, but for the Selector based components, the renderers do not share as much functionality as the components do, so it is more efficient to do it here.

Overrides:
getConvertedValue in class javax.faces.component.UIInput
Parameters:
context - The FacesContext of the request
submittedValue - The submitted value of the component
Throws:
javax.faces.convert.ConverterException

getValueAsReadOnly

protected java.lang.String getValueAsReadOnly(javax.faces.context.FacesContext context)
Return a string suitable for displaying the value in read only mode. The default is to separate the list values with a comma.

Parameters:
context - The FacesContext
Throws:
javax.faces.FacesException - If the list items cannot be processed

getLabelLevel

public int getLabelLevel()
Description copied from class: SelectorBase

Sets the style level for the generated label, provided the label attribute has been set. Valid values are 1 (largest), 2 and 3 (smallest). The default value is 2.

Overrides:
getLabelLevel in class SelectorBase

isMultiple

public boolean isMultiple()
Getter for property multiple.

Specified by:
isMultiple in interface SelectorManager
Returns:
Value of property multiple.

setMultiple

public void setMultiple(boolean multiple)
Setter for property multiple.

Parameters:
multiple - New value of property multiple.

toString

public java.lang.String toString()
Public method toString()

Overrides:
toString in class java.lang.Object
Returns:
A String representation of this component

compareValues

protected boolean compareValues(java.lang.Object previous,
                                java.lang.Object value)

Return true if the new value is different from the previous value.

This only implements a compareValues for value if it is an Array. If value is not an Array, defer to super.compareValues. The assumption is that the ordering of the elements between the previous value and the new value is determined in the same manner. Another assumption is that the two object arguments are of the same type, both arrays of both not arrays.

Overrides:
compareValues in class javax.faces.component.UIInput
Parameters:
previous - old value of this component (if any)
value - new value of this component (if any)

setSelected

public void setSelected(java.lang.Object selected)
Description copied from class: SelectorBase

The object that represents the selections made from the available options. If multiple selections are allowed, this must be bound to ArrayList, an Object array, or an array of primitives.

Overrides:
setSelected in class SelectorBase
See Also:
SelectorBase.getSelected()