Class ChipComponent<T>

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<com.vaadin.flow.component.orderedlayout.HorizontalLayout>
software.xdev.vaadin.chips.ChipComponent<T>
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, Serializable

public class ChipComponent<T> extends com.vaadin.flow.component.Composite<com.vaadin.flow.component.orderedlayout.HorizontalLayout> implements com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasSize
Represents a Chip shown underneath the ChipComboBox
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final com.vaadin.flow.component.button.Button
     
    protected T
     
    protected com.vaadin.flow.component.ItemLabelGenerator<T>
     
    protected final com.vaadin.flow.component.html.Span
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.vaadin.flow.shared.Registration
    addBtnDeleteClickListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button>> listener)
     
     
    protected void
     
    protected void
    onAttach(com.vaadin.flow.component.AttachEvent attachEvent)
     
    void
    setItemLabelGenerator(com.vaadin.flow.component.ItemLabelGenerator<T> itemLabelGenerator)
     
    void
    setReadonly(boolean readOnly)
     
    void
    Updates the text of the Span from the integrated ItemLabelGenerator

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

    getChildren, getContent, getElement, initContent

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

    addListener, findAncestor, fireEvent, from, get, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, 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.HasSize

    getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull

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

    addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
  • Field Details

    • item

      protected T item
    • itemLabelGenerator

      protected com.vaadin.flow.component.ItemLabelGenerator<T> itemLabelGenerator
    • btnDelete

      protected final com.vaadin.flow.component.button.Button btnDelete
    • label

      protected final com.vaadin.flow.component.html.Span label
  • Constructor Details

    • ChipComponent

      public ChipComponent(T item)
  • Method Details

    • initUI

      protected void initUI()
    • onAttach

      protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent)
      Overrides:
      onAttach in class com.vaadin.flow.component.Component
    • getItem

      public T getItem()
    • setItemLabelGenerator

      public void setItemLabelGenerator(com.vaadin.flow.component.ItemLabelGenerator<T> itemLabelGenerator)
    • updateTextFromItemLabelGenerator

      public void updateTextFromItemLabelGenerator()
      Updates the text of the Span from the integrated ItemLabelGenerator
    • addBtnDeleteClickListener

      public com.vaadin.flow.shared.Registration addBtnDeleteClickListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button>> listener)
    • setReadonly

      public void setReadonly(boolean readOnly)