Interface IRating
- All Superinterfaces:
IAnyGroup<IRating>,IComponent<IRating>,IDisable<IRating>,IHtmlBasedComponent<IRating>,IReadonly<IRating>
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
| Name | Action Type |
|---|---|
| onChange |
- Author:
- katherine
- See Also:
-
Rating
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classBuilds instances of typeIRating.static enumSpecifies the orient withwithOrient(Orient)static classBuilds an updater of typeIRatingforUiAgent.smartUpdate(Locator, SmartUpdater). -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault StringReturns the iconSclass name of this rating.default intgetMax()Returns the max rating of this rating component.default StringReturns the orient.default intReturns the rating.default StringReturns the client widget class.default booleanReturns whether this rating component is cancelable.default booleanReturns if this rating component is readonly.static IRatingof(int rating) Returns the instance with the given rating.static IRatingReturns the instance with the given id.static IRatingofMax(int max) Returns the instance with the given maxwithCancelable(boolean cancelable) Returns a copy ofthisimmutable component with the specifiedcancelable.withIconSclass(String iconSclass) Returns a copy ofthisimmutable component with the specifiediconSclass.withMax(int max) Returns a copy ofthisimmutable component with the specifiedmax.withOrient(String orient) Returns a copy ofthisimmutable component with the specifiedorient.default IRatingwithOrient(IRating.Orient orient) Returns a copy ofthisimmutable component with the specifiedorient.withRating(int rating) Returns a copy ofthisimmutable component with the specifiedrating.withReadonly(boolean readonly) Returns a copy ofthisimmutable component with the specifiedreadonly.Methods inherited from interface org.zkoss.stateless.sul.IComponent
getAction, getActions, getClientAttributes, getId, getMold, getWidgetListeners, getWidgetOverrides, isVisible, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withActions, withActions, withClientAttribute, withClientAttributes, withId, withMold, withVisible, withWidgetClass, withWidgetListener, withWidgetListeners, withWidgetOverride, withWidgetOverridesMethods inherited from interface org.zkoss.stateless.sul.IDisable
isDisabled, withDisabledMethods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent
getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getSkeleton, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withSkeleton, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndex
-
Field Details
-
DEFAULT
Constant for default attributes of this immutable component.
-
-
Method Details
-
getWidgetClass
Returns the client widget class.Default:
"zul.wgt.Rating"- Specified by:
getWidgetClassin interfaceIComponent<IRating>
-
getMax
default int getMax()Returns the max rating of this rating component. Default:5 -
withMax
Returns a copy ofthisimmutable component with the specifiedmax.Sets the max rating of this rating component
- Parameters:
max- The max rating of this rating componentDefault:
5.- Returns:
- A modified copy of the
thisobject
-
getRating
default int getRating()Returns the rating.Default:
0 -
withRating
Returns a copy ofthisimmutable component with the specifiedrating.Sets the rating.
- Parameters:
rating- Sets the rating.Default:
0.- Returns:
- A modified copy of the
thisobject
-
isReadonly
default boolean isReadonly()Returns if this rating component is readonly.Default:
false- Specified by:
isReadonlyin interfaceIReadonly<IRating>
-
withReadonly
Returns a copy ofthisimmutable component with the specifiedreadonly.Sets if this rating component is readonly.
- Specified by:
withReadonlyin interfaceIReadonly<IRating>- Parameters:
readonly- Whether this rating component is readonly.Default:
false.- Returns:
- A modified copy of the
thisobject
-
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
Returns a copy ofthisimmutable component with the specifiedcancelable.Sets whether this rating component is cancelable.
- Parameters:
cancelable- Whether this rating component is cancelable.Default:
true.- Returns:
- A modified copy of the
thisobject
-
getOrient
Returns the orient.Default:
"horizontal". -
withOrient
Returns a copy ofthisimmutable component with the specifiedorient.Sets the orient.
- Parameters:
orient- Either"horizontal"or"vertical"Default:
"horizontal".- Returns:
- A modified copy of the
thisobject
-
withOrient
Returns a copy ofthisimmutable component with the specifiedorient.Sets the orient.
- Parameters:
orient- Either"horizontal"or"vertical"Default:
"horizontal".- Returns:
- A modified copy of the
thisobject
-
getIconSclass
Returns the iconSclass name of this rating.Default:
"z-icon-star" -
withIconSclass
Returns a copy ofthisimmutable component with the specifiediconSclass.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
thisobject
-
of
Returns the instance with the given rating.- Parameters:
rating- The rating of the component.
-
ofMax
Returns the instance with the given max- Parameters:
max- The maximum value of the rating.
-
ofId
Returns the instance with the given id.- Parameters:
id- The id to identify this component
-