Package com.onec.ui
Class ActionRow
java.lang.Object
com.onec.ui.ActionRow
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 -
Method Summary
Modifier and TypeMethodDescription<E extends Enum<E>>
Ecolumnresolved back to a constant ofenumType(matched on the enum's name, the valuetext(String)returns for an enum column), ornullif empty/unmatched.The raw stored value ofcolumn(a ref/enum reads back as its UUID), ornull.id()This row's id (_id), ornullif absent/unparseable.The display string ofcolumn: the resolved{column}_display(a ref's label, an enum's constant name) when present, else the raw value as text, else""— never null.values()The underlying row map (resolved values keyed by column) — an escape hatch for ad-hoc reads.
-
Constructor Details
-
ActionRow
-
-
Method Details
-
id
This row's id (_id), ornullif absent/unparseable. -
get
The raw stored value ofcolumn(a ref/enum reads back as its UUID), ornull. -
text
The display string ofcolumn: 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
columnresolved back to a constant ofenumType(matched on the enum's name, the valuetext(String)returns for an enum column), ornullif empty/unmatched. -
values
The underlying row map (resolved values keyed by column) — an escape hatch for ad-hoc reads.
-