Class Div

java.lang.Object
io.mindspice.simplypages.core.HtmlTag
io.mindspice.simplypages.components.Div
All Implemented Interfaces:
Component
Direct Known Subclasses:
Checkbox, EditableModule, RadioGroup

public class Div extends HtmlTag
Minimal fluent wrapper around an HTML div.

Mutable and not thread-safe. Each mutator updates this instance in place. Mutate within a request-scoped flow. For reuse, stop mutating and render as a stable structure with per-request slot/context values.

  • Constructor Details

    • Div

      public Div()
      Creates an empty div.
  • Method Details

    • withClass

      public Div withClass(String className)
      Adds class token(s) without replacing previously assigned classes.
      Overrides:
      withClass in class HtmlTag
      Parameters:
      className - class token(s)
      Returns:
      this div
    • withId

      public Div withId(String id)
      Sets id attribute.
      Overrides:
      withId in class HtmlTag
      Parameters:
      id - element id
      Returns:
      this div
    • withAttribute

      public Div withAttribute(String name, String value)
      Sets or replaces an attribute.
      Overrides:
      withAttribute in class HtmlTag
      Parameters:
      name - attribute name
      value - attribute value
      Returns:
      this div
    • withChild

      public Div withChild(Component component)
      Appends a child component.
      Overrides:
      withChild in class HtmlTag
      Parameters:
      component - child component
      Returns:
      this div