Class DynamicOverviewCard

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<com.vaadin.flow.component.orderedlayout.HorizontalLayout>
de.bytestore.hostinger.components.cards.DynamicOverviewCard
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasStyle, Serializable

public class DynamicOverviewCard extends com.vaadin.flow.component.Composite<com.vaadin.flow.component.orderedlayout.HorizontalLayout>
DynamicOverviewCard is a custom component that extends HorizontalLayout. It represents a container for displaying cards with dynamic values. Each card added to DynamicOverviewCard is associated with a CardValueListener, which is responsible for updating the card's values. Example usage: DynamicOverviewCard dynamicCard = new DynamicOverviewCard(); Card card = new Card(); CardValueListener listener = new MyCardValueListener(); dynamicCard.addCard(card, listener); dynamicCard.update();
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addCard(Card cardIO, CardValueListener listenerIO)
    Adds a card to the DynamicOverviewCard.
    void
    Updates the values of all cards in the DynamicOverviewCard.

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

    getChildren, getContent, getElement

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

    findAncestor, from, getId, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, isAttached, isVisible, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, setId, setVisible

    Methods inherited from class java.lang.Object

    equals, 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.HasStyle

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

    • DynamicOverviewCard

      public DynamicOverviewCard()
  • Method Details

    • addCard

      public void addCard(Card cardIO, CardValueListener listenerIO)
      Adds a card to the DynamicOverviewCard. This method adds the specified card to the DynamicOverviewCard layout and associates it with a CardValueListener.
      Parameters:
      cardIO - the card to be added to the DynamicOverviewCard
      listenerIO - the CardValueListener to be associated with the card
      See Also:
    • update

      public void update()
      Updates the values of all cards in the DynamicOverviewCard. This method iterates over each card in the cards HashMap and calls the update method of the associated CardValueListener. The CardValueListener's update method is responsible for updating the card's values. Note: The update method of each CardValueListener is called with the corresponding Card as a parameter. The Card should be provided as an argument to the update method in order to update its values correctly. Example usage: DynamicOverviewCard dynamicCard = new DynamicOverviewCard(); // ... dynamicCard.update();