Package com.onec.ui

Class ActionRow

java.lang.Object
com.onec.ui.ActionRow

public final class ActionRow extends Object
A read-only view of one list row, handed to the per-row functions of a row action (.icon(...), .label(...), .visibleWhen(...), .enabledWhen(...)) so a single control can vary by that row's state — a pause "Suspend" on a running record flipping to a play "Resume" when it's stopped, or a button shown only on the rows it applies to.

It wraps the resolved row the list already computed (the same shape the grid renders), so no extra query runs: raw attribute values plus the resolved _display strings refs and enums carry. Read a field with text(String) (the human/display value — for an enum this is the constant name), enumValue(String, Class) (typed back to your enum), or get(String) (the raw stored value). All lookups are case-insensitive.

 a.action("toggle").scope(ActionScope.ROW)
  .icon(row -> row.enumValue("status", Status.class) == Status.STOPPED ? "play" : "pause")
  .label(row -> row.enumValue("status", Status.class) == Status.STOPPED ? "Resume" : "Suspend")
  .handler(ctx -> ...);
 
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    <E extends Enum<E>>
    E
    enumValue(String column, Class<E> enumType)
    column resolved back to a constant of enumType (matched on the enum's name, the value text(String) returns for an enum column), or null if empty/unmatched.
    get(String column)
    The raw stored value of column (a ref/enum reads back as its UUID), or null.
    id()
    This row's id (_id), or null if absent/unparseable.
    text(String column)
    The display string of column: the resolved {column}_display (a ref's label, an enum's constant name) when present, else the raw value as text, else "" — never null.
    The underlying row map (resolved values keyed by column) — an escape hatch for ad-hoc reads.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • id

      public UUID id()
      This row's id (_id), or null if absent/unparseable.
    • get

      public Object get(String column)
      The raw stored value of column (a ref/enum reads back as its UUID), or null.
    • text

      public String text(String column)
      The display string of column: the resolved {column}_display (a ref's label, an enum's constant name) when present, else the raw value as text, else "" — never null.
    • enumValue

      public <E extends Enum<E>> E enumValue(String column, Class<E> enumType)
      column resolved back to a constant of enumType (matched on the enum's name, the value text(String) returns for an enum column), or null if empty/unmatched.
    • values

      public Map<String,Object> values()
      The underlying row map (resolved values keyed by column) — an escape hatch for ad-hoc reads.