Package de.jfancy
Class StarsRating
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<C,T>
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<StarsRating,Integer>,Integer>,com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<StarsRating,Integer>,Integer>,Serializable
@Tag("stars-rating")
@JsModule("./starrating.js")
public class StarsRating
extends com.vaadin.flow.component.AbstractSinglePropertyField<StarsRating,Integer>
Star-Rating Component
- Author:
- Marcus, JFancy
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField
com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C extends com.vaadin.flow.component.Component,V extends Object>Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue
com.vaadin.flow.component.HasValue.ValueChangeEvent<V extends Object>, com.vaadin.flow.component.HasValue.ValueChangeListener<E extends com.vaadin.flow.component.HasValue.ValueChangeEvent<?>> -
Constructor Summary
Constructors Constructor Description StarsRating()Creates a Star-Rating ComponentStarsRating(Integer rating)Creates a Star-Rating ComponentStarsRating(Integer rating, Integer numstars)Creates a Star-Rating ComponentStarsRating(Integer rating, Integer numstars, boolean manual)Creates a Star-Rating Component -
Method Summary
Modifier and Type Method Description IntegergetNumstars()IntegergetRating()Gets the current ratingbooleanisManual()Checks it the Component is in manuel mode.voidsetManual(boolean manual)Sets the manuel mode.voidsetNumstars(Integer numstars)voidsetRating(Integer rating)Sets the current ratingMethods inherited from class com.vaadin.flow.component.AbstractSinglePropertyField
getSynchronizationRegistration, hasValidValue, setPresentationValue, setSynchronizedEventMethods inherited from class com.vaadin.flow.component.AbstractField
addValueChangeListener, getEmptyValue, getValue, isEmpty, setModelValue, setValue, valueEqualsMethods inherited from class com.vaadin.flow.component.Component
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasValue
clear, getOptionalValueMethods inherited from interface com.vaadin.flow.component.HasValueAndElement
isReadOnly, isRequiredIndicatorVisible, setReadOnly, setRequiredIndicatorVisible
-
Constructor Details
-
StarsRating
public StarsRating()Creates a Star-Rating Component -
StarsRating
Creates a Star-Rating Component- Parameters:
rating- inital rating in stars
-
StarsRating
Creates a Star-Rating Component- Parameters:
rating- inital rating in starsnumstars- max amount of stars
-
StarsRating
Creates a Star-Rating Component- Parameters:
rating- inital rating in starsnumstars- max amount of starsmanual- In manuel mode the user is able to change the rating
-
-
Method Details
-
getRating
Gets the current rating- Returns:
- amount of stars
-
setRating
Sets the current rating- Parameters:
rating- Amount of stars
-
getNumstars
-
setNumstars
-
isManual
public boolean isManual()Checks it the Component is in manuel mode. (In manuel mode the user is able to change the rating)- Returns:
- if the component is in manuel mode
-
setManual
public void setManual(boolean manual)Sets the manuel mode. If set totruethe user is able to change the rating- Parameters:
manual- true/false
-