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

java.lang.Object
  extended byjavax.faces.component.UIComponent
      extended byjavax.faces.component.UIComponentBase
          extended byjavax.faces.component.UIOutput
              extended byjavax.faces.component.UIInput
                  extended bycom.sun.rave.web.ui.component.SelectorBase
                      extended bycom.sun.rave.web.ui.component.Selector
All Implemented Interfaces:
javax.faces.component.EditableValueHolder, SelectorManager, javax.faces.component.StateHolder, javax.faces.component.ValueHolder
Direct Known Subclasses:
CheckboxGroupBase, ListSelectorBase, RadioButtonGroupBase, RbCbSelectorBase

public class Selector
extends SelectorBase
implements SelectorManager

Author:
avk

Field Summary
protected  com.sun.rave.web.ui.util.ValueTypeEvaluator valueTypeEvaluator
           
 
Fields inherited from class javax.faces.component.UIInput
COMPONENT_FAMILY, COMPONENT_TYPE, CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID
 
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()
           
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, broadcast, decode, getSubmittedValue, getValidator, getValidators, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, setImmediate, setLocalValueSet, setRequired, setSubmittedValue, setValid, setValidator, 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, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
 
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 com.sun.rave.web.ui.util.ValueTypeEvaluator valueTypeEvaluator
Constructor Detail

Selector

public Selector()
Method Detail

getRendersChildren

public boolean getRendersChildren()

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.

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()

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.

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()