Package de.jfancy

Class StarsRating

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<C,​T>
com.vaadin.flow.component.AbstractSinglePropertyField<StarsRating,​Integer>
de.jfancy.StarsRating
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 Component
    StarsRating​(Integer rating)
    Creates a Star-Rating Component
    StarsRating​(Integer rating, Integer numstars)
    Creates a Star-Rating Component
    StarsRating​(Integer rating, Integer numstars, boolean manual)
    Creates a Star-Rating Component
  • Method Summary

    Modifier and Type Method Description
    Integer getNumstars()  
    Integer getRating()
    Gets the current rating
    boolean isManual()
    Checks it the Component is in manuel mode.
    void setManual​(boolean manual)
    Sets the manuel mode.
    void setNumstars​(Integer numstars)  
    void setRating​(Integer rating)
    Sets the current rating

    Methods inherited from class com.vaadin.flow.component.AbstractSinglePropertyField

    getSynchronizationRegistration, hasValidValue, setPresentationValue, setSynchronizedEvent

    Methods inherited from class com.vaadin.flow.component.AbstractField

    addValueChangeListener, getEmptyValue, getValue, isEmpty, setModelValue, setValue, valueEquals

    Methods inherited from class com.vaadin.flow.component.Component

    addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getUI, hasListener, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisible

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.flow.component.AttachNotifier

    addAttachListener

    Methods inherited from interface com.vaadin.flow.component.DetachNotifier

    addDetachListener

    Methods inherited from interface com.vaadin.flow.component.HasElement

    getElement

    Methods inherited from interface com.vaadin.flow.component.HasEnabled

    isEnabled, setEnabled

    Methods inherited from interface com.vaadin.flow.component.HasValue

    clear, getOptionalValue

    Methods inherited from interface com.vaadin.flow.component.HasValueAndElement

    isReadOnly, isRequiredIndicatorVisible, setReadOnly, setRequiredIndicatorVisible
  • Constructor Details

    • StarsRating

      public StarsRating()
      Creates a Star-Rating Component
    • StarsRating

      public StarsRating​(Integer rating)
      Creates a Star-Rating Component
      Parameters:
      rating - inital rating in stars
    • StarsRating

      public StarsRating​(Integer rating, Integer numstars)
      Creates a Star-Rating Component
      Parameters:
      rating - inital rating in stars
      numstars - max amount of stars
    • StarsRating

      public StarsRating​(Integer rating, Integer numstars, boolean manual)
      Creates a Star-Rating Component
      Parameters:
      rating - inital rating in stars
      numstars - max amount of stars
      manual - In manuel mode the user is able to change the rating
  • Method Details

    • getRating

      public Integer getRating()
      Gets the current rating
      Returns:
      amount of stars
    • setRating

      public void setRating​(Integer rating)
      Sets the current rating
      Parameters:
      rating - Amount of stars
    • getNumstars

      public Integer getNumstars()
    • setNumstars

      public void setNumstars​(Integer numstars)
    • 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 to true the user is able to change the rating
      Parameters:
      manual - true/false