Class StyledContainerElement<T extends StyledContainerElement<T>>

Direct Known Subclasses:
A, Address, Article, Aside, Blockquote, Body, Button, Center, Details, Dialog, Div, Fieldset, Figure, Footer, Form, Header, Label, Li, Main, Map, Nav, NoScript, OorianForm, Output, P, Search, Section, Slot, Stack, TableCell, Template

public class StyledContainerElement<T extends StyledContainerElement<T>> extends StyledElement<T>
  • Constructor Details

    • StyledContainerElement

      public StyledContainerElement(String tagName)
    • StyledContainerElement

      public StyledContainerElement(String tagName, boolean closed)
  • Method Details

    • addElement

      public T addElement(Element child)
      Description copied from class: Element
      Adds a child element to this element.

      The child is removed from its previous parent if it has one, then added to this element's children. If this element is already attached to a page, the child is also attached and registered for DOM addition.

      Overrides:
      addElement in class Element<T extends StyledContainerElement<T>>
      Parameters:
      child - The child element to add.
      Returns:
      this element for method chaining
    • setElement

      public T setElement(Element child)
      Description copied from class: Element
      Replaces all child elements with a single child element.

      All existing children are removed before adding the new child.

      Overrides:
      setElement in class Element<T extends StyledContainerElement<T>>
      Parameters:
      child - The child element to set as the only child.
      Returns:
      This element for method chaining.
    • insertElement

      public T insertElement(int index, Element child)
      Description copied from class: Element
      Inserts a child element at the specified index.

      The child is removed from its previous parent if it has one, then inserted at the specified index in this element's children.

      Overrides:
      insertElement in class Element<T extends StyledContainerElement<T>>
      Parameters:
      index - The index at which to insert the child.
      child - The child element to insert.
      Returns:
      this element for method chaining
    • addText

      public void addText(Text text)
      Description copied from class: Element
      Appends a Text element to this element.
      Overrides:
      addText in class Element<T extends StyledContainerElement<T>>
      Parameters:
      text - The Text element to append.
    • addText

      public void addText(String text, CssStyle style)
      Description copied from class: Element
      Appends text content with a CssStyle to this element.
      Overrides:
      addText in class Element<T extends StyledContainerElement<T>>
      Parameters:
      text - The text content to append.
      style - The CssStyle to apply to the text.
    • addText

      public void addText(String text, String style)
      Description copied from class: Element
      Appends text content with inline CSS styling to this element.
      Overrides:
      addText in class Element<T extends StyledContainerElement<T>>
      Parameters:
      text - The text content to append.
      style - The inline CSS style string to apply to the text.
    • addText

      public void addText(String text)
      Description copied from class: Element
      Appends text content to this element.
      Overrides:
      addText in class Element<T extends StyledContainerElement<T>>
      Parameters:
      text - The text content to append.
    • setText

      public void setText(String text, CssStyle style)
      Description copied from class: Element
      Sets the text content of this element with a CssStyle, replacing any existing content.
      Overrides:
      setText in class Element<T extends StyledContainerElement<T>>
      Parameters:
      text - The text content to set.
      style - The CssStyle to apply to the text.
    • setText

      public void setText(String text, Font font)
      Description copied from class: Element
      Sets the text content of this element with a font, replacing any existing content.
      Overrides:
      setText in class Element<T extends StyledContainerElement<T>>
      Parameters:
      text - The text content to set.
      font - The font to apply to the text.
    • setText

      public void setText(String text, String style)
      Description copied from class: Element
      Sets the text content of this element with inline CSS styling, replacing any existing content.
      Overrides:
      setText in class Element<T extends StyledContainerElement<T>>
      Parameters:
      text - The text content to set.
      style - The inline CSS style string to apply to the text.
    • setText

      public void setText(String text)
      Description copied from class: Element
      Sets the text content of this element, replacing any existing content.
      Overrides:
      setText in class Element<T extends StyledContainerElement<T>>
      Parameters:
      text - The text content to set.
    • addParagraph

      public void addParagraph(String text)
      Description copied from class: Element
      Adds a paragraph element containing the specified text.
      Overrides:
      addParagraph in class Element<T extends StyledContainerElement<T>>
      Parameters:
      text - the text content for the paragraph
    • addParagraph

      public void addParagraph()
      Description copied from class: Element
      Adds an empty paragraph element.
      Overrides:
      addParagraph in class Element<T extends StyledContainerElement<T>>
    • addSpacer

      public void addSpacer(int height)
      Description copied from class: Element
      Adds a vertical spacer element with the specified height in pixels.
      Overrides:
      addSpacer in class Element<T extends StyledContainerElement<T>>
      Parameters:
      height - The height of the spacer in pixels.
    • addLineOfText

      public void addLineOfText(String text, CssStyle style)
      Description copied from class: Element
      Appends text content with a CssStyle followed by a line break to this element.
      Overrides:
      addLineOfText in class Element<T extends StyledContainerElement<T>>
      Parameters:
      text - The text content to append.
      style - The CssStyle to apply to the text.
    • addLineOfText

      public void addLineOfText(String text, String style)
      Description copied from class: Element
      Appends text content with inline CSS styling followed by a line break to this element.
      Overrides:
      addLineOfText in class Element<T extends StyledContainerElement<T>>
      Parameters:
      text - The text content to append.
      style - The inline CSS style string to apply to the text.
    • addLineOfText

      public void addLineOfText(String text)
      Description copied from class: Element
      Appends text content followed by a line break to this element.
      Overrides:
      addLineOfText in class Element<T extends StyledContainerElement<T>>
      Parameters:
      text - The text content to append.
    • removeAllElements

      public void removeAllElements()
      Description copied from class: Element
      Removes all child elements from this element.

      Each child is unlinked and registered for DOM removal if the element is attached to a page.

      Overrides:
      removeAllElements in class Element<T extends StyledContainerElement<T>>
    • removeElement

      public void removeElement(String id)
      Description copied from class: Element
      Removes a child element by its ID.
      Overrides:
      removeElement in class Element<T extends StyledContainerElement<T>>
      Parameters:
      id - The ID of the child element to remove.
    • removeElement

      public void removeElement(Element child)
      Description copied from class: Element
      Removes a child element from this element.

      The child is unlinked from this parent and registered for DOM removal if the element is attached to a page.

      Overrides:
      removeElement in class Element<T extends StyledContainerElement<T>>
      Parameters:
      child - The child element to remove.