org.olat.core.gui.components.rating
Class RatingComponent

java.lang.Object
  extended by org.olat.core.gui.components.Component
      extended by org.olat.core.gui.components.rating.RatingComponent

public class RatingComponent
extends Component

Description:
The rating controller offers a view for users to rate on something using a star-like view.

Events fired by this conmponent:

RatingEvent that contains the new rating

Initial Date: 31.10.2008

Author:
gnaegi

Constructor Summary
RatingComponent(java.lang.String name, float currentRating, int maxRating, boolean allowUserInput)
          Create a rating component with no title and a default explanation and hover texts.
 
Method Summary
 java.lang.String getCssClass()
           
 float getCurrentRating()
           
 java.lang.String getExplanation()
           
 ComponentRenderer getHTMLRendererSingleton()
           
 java.lang.String getRatingLabel(int position)
           
 int getRatingSteps()
           
 java.lang.String getTitle()
           
 boolean isAllowUserInput()
           
 boolean isShowRatingAsText()
           
 boolean isTranslateExplanation()
           
 boolean isTranslateRatingLabels()
           
 boolean isTranslateTitle()
           
 void setAllowUserInput(boolean allowUserInput)
           
 void setCssClass(java.lang.String cssClass)
           
 void setCurrentRating(float currentRating)
           
 void setExplanation(java.lang.String explanation)
           
 void setLevelLabel(int position, java.lang.String ratingLabel)
           
 void setShowRatingAsText(boolean showRatingAsText)
           
 void setTitle(java.lang.String title)
           
 void setTranslateExplanation(boolean translateExplanation)
           
 void setTranslateRatingLabels(boolean translateRatingLabels)
           
 void setTranslateTitle(boolean translateTitle)
           
 
Methods inherited from class org.olat.core.gui.components.Component
addListener, debuginfoGetListeners, dispatchRequest, getAndClearLatestFiredEvent, getComponentName, getDispatchID, getExtendedDebugInfo, getLatestDispatchedController, getListenerInfo, getParent, getSpanAsDomReplaceable, getTimestamp, getTranslator, isDirty, isDirtyForUser, isDomReplaceable, isEnabled, isVisible, setDirty, setDomReplaceable, setEnabled, setSpanAsDomReplaceable, setVisible, toString, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RatingComponent

public RatingComponent(java.lang.String name,
                       float currentRating,
                       int maxRating,
                       boolean allowUserInput)
Create a rating component with no title and a default explanation and hover texts. Use the setter methods to change the values. Use NULL values to disable texts (title, explanation, labels)

Parameters:
name -
currentRating - the current rating
maxRating - maximum number that can be rated
allowUserInput -
Method Detail

getHTMLRendererSingleton

public ComponentRenderer getHTMLRendererSingleton()
Specified by:
getHTMLRendererSingleton in class Component
See Also:
Component.getHTMLRendererSingleton()

getRatingLabel

public java.lang.String getRatingLabel(int position)

setLevelLabel

public void setLevelLabel(int position,
                          java.lang.String ratingLabel)

isTranslateRatingLabels

public boolean isTranslateRatingLabels()

setTranslateRatingLabels

public void setTranslateRatingLabels(boolean translateRatingLabels)

getTitle

public java.lang.String getTitle()

setTitle

public void setTitle(java.lang.String title)

isTranslateTitle

public boolean isTranslateTitle()

setTranslateTitle

public void setTranslateTitle(boolean translateTitle)

getExplanation

public java.lang.String getExplanation()

setExplanation

public void setExplanation(java.lang.String explanation)

isTranslateExplanation

public boolean isTranslateExplanation()

setTranslateExplanation

public void setTranslateExplanation(boolean translateExplanation)

isShowRatingAsText

public boolean isShowRatingAsText()

setShowRatingAsText

public void setShowRatingAsText(boolean showRatingAsText)

isAllowUserInput

public boolean isAllowUserInput()

setAllowUserInput

public void setAllowUserInput(boolean allowUserInput)

getRatingSteps

public int getRatingSteps()

getCssClass

public java.lang.String getCssClass()

setCssClass

public void setCssClass(java.lang.String cssClass)

getCurrentRating

public float getCurrentRating()

setCurrentRating

public void setCurrentRating(float currentRating)