com.sun.webui.jsf.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.webui.jsf.component.WebuiInput
                      extended by com.sun.webui.jsf.component.Selector
All Implemented Interfaces:
com.sun.webui.jsf.component.SelectorManager, javax.faces.component.EditableValueHolder, javax.faces.component.StateHolder, javax.faces.component.ValueHolder
Direct Known Subclasses:
CheckboxGroup, ListSelector, RadioButtonGroup, com.sun.webui.jsf.component.RbCbSelector

public class Selector
extends WebuiInput
implements com.sun.webui.jsf.component.SelectorManager

Base component for UI components that allow the user to make a selection from a set of options.


Field Summary
 
Fields inherited from class javax.faces.component.UIInput
COMPONENT_FAMILY, COMPONENT_TYPE, CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID
 
Constructor Summary
Selector()
           
 
Method Summary
 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.
 java.lang.String getFamily()
          Return the family for this component.
 java.lang.Object getItems()
          Specifies the options that the web application user can choose from.
 java.lang.String getLabel()
          If set, a label is rendered adjacent to the component with the value of this attribute as the label text.
 int getLabelLevel()
           
 java.lang.String getOnBlur()
          Scripting code executed when this element loses focus.
 java.lang.String getOnChange()
          Scripting code executed when the element value of this component is changed.
 java.lang.String getOnClick()
          Scripting code executed when a mouse click occurs over this component.
 java.lang.String getOnDblClick()
          Scripting code executed when a mouse double click occurs over this component.
 java.lang.String getOnFocus()
          Scripting code executed when this component receives focus.
 java.lang.String getOnKeyDown()
          Scripting code executed when the user presses down on a key while the component has focus.
 java.lang.String getOnKeyPress()
          Scripting code executed when the user presses and releases a key while the component has focus.
 java.lang.String getOnKeyUp()
          Scripting code executed when the user releases a key while the component has focus.
 java.lang.String getOnMouseDown()
          Scripting code executed when the user presses a mouse button while the mouse pointer is on the component.
 java.lang.String getOnMouseMove()
          Scripting code executed when the user moves the mouse pointer while over the component.
 java.lang.String getOnMouseOut()
          Scripting code executed when a mouse out movement occurs over this component.
 java.lang.String getOnMouseOver()
          Scripting code executed when the user moves the mouse pointer into the boundary of this component.
 java.lang.String getOnMouseUp()
          Scripting code executed when the user releases a mouse button while the mouse pointer is on the component.
 java.lang.String getOnSelect()
          Scripting code executed when some text in this component value is selected.
 boolean getRendersChildren()
          Return a flag indicating whether this component is responsible for rendering its child components.
 java.lang.Object getSelected()
          The object that represents the selections made from the available options.
 java.lang.String getStyle()
          CSS style or styles to be applied to the outermost HTML element when this component is rendered.
 java.lang.String getStyleClass()
          CSS style class or classes to be applied to the outermost HTML element when this component is rendered.
 int getTabIndex()
          Position of this element in the tabbing order of the current document.
 java.lang.String getToolTip()
          Sets the value of the title attribute for the HTML element.
 javax.el.ValueExpression getValueExpression(java.lang.String name)
          Return the ValueExpression stored for the specified name (if any), respecting any property aliases.
 boolean isDisabled()
          Flag indicating that the user is not permitted to activate this component, and that the component's value will not be submitted with the form.
 boolean isMultiple()
          Getter for property multiple.
 boolean isReadOnly()
          Deprecated. The attribute is deprected starting from version 4.1
 boolean isVisible()
          Indicates whether the component should be viewable by the user in the rendered HTML page.
 void restoreState(javax.faces.context.FacesContext _context, java.lang.Object _state)
          Restore the state of this component.
 java.lang.Object saveState(javax.faces.context.FacesContext _context)
          Save the state of this component.
 void setDisabled(boolean disabled)
          Flag indicating that the user is not permitted to activate this component, and that the component's value will not be submitted with the form.
 void setItems(java.lang.Object items)
          Specifies the options that the web application user can choose from.
 void setLabel(java.lang.String label)
          If set, a label is rendered adjacent to the component with the value of this attribute as the label text.
 void setLabelLevel(int labelLevel)
          Sets the style level for the generated label, provided the label attribute has been set.
 void setMultiple(boolean multiple)
          Setter for property multiple.
 void setOnBlur(java.lang.String onBlur)
          Scripting code executed when this element loses focus.
 void setOnChange(java.lang.String onChange)
          Scripting code that is executed when the element value of this component is changed.
 void setOnClick(java.lang.String onClick)
          Scripting code executed when a mouse click occurs over this component.
 void setOnDblClick(java.lang.String onDblClick)
          Scripting code executed when a mouse double click occurs over this component.
 void setOnFocus(java.lang.String onFocus)
          Scripting code executed when this component receives focus.
 void setOnKeyDown(java.lang.String onKeyDown)
          Scripting code executed when the user presses down on a key while the component has focus.
 void setOnKeyPress(java.lang.String onKeyPress)
          Scripting code executed when the user presses and releases a key while the component has focus.
 void setOnKeyUp(java.lang.String onKeyUp)
          Scripting code executed when the user releases a key while the component has focus.
 void setOnMouseDown(java.lang.String onMouseDown)
          Scripting code executed when the user presses a mouse button while the mouse pointer is on the component.
 void setOnMouseMove(java.lang.String onMouseMove)
          Scripting code that is executed when the user moves the mouse pointer while over the component.
 void setOnMouseOut(java.lang.String onMouseOut)
          Scripting code executed when a mouse out movement occurs over this component.
 void setOnMouseOver(java.lang.String onMouseOver)
          Scripting code executed when the user moves the mouse pointer into the boundary of this component.
 void setOnMouseUp(java.lang.String onMouseUp)
          Scripting code executed when the user releases a mouse button while the mouse pointer is on the component.
 void setOnSelect(java.lang.String onSelect)
          Scripting code executed when some text in this component value is selected.
 void setReadOnly(boolean readOnly)
          Deprecated. The attribute is deprected starting from version 4.1
 void setSelected(java.lang.Object selected)
           
 void setStyle(java.lang.String style)
          CSS style or styles that are applied to the outermost HTML element when this component is rendered.
 void setStyleClass(java.lang.String styleClass)
          CSS style class or classes to be applied to the outermost HTML element when this component is rendered.
 void setTabIndex(int tabIndex)
          Position of this element in the tabbing order of the current document.
 void setToolTip(java.lang.String toolTip)
          Sets the value of the title attribute for the HTML element.
 void setValueExpression(java.lang.String name, javax.el.ValueExpression binding)
          Set the ValueExpression stored for the specified name (if any), respecting any property aliases.
 void setVisible(boolean visible)
          Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page.
 java.lang.String toString()
          Public method toString()
 
Methods inherited from class com.sun.webui.jsf.component.WebuiInput
broadcast, getValidator, getValidatorExpression, getValueChangeListener, getValueChangeListenerExpression, processDecodes, processUpdates, processValidators, setConverter, setId, setImmediate, setRendered, setRequired, setValidatorExpression, setValueChangeListenerExpression
 
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, decode, getConverterMessage, getRequiredMessage, getSubmittedValue, getValidatorMessage, getValidators, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, removeValidator, removeValueChangeListener, resetValue, setConverterMessage, setLocalValueSet, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, updateModel, validate
 
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, getValue
 
Methods inherited from class javax.faces.component.UIComponentBase
encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRendererType, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, restoreAttachedState, saveAttachedState, setParent, setRendererType, setTransient, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.sun.webui.jsf.component.SelectorManager
getClientId
 
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, getValue
 

Constructor Detail

Selector

public Selector()
Method Detail

getFamily

public java.lang.String getFamily()

Return the family for this component.

Overrides:
getFamily in class javax.faces.component.UIInput

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(javax.faces.context.FacesContext).

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

getLabelLevel

public int getLabelLevel()

isMultiple

public boolean isMultiple()
Getter for property multiple.

Specified by:
isMultiple in interface com.sun.webui.jsf.component.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

setSelected

public void setSelected(java.lang.Object selected)

getValueExpression

public javax.el.ValueExpression getValueExpression(java.lang.String name)

Return the ValueExpression stored for the specified name (if any), respecting any property aliases.

Overrides:
getValueExpression in class javax.faces.component.UIComponentBase
Parameters:
name - Name of value binding expression to retrieve

setValueExpression

public void setValueExpression(java.lang.String name,
                               javax.el.ValueExpression binding)

Set the ValueExpression stored for the specified name (if any), respecting any property aliases.

Overrides:
setValueExpression in class javax.faces.component.UIComponentBase
Parameters:
name - Name of value binding to set
binding - ValueExpression to set, or null to remove

isDisabled

public boolean isDisabled()

Flag indicating that the user is not permitted to activate this component, and that the component's value will not be submitted with the form.

Specified by:
isDisabled in interface com.sun.webui.jsf.component.SelectorManager

setDisabled

public void setDisabled(boolean disabled)

Flag indicating that the user is not permitted to activate this component, and that the component's value will not be submitted with the form.

See Also:
isDisabled()

getItems

public java.lang.Object getItems()

Specifies the options that the web application user can choose from. The value must be one of an array, Map or Collection whose members are all subclasses ofcom.sun.webui.jsf.model.Option.


setItems

public void setItems(java.lang.Object items)

Specifies the options that the web application user can choose from. The value must be one of an array, Map or Collection whose members are all subclasses ofcom.sun.webui.jsf.model.Option.

See Also:
getItems()

getLabel

public java.lang.String getLabel()

If set, a label is rendered adjacent to the component with the value of this attribute as the label text.


setLabel

public void setLabel(java.lang.String label)

If set, a label is rendered adjacent to the component with the value of this attribute as the label text.

See Also:
getLabel()

setLabelLevel

public void setLabelLevel(int labelLevel)

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.

See Also:
getLabelLevel()

getOnBlur

public java.lang.String getOnBlur()

Scripting code executed when this element loses focus.


setOnBlur

public void setOnBlur(java.lang.String onBlur)

Scripting code executed when this element loses focus.

See Also:
getOnBlur()

getOnChange

public java.lang.String getOnChange()

Scripting code executed when the element value of this component is changed.

Specified by:
getOnChange in interface com.sun.webui.jsf.component.SelectorManager

setOnChange

public void setOnChange(java.lang.String onChange)

Scripting code that is executed when the element value of this component is changed.

See Also:
getOnChange()

getOnClick

public java.lang.String getOnClick()

Scripting code executed when a mouse click occurs over this component.


setOnClick

public void setOnClick(java.lang.String onClick)

Scripting code executed when a mouse click occurs over this component.

See Also:
getOnClick()

getOnDblClick

public java.lang.String getOnDblClick()

Scripting code executed when a mouse double click occurs over this component.


setOnDblClick

public void setOnDblClick(java.lang.String onDblClick)

Scripting code executed when a mouse double click occurs over this component.

See Also:
getOnDblClick()

getOnFocus

public java.lang.String getOnFocus()

Scripting code executed when this component receives focus. An element receives focus when the user selects the element by pressing the tab key or clicking the mouse.


setOnFocus

public void setOnFocus(java.lang.String onFocus)

Scripting code executed when this component receives focus. An element receives focus when the user selects the element by pressing the tab key or clicking the mouse.

See Also:
getOnFocus()

getOnKeyDown

public java.lang.String getOnKeyDown()

Scripting code executed when the user presses down on a key while the component has focus.


setOnKeyDown

public void setOnKeyDown(java.lang.String onKeyDown)

Scripting code executed when the user presses down on a key while the component has focus.

See Also:
getOnKeyDown()

getOnKeyPress

public java.lang.String getOnKeyPress()

Scripting code executed when the user presses and releases a key while the component has focus.


setOnKeyPress

public void setOnKeyPress(java.lang.String onKeyPress)

Scripting code executed when the user presses and releases a key while the component has focus.

See Also:
getOnKeyPress()

getOnKeyUp

public java.lang.String getOnKeyUp()

Scripting code executed when the user releases a key while the component has focus.


setOnKeyUp

public void setOnKeyUp(java.lang.String onKeyUp)

Scripting code executed when the user releases a key while the component has focus.

See Also:
getOnKeyUp()

getOnMouseDown

public java.lang.String getOnMouseDown()

Scripting code executed when the user presses a mouse button while the mouse pointer is on the component.


setOnMouseDown

public void setOnMouseDown(java.lang.String onMouseDown)

Scripting code executed when the user presses a mouse button while the mouse pointer is on the component.

See Also:
getOnMouseDown()

getOnMouseMove

public java.lang.String getOnMouseMove()

Scripting code executed when the user moves the mouse pointer while over the component.


setOnMouseMove

public void setOnMouseMove(java.lang.String onMouseMove)

Scripting code that is executed when the user moves the mouse pointer while over the component.

See Also:
getOnMouseMove()

getOnMouseOut

public java.lang.String getOnMouseOut()

Scripting code executed when a mouse out movement occurs over this component.


setOnMouseOut

public void setOnMouseOut(java.lang.String onMouseOut)

Scripting code executed when a mouse out movement occurs over this component.

See Also:
getOnMouseOut()

getOnMouseOver

public java.lang.String getOnMouseOver()

Scripting code executed when the user moves the mouse pointer into the boundary of this component.


setOnMouseOver

public void setOnMouseOver(java.lang.String onMouseOver)

Scripting code executed when the user moves the mouse pointer into the boundary of this component.

See Also:
getOnMouseOver()

getOnMouseUp

public java.lang.String getOnMouseUp()

Scripting code executed when the user releases a mouse button while the mouse pointer is on the component.


setOnMouseUp

public void setOnMouseUp(java.lang.String onMouseUp)

Scripting code executed when the user releases a mouse button while the mouse pointer is on the component.

See Also:
getOnMouseUp()

getOnSelect

public java.lang.String getOnSelect()

Scripting code executed when some text in this component value is selected.


setOnSelect

public void setOnSelect(java.lang.String onSelect)

Scripting code executed when some text in this component value is selected.

See Also:
getOnSelect()

isReadOnly

public boolean isReadOnly()
Deprecated. The attribute is deprected starting from version 4.1

If true, the value of the component is rendered as text, preceded by the label if one was defined.

Specified by:
isReadOnly in interface com.sun.webui.jsf.component.SelectorManager

setReadOnly

public void setReadOnly(boolean readOnly)
Deprecated. The attribute is deprected starting from version 4.1

If true, the value of the component is rendered as text, preceded by the label if one was defined.

See Also:
isReadOnly()

getSelected

public java.lang.Object getSelected()

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


getStyle

public java.lang.String getStyle()

CSS style or styles to be applied to the outermost HTML element when this component is rendered.

Specified by:
getStyle in interface com.sun.webui.jsf.component.SelectorManager

setStyle

public void setStyle(java.lang.String style)

CSS style or styles that are applied to the outermost HTML element when this component is rendered.

See Also:
getStyle()

getStyleClass

public java.lang.String getStyleClass()

CSS style class or classes to be applied to the outermost HTML element when this component is rendered.

Specified by:
getStyleClass in interface com.sun.webui.jsf.component.SelectorManager

setStyleClass

public void setStyleClass(java.lang.String styleClass)

CSS style class or classes to be applied to the outermost HTML element when this component is rendered.

See Also:
getStyleClass()

getTabIndex

public int getTabIndex()

Position of this element in the tabbing order of the current document. Tabbing order determines the sequence in which elements receive focus when the tab key is pressed. The value must be an integer between 0 and 32767.

Specified by:
getTabIndex in interface com.sun.webui.jsf.component.SelectorManager

setTabIndex

public void setTabIndex(int tabIndex)

Position of this element in the tabbing order of the current document. Tabbing order determines the sequence in which elements receive focus when the tab key is pressed. The value must be an integer between 0 and 32767.

See Also:
getTabIndex()

getToolTip

public java.lang.String getToolTip()

Sets the value of the title attribute for the HTML element. The specified text will display as a tooltip if the mouse cursor hovers over the HTML element.


setToolTip

public void setToolTip(java.lang.String toolTip)

Sets the value of the title attribute for the HTML element. The specified text will display as a tooltip if the mouse cursor hovers over the HTML element.

See Also:
getToolTip()

isVisible

public boolean isVisible()

Indicates whether the component should be viewable by the user in the rendered HTML page. If false, the HTML code for the component is present in the page, but the component is hidden with style attributes. By default, visible is true, so HTML for the component HTML is included and visible to the user. If the component is not visible, it can still be processed on subsequent form submissions because the HTML is present.


setVisible

public void setVisible(boolean visible)

Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page. If set to false, the HTML code for the component is present in the page, but the component is hidden with style attributes. By default, visible is set to true, so HTML for the component HTML is included and visible to the user. If the component is not visible, it can still be processed on subsequent form submissions because the HTML is present.

See Also:
isVisible()

restoreState

public void restoreState(javax.faces.context.FacesContext _context,
                         java.lang.Object _state)

Restore the state of this component.

Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class WebuiInput

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext _context)

Save the state of this component.

Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class WebuiInput


Copyright © 2008 Sun Microsystems, Inc. All Rights Reserved.