|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.faces.component.UIComponent
javax.faces.component.UIComponentBase
javax.faces.component.UIOutput
javax.faces.component.UIInput
com.sun.webui.jsf.component.WebuiInput
com.sun.webui.jsf.component.Rating
public class Rating
The Rating component presents a row of stars indicating a rating assigned to an item. When the user assigns a new rating to an item, an Ajax request transmits the rating to the server. The rows of stars can also indicate the average rating of all users.
Field Summary | |
---|---|
static int |
CLEAR_GRADE
The value of a grade when it is marked "cleared". |
static int |
NOT_INTERESTED_GRADE
The value of a grade when it is marked "not interested". |
Fields inherited from class javax.faces.component.UIInput |
---|
COMPONENT_FAMILY, COMPONENT_TYPE, CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID |
Constructor Summary | |
---|---|
Rating()
Creates a new instance of Rating |
Method Summary | |
---|---|
double |
getAverageGrade()
Get the average grade the general user population has assigned to the item. |
java.lang.String |
getClearAcknowledgedText()
Returns the acknowledged text for the clear control. |
java.lang.String |
getClearHoverText()
Returns the hover text for the clear control. |
java.lang.String |
getFamily()
Return the family for this component. |
int |
getGrade()
Return the grade (number of "stars") the user has assigned the item. |
java.lang.String |
getGradeAcknowledgedText()
Returns the acknowledged text for the grade controls. |
java.lang.String[] |
getGradeHoverTexts()
Returns the hover texts that are used for the grade controls, ordered from lowest to highest rating. |
int |
getMaxGrade()
Return the maximum grade (number of "stars") this rating instance allows. |
java.lang.String[] |
getModeToggleAcknowledgedTexts()
Returns the acknowledged texts that are used for the mode toggle control. |
java.lang.String[] |
getModeToggleHoverTexts()
Returns the hover texts that are used for the mode toggle control. |
java.lang.String |
getNotInterestedAcknowledgedText()
Returns the acknowledged text for the "not interested" control. |
java.lang.String |
getNotInterestedHoverText()
Returns the hover text for the "not interested" control. |
java.lang.String |
getRendererType()
|
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()
Return the position of this element in the tabbing order. |
java.lang.Object |
getValue()
|
javax.el.ValueExpression |
getValueExpression(java.lang.String name)
Return the ValueExpression stored for the
specified name (if any), respecting any property aliases. |
boolean |
isAutoSubmit()
Return true if the grade is automatically submitted to the server via an Ajax request immediately after the grade is selected, false if not. |
boolean |
isGradeReadOnly()
Return true if the grade of this rating component can be changed by the user. |
boolean |
isInAverageMode()
Return true if the component is rendered displaying the average grade, false if component is rendered displaying the user's grade (normal mode). |
boolean |
isIncludeClear()
Return true if a control to clear the user's rating is rendered, false if not. |
boolean |
isIncludeModeToggle()
Return true if a control to toggle the mode (to show the average rating or the user's rating) is rendered, false if not. |
boolean |
isIncludeNotInterested()
Return true if a control to allow the user to assign a "not interested" rating is rendered, false if not. |
boolean |
isIncludeText()
Return true if an area to show hover text or post-click acknowledged text is rendered, false if not. |
boolean |
isModeReadOnly()
Return true if the mode of this rating component can be changed by the user (via the mode toggle control), false if not |
boolean |
isVisible()
Use to indicate 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 |
setAutoSubmit(boolean autoSubmit)
Set whether the grade is automatically submitted to the server via an Ajax request immediately after the grade is selected. |
void |
setAverageGrade(double averageGrade)
Set the average grade the general user population has assigned to the item. |
void |
setClearAcknowledgedText(java.lang.String clearAcknowledgedText)
Set the acknowledged text for the clear control. |
void |
setClearHoverText(java.lang.String clearHoverText)
Set the hover text for the clear control. |
void |
setGrade(int grade)
Set the grade (number of "stars") the user has assigned the item. |
void |
setGradeAcknowledgedText(java.lang.String gradeAcknowledgedText)
Set the acknowledged text for the grade controls. |
void |
setGradeHoverTexts(java.lang.String[] gradeHoverTexts)
Set the hover texts that will be used for the grade controls, ordered from lowest to highest rating. |
void |
setGradeReadOnly(boolean gradeReadOnly)
Set whether the grade of this rating component can be changed by the user. |
void |
setInAverageMode(boolean inAverageMode)
Set whether the component will be rendered displaying the average grade. |
void |
setIncludeClear(boolean includeClear)
Set whether a control to clear the user's rating should be displayed. |
void |
setIncludeModeToggle(boolean includeModeToggle)
Set whether a control to toggle the mode (to show the average rating or the user's rating) should be rendered. |
void |
setIncludeNotInterested(boolean includeNotInterested)
Set whether a control to allow the user to assign a "not interested" rating should be rendered. |
void |
setIncludeText(boolean includeText)
Set whether an area for hover or post-click acknowledged text should be rendered. |
void |
setMaxGrade(int maxGrade)
Set the maximum grade (number of "stars") this rating instance allows. |
void |
setModeReadOnly(boolean modeReadOnly)
Set whether the mode of this rating component can be changed by the user (via the mode toggle control). |
void |
setModeToggleAcknowledgedTexts(java.lang.String[] modeToggleAcknowledgedTexts)
Sets the acknowledged texts to be used for the mode toggle control. |
void |
setModeToggleHoverTexts(java.lang.String[] modeToggleHoverTexts)
Sets the hover texts to be used for the mode toggle control. |
void |
setNotInterestedAcknowledgedText(java.lang.String notInterestedAcknowledgedText)
Set the acknowledged text for the "not interested" control. |
void |
setNotInterestedHoverText(java.lang.String notInterestedHoverText)
Set the hover text for the "not interested" control. |
void |
setStyle(java.lang.String style)
CSS style or styles to be 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)
Set the position of this element in the tabbing order. |
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 to indicate whether the component should be viewable by the user in the rendered HTML page. |
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 |
Methods inherited from class javax.faces.component.UIComponentBase |
---|
encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRendersChildren, 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, toString, wait, wait, wait |
Methods inherited from interface javax.faces.component.ValueHolder |
---|
getConverter, getLocalValue |
Field Detail |
---|
public static int NOT_INTERESTED_GRADE
public static int CLEAR_GRADE
Constructor Detail |
---|
public Rating()
Method Detail |
---|
public java.lang.String getFamily()
Return the family for this component.
getFamily
in class javax.faces.component.UIInput
public java.lang.String getRendererType()
getRendererType
in class javax.faces.component.UIComponentBase
public javax.el.ValueExpression getValueExpression(java.lang.String name)
Return the ValueExpression
stored for the
specified name (if any), respecting any property aliases.
getValueExpression
in class javax.faces.component.UIComponentBase
name
- Name of value binding expression to retrievepublic void setValueExpression(java.lang.String name, javax.el.ValueExpression binding)
Set the ValueExpression
stored for the
specified name (if any), respecting any property
aliases.
setValueExpression
in class javax.faces.component.UIComponentBase
name
- Name of value binding to setbinding
- ValueExpression to set, or null to removepublic java.lang.Object getValue()
getValue
in interface javax.faces.component.ValueHolder
getValue
in class javax.faces.component.UIOutput
public java.lang.String getStyle()
CSS style or styles to be applied to the outermost HTML element when this component is rendered.
public void setStyle(java.lang.String style)
CSS style or styles to be applied to the outermost HTML element when this component is rendered.
getStyle()
public java.lang.String getStyleClass()
CSS style class or classes to be applied to the outermost HTML element when this component is rendered.
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.
getStyleClass()
public boolean isVisible()
Use 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 false, so HTML for the component HTML is included and not visible to the user. If the component is not visible, it can still be processed on subsequent form submissions because the HTML is present.
public void setVisible(boolean visible)
Use 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 false, so HTML for the component HTML is included and not visible to the user. If the component is not visible, it can still be processed on subsequent form submissions because the HTML is present.
isVisible()
public boolean isAutoSubmit()
Return true if the grade is automatically submitted to the server via an Ajax request immediately after the grade is selected, false if not.
public void setAutoSubmit(boolean autoSubmit)
Set whether the grade is automatically submitted to the server via an Ajax request immediately after the grade is selected. The default is false - it is NOT automatically submitted.
public double getAverageGrade()
Get the average grade the general user population has assigned to the item. Will be between 0.0 and the maximum grade and rounded to the nearest 1/2 grade.
public void setAverageGrade(double averageGrade)
Set the average grade the general user population has assigned to the item. Must be between 0.0 and the maximum grade. The default is 0.
public java.lang.String getClearAcknowledgedText()
Returns the acknowledged text for the clear control. Returns null if not set.
public void setClearAcknowledgedText(java.lang.String clearAcknowledgedText)
public java.lang.String getClearHoverText()
Returns the hover text for the clear control. Returns null if not set.
public void setClearHoverText(java.lang.String clearHoverText)
public int getGrade()
Return the grade (number of "stars") the user has assigned the item.
For "not interested", the value returned is Rating.NOT_INTERESTED_GRADE
,
and for a "clear" grade the value returned is Rating.CLEAR_GRADE
.
public void setGrade(int grade)
Set the grade (number of "stars") the user has assigned the item.
Use Rating.NOT_INTERESTED_GRADE
for "not interested" and
Rating.CLEAR_GRADE
for a "clear" grade (effectively, set it to 0).
The default is Rating.CLEAR_GRADE
.
public java.lang.String getGradeAcknowledgedText()
Returns the acknowledged text for the grade controls. Returns null if not set.
public void setGradeAcknowledgedText(java.lang.String gradeAcknowledgedText)
public java.lang.String[] getGradeHoverTexts()
Returns the hover texts that are used for the grade controls, ordered from lowest to highest rating. That is, the first element of the returned array will be the hover text associated with the lowest rating; the last element with the highest rating. Returns null if no texts have been set.
public void setGradeHoverTexts(java.lang.String[] gradeHoverTexts)
Set the hover texts that will be used for the grade controls, ordered from lowest to highest rating. That is, hoverTexts[0] will be the hover text associated with the lowest rating; hoverTexts[hoverTexts.length-1] with the highest rating. Null can be specified as a member of the array. There are no defaults.
public boolean isGradeReadOnly()
Return true if the grade of this rating component can be changed by the user.
public void setGradeReadOnly(boolean gradeReadOnly)
Set whether the grade of this rating component can be changed by the user. The default is false - it is NOT read-only, and therefore can be changed by the user.
public boolean isInAverageMode()
Return true if the component is rendered displaying the average grade, false if component is rendered displaying the user's grade (normal mode).
public void setInAverageMode(boolean inAverageMode)
Set whether the component will be rendered displaying the average grade. The default is false, the component will be rendered showing the user's rating (normal mode).
public boolean isIncludeClear()
Return true if a control to clear the user's rating is rendered, false if not.
public void setIncludeClear(boolean includeClear)
Set whether a control to clear the user's rating should be displayed. The default is true.
public boolean isIncludeModeToggle()
Return true if a control to toggle the mode (to show the average rating or the user's rating) is rendered, false if not.
public void setIncludeModeToggle(boolean includeModeToggle)
Set whether a control to toggle the mode (to show the average rating or the user's rating) should be rendered. The default is false.
public boolean isIncludeNotInterested()
Return true if a control to allow the user to assign a "not interested" rating is rendered, false if not.
public void setIncludeNotInterested(boolean includeNotInterested)
Set whether a control to allow the user to assign a "not interested" rating should be rendered. The default is true.
public boolean isIncludeText()
Return true if an area to show hover text or post-click acknowledged text is rendered, false if not.
public void setIncludeText(boolean includeText)
Set whether an area for hover or post-click acknowledged text should be rendered. The default is true.
public int getMaxGrade()
Return the maximum grade (number of "stars") this rating instance allows.
public void setMaxGrade(int maxGrade)
Set the maximum grade (number of "stars") this rating instance allows. There is no default, and so must be set.
public boolean isModeReadOnly()
Return true if the mode of this rating component can be changed by the user (via the mode toggle control), false if not
public void setModeReadOnly(boolean modeReadOnly)
Set whether the mode of this rating component can be changed by the user (via the mode toggle control). The default is false - it is NOT read-only, and therefore can be changed by the user.
public java.lang.String[] getModeToggleAcknowledgedTexts()
Returns the acknowledged texts that are used for the mode toggle control. The first element of the returned array is the acknowledged text displayed after clicking on the mode toggle control to preview the user's rating (nomal mode). The second element is the text displayed after clicking on the mode toggle control to preview the average rating (average mode). If at least one of the texts has been specified but one has not, then null is returned in the array element for the missing text. Returns null if no acknowledged texts have been specified.
public void setModeToggleAcknowledgedTexts(java.lang.String[] modeToggleAcknowledgedTexts)
Sets the acknowledged texts to be used for the mode toggle control. The first element of the array is the acknowledged text displayed after clicking on the mode toggle control to preview the user's rating (normal mode). The second element is the text displayed after clicking to preview the average rating (average mode). Null can be specified as a member of the array.
public java.lang.String[] getModeToggleHoverTexts()
Returns the hover texts that are used for the mode toggle control. The first element of the returned array is the hover text displayed when hovering over the mode toggle control to preview the user's rating (nomal mode). The second element is the text displayed when hovering to preview the average rating (average mode). If at least one of the texts has been specified but one has not, then null is returned in the array element for the missing text. Returns null if no hover texts have been specified.
public void setModeToggleHoverTexts(java.lang.String[] modeToggleHoverTexts)
Sets the hover texts to be used for the mode toggle control. The first element of the array is the hover text displayed when hovering over the mode toggle control to preview the user's rating (normal mode). The second element is the text displayed when hovering to preview the average rating (normal mode). Null can be specified as a member of the array.
public java.lang.String getNotInterestedAcknowledgedText()
Returns the acknowledged text for the "not interested" control. Returns null if not set.
public void setNotInterestedAcknowledgedText(java.lang.String notInterestedAcknowledgedText)
public java.lang.String getNotInterestedHoverText()
Returns the hover text for the "not interested" control. Returns null if not set.
public void setNotInterestedHoverText(java.lang.String notInterestedHoverText)
public int getTabIndex()
Return the position of this element in the tabbing order.
public void setTabIndex(int tabIndex)
Set the position of this element in the tabbing order.
public void restoreState(javax.faces.context.FacesContext _context, java.lang.Object _state)
Restore the state of this component.
restoreState
in interface javax.faces.component.StateHolder
restoreState
in class WebuiInput
public java.lang.Object saveState(javax.faces.context.FacesContext _context)
Save the state of this component.
saveState
in interface javax.faces.component.StateHolder
saveState
in class WebuiInput
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |