Interface Container

All Known Implementing Classes:
A, Address, Anchor, Article, Aside, AsyncPanel, Blockquote, Body, Button, Center, ContainerElement, Deck, Details, Dialog, Dialog, Dialog.Content, Div, DropPanel, Fieldset, Figure, FilterableTree, Footer, Form, HashNavComponent, Header, HStack, Hyperlink, Label, Li, ListItem, LiveRegion, Main, Map, ModalPopup, ModalPopup.Content, Nav, NoScript, OorianForm, Output, P, Paragraph, Popup, Search, Section, SkipLink, Slot, Spinner, Stack, StyledContainerElement, TableCell, Td, Template, Th, TreeGroup, TreeItem, VStack

public interface Container
Common interface for elements that can contain child elements.

Both ContainerElement and StyledContainerElement implement this interface, providing a unified type for code that needs to work with any container regardless of whether it supports styling operations.

Author:
Marvin P. Warble Jr.
See Also:
  • Method Details

    • addElement

      Element addElement(Element child)
      Adds a child element to this container.
      Parameters:
      child - The element to add.
      Returns:
      This element for method chaining.
    • setElement

      Element setElement(Element child)
      Sets the sole child element, replacing any existing children.
      Parameters:
      child - The element to set as the only child.
      Returns:
      This element for method chaining.
    • insertElement

      Element insertElement(int index, Element child)
      Inserts a child element at the specified index.
      Parameters:
      index - The position at which to insert the child.
      child - The element to insert.
      Returns:
      This element for method chaining.
    • removeAllElements

      void removeAllElements()
      Removes all child elements from this container.
    • removeElement

      void removeElement(String id)
      Removes a child element by its ID.
      Parameters:
      id - The ID of the child element to remove.
    • removeElement

      void removeElement(Element child)
      Removes a child element.
      Parameters:
      child - The element to remove.
    • getElementCount

      int getElementCount()
      Returns the number of child elements.
      Returns:
      The child element count.
    • getElement

      Element getElement(int index)
      Returns the child element at the specified index.
      Parameters:
      index - The index of the child element.
      Returns:
      The child element.
    • addText

      void addText(Text text)
      Adds a text node to this container.
      Parameters:
      text - The text node to add.
    • addText

      void addText(String text, CssStyle style)
      Adds styled text to this container.
      Parameters:
      text - The text content.
      style - The CSS style to apply.
    • addText

      void addText(String text, String style)
      Adds styled text to this container.
      Parameters:
      text - The text content.
      style - The inline style string.
    • addText

      void addText(String text)
      Adds plain text to this container.
      Parameters:
      text - The text content.
    • setText

      void setText(String text, CssStyle style)
      Sets the text content, replacing any existing children.
      Parameters:
      text - The text content.
      style - The CSS style to apply.
    • setText

      void setText(String text, Font font)
      Sets the text content with a font.
      Parameters:
      text - The text content.
      font - The font to apply.
    • setText

      void setText(String text, String style)
      Sets the text content with an inline style.
      Parameters:
      text - The text content.
      style - The inline style string.
    • setText

      void setText(String text)
      Sets the plain text content, replacing any existing children.
      Parameters:
      text - The text content.
    • addParagraph

      void addParagraph(String text)
      Adds a paragraph with text.
      Parameters:
      text - The paragraph text.
    • addParagraph

      void addParagraph()
      Adds an empty paragraph.
    • addSpacer

      void addSpacer(int height)
      Adds a vertical spacer with the specified height.
      Parameters:
      height - The spacer height in pixels.
    • addLineOfText

      void addLineOfText(String text, CssStyle style)
      Adds a line of styled text.
      Parameters:
      text - The text content.
      style - The CSS style to apply.
    • addLineOfText

      void addLineOfText(String text, String style)
      Adds a line of styled text.
      Parameters:
      text - The text content.
      style - The inline style string.
    • addLineOfText

      void addLineOfText(String text)
      Adds a line of plain text.
      Parameters:
      text - The text content.