Class CardDeck


public class CardDeck extends Component<CardDeck>
This component is a special layout for the Card components. You can only add Card components to a CardDeck. Cards added to a CardDeck component are displayed with minimum spacing next to each other, if the screen size allows. On a small screen, Card components added to a CardDeck are displayed below each other.
Since:
4.0
Author:
JBStrap
  • Constructor Details

    • CardDeck

      public CardDeck()
      Creates an empty CardDeck component.
    • CardDeck

      public CardDeck(String id)
      Creates an empty CardDeck component with the specified unique ID.
      Parameters:
      id - Unique component ID
    • CardDeck

      public CardDeck(Card... cards)
      Creates a CardDeck component with the specified cards.
      Parameters:
      cards - Cards to be added to a CardDeck If null is specified, no cards are added to the component (but you can add them later).
    • CardDeck

      public CardDeck(String id, Card... cards)
      Creates a CardDeck component with the specified unique ID and cards.
      Parameters:
      id - Unique component ID
      cards - Cards to be added to a CardDeck If null is specified, no cards are added to the component (but you can add them later).
  • Method Details

    • addComponent

      public CardDeck addComponent(Component<?> component)
      Adds a Card component to the CardDeck.
      Overrides:
      addComponent in class Component<CardDeck>
      Parameters:
      component - The component to be added
      Returns:
      The component
      Throws:
      IllegalArgumentException - Thrown if the specified component does not extend the Card class
    • writeHTML

      public boolean writeHTML(StringWriter writer)
      Description copied from class: Component
      Creates the component's HTML equivalent

      This method doesn't need to be used during application development. This method is used when developing a custom component. When creating a custom component, this method needs to be implemented. In the parameter (StringWriter class) the component's HTML equivalent must be specified, and the method has to return with a Boolean value. This boolean value determines if the component was drawn. If the user doesn't have access right to the component, or if the component couldn't be drawn, it should return with false. Otherwise, it must return with true.

      Specified by:
      writeHTML in class Component<CardDeck>
      Returns:
      If the componentwas drawn, true, otherwise false
    • setAlignItems

      public CardDeck setAlignItems(StyleAlign... aligns)
      Sets the row content aligament.
      Parameters:
      aligns - The aligaments. For the applicable content aliaments see the VerticalAlign and the HorizontalAlign enums.
      Returns:
      The row component