Class RowActionEnabledRule
RowAction on the row's own state, in the
VIEW_META wire contract.
Mirrors org.apache.juneau.console.widgets.ActionRef.EnabledRule on a detail-panel
action bar, but rides the wire as a plain data rule the same way a row-class
rule does — a table row is polled/client-rendered rather than server-painted, so this type follows
that wire shape, not ActionRef.EnabledRule's Java-only one. Serializes to
op carrying Op.wire()'s
lowercase token (a String), not the Java enum.
The eq/ne operators require a value; the present/absent operators test only whether row[field] is non-null/non-empty and
therefore omit value from the wire.
Presentation only, never the authorization gate:
A row whose field does not satisfy this rule renders its RowAction present but disabled, carrying
reason as a tooltip and aria-describedby text. The endpoint behind the action must still
perform its own real check and refuse on its own authority; this rule is never a substitute for that check.
See Also:
- Since:
- 10.0.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
field
The row field this rule tests. -
op
The wire token of the comparison operator (seeOp.wire()). -
value
The comparison value foreq/ne; omitted forpresent/absent. -
reason
Why the action is unavailable when this rule does not match. Required — must not be blank.
-
-
Constructor Details
-
RowActionEnabledRule
public RowActionEnabledRule()
-
-
Method Details
-
of
- Parameters:
field- The row field to test. Must not benull or blank.op- The operator. Must beOp.EQorOp.NE.value- The comparison value. Must not benull .reason- Why the action is unavailable when this rule does not match. Must not benull or blank.- Returns:
- A new
RowActionEnabledRule. - Throws:
IllegalArgumentException- Iffield/reasonisnull or blank,opis not value-based, orvalueisnull .
-
of
- Parameters:
field- The row field to test. Must not benull or blank.op- The operator. Must beOp.PRESENTorOp.ABSENT.reason- Why the action is unavailable when this rule does not match. Must not benull or blank.- Returns:
- A new
RowActionEnabledRulewith novalue. - Throws:
IllegalArgumentException- Iffield/reasonisnull or blank, oropis value-based.
-