Interface IRating

All Superinterfaces:
IAnyGroup<IRating>, IComponent<IRating>, IDisable<IRating>, IHtmlBasedComponent<IRating>, IReadonly<IRating>

Immutable Rating component

A rating component provides a icon based rating input. The default icon is Unicode "★" star icon. Icons could be set to unicode icons by specifying Unicode. (for example: "☎") Or even Font Awesome icons with the prefix z-icon. (for example: "z-icon-home")

Support @Action


Denotes user has rated, the value can be received from RequestData.getData() with the key "rating"
Name Action Type
onChange
Author:
katherine
See Also:
  • Rating
  • Field Details

    • DEFAULT

      static final IRating DEFAULT
      Constant for default attributes of this immutable component.
  • Method Details

    • getWidgetClass

      default String getWidgetClass()
      Returns the client widget class.

      Default: "zul.wgt.Rating"

      Specified by:
      getWidgetClass in interface IComponent<IRating>
    • getMax

      default int getMax()
      Returns the max rating of this rating component. Default: 5
    • withMax

      IRating withMax(int max)
      Returns a copy of this immutable component with the specified max.

      Sets the max rating of this rating component

      Parameters:
      max - The max rating of this rating component

      Default: 5.

      Returns:
      A modified copy of the this object
    • getRating

      default int getRating()
      Returns the rating.

      Default: 0

    • withRating

      IRating withRating(int rating)
      Returns a copy of this immutable component with the specified rating.

      Sets the rating.

      Parameters:
      rating - Sets the rating.

      Default: 0.

      Returns:
      A modified copy of the this object
    • isReadonly

      default boolean isReadonly()
      Returns if this rating component is readonly.

      Default: false

      Specified by:
      isReadonly in interface IReadonly<IRating>
    • withReadonly

      IRating withReadonly(boolean readonly)
      Returns a copy of this immutable component with the specified readonly.

      Sets if this rating component is readonly.

      Specified by:
      withReadonly in interface IReadonly<IRating>
      Parameters:
      readonly - Whether this rating component is readonly.

      Default: false.

      Returns:
      A modified copy of the this object
    • isCancelable

      default boolean isCancelable()
      Returns whether this rating component is cancelable. If true, the rating could be cancelled by clicking the rated-rating again.

      Default: true

    • withCancelable

      IRating withCancelable(boolean cancelable)
      Returns a copy of this immutable component with the specified cancelable.

      Sets whether this rating component is cancelable.

      Parameters:
      cancelable - Whether this rating component is cancelable.

      Default: true.

      Returns:
      A modified copy of the this object
    • getOrient

      default String getOrient()
      Returns the orient.

      Default: "horizontal".

    • withOrient

      IRating withOrient(String orient)
      Returns a copy of this immutable component with the specified orient.

      Sets the orient.

      Parameters:
      orient - Either "horizontal" or "vertical"

      Default: "horizontal".

      Returns:
      A modified copy of the this object
    • withOrient

      default IRating withOrient(IRating.Orient orient)
      Returns a copy of this immutable component with the specified orient.

      Sets the orient.

      Parameters:
      orient - Either "horizontal" or "vertical"

      Default: "horizontal".

      Returns:
      A modified copy of the this object
    • getIconSclass

      default String getIconSclass()
      Returns the iconSclass name of this rating.

      Default: "z-icon-star"

    • withIconSclass

      IRating withIconSclass(String iconSclass)
      Returns a copy of this immutable component with the specified iconSclass.

      Sets the iconSclass name of this rating.

      Parameters:
      iconSclass - The iconSclass name of this rating.

      Default: "z-icon-star".

      Returns:
      A modified copy of the this object
    • of

      static IRating of(int rating)
      Returns the instance with the given rating.
      Parameters:
      rating - The rating of the component.
    • ofMax

      static IRating ofMax(int max)
      Returns the instance with the given max
      Parameters:
      max - The maximum value of the rating.
    • ofId

      static IRating ofId(String id)
      Returns the instance with the given id.
      Parameters:
      id - The id to identify this component