javax.faces.model
Class SelectItem

java.lang.Object
  extended by javax.faces.model.SelectItem
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
SelectItemGroup

public class SelectItem
extends java.lang.Object
implements java.io.Serializable

SelectItem represents a single item in the list of supported items associated with a UISelectMany or UISelectOne component.

See Also:
Serialized Form

Constructor Summary
SelectItem()
          Construct a SelectItem with no initialized property values.
SelectItem(java.lang.Object value)
          Construct a SelectItem with the specified value.
SelectItem(java.lang.Object value, java.lang.String label)
          Construct a SelectItem with the specified value and label.
SelectItem(java.lang.Object value, java.lang.String label, java.lang.String description)
          Construct a SelectItem instance with the specified value, label and description.
SelectItem(java.lang.Object value, java.lang.String label, java.lang.String description, boolean disabled)
          Construct a SelectItem instance with the specified property values.
SelectItem(java.lang.Object value, java.lang.String label, java.lang.String description, boolean disabled, boolean escape)
          Construct a SelectItem instance with the specified property values.
SelectItem(java.lang.Object value, java.lang.String label, java.lang.String description, boolean disabled, boolean escape, boolean noSelectionOption)
          Construct a SelectItem instance with the specified property values.
 
Method Summary
 java.lang.String getDescription()
          Return a description of this item, for use in development tools.
 java.lang.String getLabel()
          Return the label of this item, to be rendered visibly for the user.
 java.lang.Object getValue()
          Return the value of this item, to be delivered to the model if this item is selected by the user.
 boolean isDisabled()
          Return the disabled flag for this item, which should modify the rendered output to make this item unavailable for selection by the user if set to true.
 boolean isEscape()
          

If and only if this returns true, the code that renders this select item must escape the label using escaping syntax appropriate to the content type being rendered.

 boolean isNoSelectionOption()
          

Return the value of the noSelectionOption property.

 void setDescription(java.lang.String description)
          Set the description of this item, for use in development tools.
 void setDisabled(boolean disabled)
          Set the disabled flag for this item, which should modify the rendered output to make this item unavailable for selection by the user if set to true.
 void setEscape(boolean escape)
          

Set the value of the escape property.

 void setLabel(java.lang.String label)
          Set the label of this item, to be rendered visibly for the user.
 void setNoSelectionOption(boolean noSelectionOption)
          

Set the value of the noSelectionOption property.

 void setValue(java.lang.Object value)
          Set the value of this item, to be delivered to the model if this item is selected by this user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectItem

public SelectItem()

Construct a SelectItem with no initialized property values.


SelectItem

public SelectItem(java.lang.Object value)

Construct a SelectItem with the specified value. The label property will be set to the value (converted to a String, if necessary), the description property will be set to null, the disabled property will be set to false, and the escape property will be set to ( true.

Parameters:
value - Value to be delivered to the model if this item is selected by the user

SelectItem

public SelectItem(java.lang.Object value,
                  java.lang.String label)

Construct a SelectItem with the specified value and label. The description property will be set to null, the disabled property will be set to false, and the escape property will be set to true.

Parameters:
value - Value to be delivered to the model if this item is selected by the user
label - Label to be rendered for this item in the response

SelectItem

public SelectItem(java.lang.Object value,
                  java.lang.String label,
                  java.lang.String description)

Construct a SelectItem instance with the specified value, label and description. This disabled property will be set to false, and the escape property will be set to true.

Parameters:
value - Value to be delivered to the model if this item is selected by the user
label - Label to be rendered for this item in the response
description - Description of this item, for use in tools

SelectItem

public SelectItem(java.lang.Object value,
                  java.lang.String label,
                  java.lang.String description,
                  boolean disabled)

Construct a SelectItem instance with the specified property values. The escape property will be set to true.

Parameters:
value - Value to be delivered to the model if this item is selected by the user
label - Label to be rendered for this item in the response
description - Description of this item, for use in tools
disabled - Flag indicating that this option is disabled

SelectItem

public SelectItem(java.lang.Object value,
                  java.lang.String label,
                  java.lang.String description,
                  boolean disabled,
                  boolean escape)

Construct a SelectItem instance with the specified property values.

Parameters:
value - Value to be delivered to the model if this item is selected by the user
label - Label to be rendered for this item in the response
description - Description of this item, for use in tools
disabled - Flag indicating that this option is disabled
escape - Flag indicating that the text of this option should be escaped when rendered.
Since:
1.2

SelectItem

public SelectItem(java.lang.Object value,
                  java.lang.String label,
                  java.lang.String description,
                  boolean disabled,
                  boolean escape,
                  boolean noSelectionOption)

Construct a SelectItem instance with the specified property values.

Parameters:
value - Value to be delivered to the model if this item is selected by the user
label - Label to be rendered for this item in the response
description - Description of this item, for use in tools
disabled - Flag indicating that this option is disabled
escape - Flag indicating that the text of this option should be escaped when rendered.
noSelectionOption - Flag indicating that the current option is a "no selection" option
Since:
1.2
Method Detail

getDescription

public java.lang.String getDescription()

Return a description of this item, for use in development tools.


setDescription

public void setDescription(java.lang.String description)

Set the description of this item, for use in development tools.

Parameters:
description - The new description

isDisabled

public boolean isDisabled()

Return the disabled flag for this item, which should modify the rendered output to make this item unavailable for selection by the user if set to true.


setDisabled

public void setDisabled(boolean disabled)

Set the disabled flag for this item, which should modify the rendered output to make this item unavailable for selection by the user if set to true.

Parameters:
disabled - The new disabled flag

getLabel

public java.lang.String getLabel()

Return the label of this item, to be rendered visibly for the user.


setLabel

public void setLabel(java.lang.String label)

Set the label of this item, to be rendered visibly for the user.

Parameters:
label - The new label

getValue

public java.lang.Object getValue()

Return the value of this item, to be delivered to the model if this item is selected by the user.


setValue

public void setValue(java.lang.Object value)

Set the value of this item, to be delivered to the model if this item is selected by this user.

Parameters:
value - The new value

isEscape

public boolean isEscape()

If and only if this returns true, the code that renders this select item must escape the label using escaping syntax appropriate to the content type being rendered.

Since:
2.0

setEscape

public void setEscape(boolean escape)

Set the value of the escape property. See isEscape().

Since:
2.0

isNoSelectionOption

public boolean isNoSelectionOption()

Return the value of the noSelectionOption property. If the value of this property is true, the system interprets the option represented by this SelectItem instance as representing a "no selection" option. See UISelectOne#validateValue and UISelectMany#validateValue for usage.

Since:
2.0

setNoSelectionOption

public void setNoSelectionOption(boolean noSelectionOption)

Set the value of the noSelectionOption property.

Since:
2.0


Submit a bug or feature

Copyright © 2009-2011, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.

Generated on 10-February-2011 12:41