Class Column

java.lang.Object
io.mindspice.simplypages.core.HtmlTag
io.mindspice.simplypages.layout.Column
All Implemented Interfaces:
Component

public class Column extends HtmlTag
Grid column for use inside Row.

Mutable and not thread-safe while being configured. Once configuration is complete, standard rendering reads the structure without changing it. Shared children and custom render overrides must also be safe to share.

  • Constructor Details

    • Column

      public Column()
      Creates a column element with its base layout class already present.
  • Method Details

    • create

      public static Column create()
      Creates a new column.
      Returns:
      new column
    • withWidth

      public Column withWidth(int width)
      Sets fixed column width in the 12-column layout system.
      Parameters:
      width - width token from 1 to 12
      Returns:
      this column
      Throws:
      IllegalArgumentException - when width is outside [1,12]
    • auto

      public Column auto()
      Sets auto-sized column behavior via col-auto.
      Returns:
      this column
    • fill

      public Column fill()
      Sets fill behavior via col-fill.
      Returns:
      this column
    • withId

      public Column withId(String id)
      Sets id attribute.
      Overrides:
      withId in class HtmlTag
      Parameters:
      id - element id
      Returns:
      this column
    • withClass

      public Column withClass(String className)
      Replaces class attribute with col <className>.
      Overrides:
      withClass in class HtmlTag
      Parameters:
      className - additional class token(s)
      Returns:
      this column
    • withChild

      public Column withChild(Component component)
      Appends a child component.
      Overrides:
      withChild in class HtmlTag
      Parameters:
      component - child component
      Returns:
      this column
    • withChildren

      public Column withChildren(Component... components)
      Appends each child component in argument order.
      Parameters:
      components - components to append
      Returns:
      this column
    • withAttribute

      public HtmlTag withAttribute(String name, String value)
      Adds or replaces an attribute, preserving the base col token when setting classes.
      Overrides:
      withAttribute in class HtmlTag
      Parameters:
      name - attribute name
      value - attribute value
      Returns:
      this column