Package org.zkoss.stateless.sul
Interface IRating
-
- All Superinterfaces:
IComponent<IRating>
,IDisable<IRating>
,IHtmlBasedComponent<IRating>
,IReadonly<IRating>
public interface IRating extends IHtmlBasedComponent<IRating>, IDisable<IRating>, IReadonly<IRating>
ImmutableRating
componentA 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
Denotes user has rated, the value can be received fromRequestData.getData()
with the key"rating"
- Author:
- katherine
- See Also:
Rating
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
IRating.Builder
Builds instances of typeIRating
.static class
IRating.Orient
Specifies the orient withwithOrient(Orient)
static class
IRating.Updater
Builds an updater of typeIRating
forUiAgent.smartUpdate(Locator, SmartUpdater)
.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.lang.String
getIconSclass()
Returns the iconSclass name of this rating.default int
getMax()
Returns the max rating of this rating component.default java.lang.String
getOrient()
Returns the orient.default int
getRating()
Returns the rating.default java.lang.String
getWidgetClass()
Returns the client widget class.default boolean
isCancelable()
Returns whether this rating component is cancelable.default boolean
isReadonly()
Returns if this rating component is readonly.static IRating
of(int rating)
Returns the instance with the given rating.static IRating
ofId(java.lang.String id)
Returns the instance with the given id.static IRating
ofMax(int max)
Returns the instance with the given maxIRating
withCancelable(boolean cancelable)
Returns a copy ofthis
immutable component with the specifiedcancelable
.IRating
withIconSclass(java.lang.String iconSclass)
Returns a copy ofthis
immutable component with the specifiediconSclass
.IRating
withMax(int max)
Returns a copy ofthis
immutable component with the specifiedmax
.IRating
withOrient(java.lang.String orient)
Returns a copy ofthis
immutable component with the specifiedorient
.default IRating
withOrient(IRating.Orient orient)
Returns a copy ofthis
immutable component with the specifiedorient
.IRating
withRating(int rating)
Returns a copy ofthis
immutable component with the specifiedrating
.IRating
withReadonly(boolean readonly)
Returns a copy ofthis
immutable 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, withWidgetOverrides
-
Methods inherited from interface org.zkoss.stateless.sul.IDisable
isDisabled, withDisabled
-
Methods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent
getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndex
-
-
-
-
Field Detail
-
DEFAULT
static final IRating DEFAULT
Constant for default attributes of this immutable component.
-
-
Method Detail
-
getWidgetClass
default java.lang.String getWidgetClass()
Returns the client widget class.Default:
"zul.wgt.Rating"
- Specified by:
getWidgetClass
in interfaceIComponent<IRating>
-
getMax
default int getMax()
Returns the max rating of this rating component. Default:5
-
withMax
IRating withMax(int max)
Returns a copy ofthis
immutable 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
this
object
-
getRating
default int getRating()
Returns the rating.Default:
0
-
withRating
IRating withRating(int rating)
Returns a copy ofthis
immutable component with the specifiedrating
.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 interfaceIReadonly<IRating>
-
withReadonly
IRating withReadonly(boolean readonly)
Returns a copy ofthis
immutable component with the specifiedreadonly
.Sets if this rating component is readonly.
- Specified by:
withReadonly
in interfaceIReadonly<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 ofthis
immutable 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
this
object
-
getOrient
default java.lang.String getOrient()
Returns the orient.Default:
"horizontal"
.
-
withOrient
IRating withOrient(java.lang.String orient)
Returns a copy ofthis
immutable component with the specifiedorient
.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 ofthis
immutable component with the specifiedorient
.Sets the orient.
- Parameters:
orient
- Either"horizontal"
or"vertical"
Default:
"horizontal"
.- Returns:
- A modified copy of the
this
object
-
getIconSclass
default java.lang.String getIconSclass()
Returns the iconSclass name of this rating.Default:
"z-icon-star"
-
withIconSclass
IRating withIconSclass(java.lang.String iconSclass)
Returns a copy ofthis
immutable 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
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(java.lang.String id)
Returns the instance with the given id.- Parameters:
id
- The id to identify this component
-
-