Package com.onec.ui
Record Class ActionSpec.Action
java.lang.Object
java.lang.Record
com.onec.ui.ActionSpec.Action
- Enclosing class:
ActionSpec
public static record ActionSpec.Action(String key, String label, String icon, String logo, ActionScope scope, String navigateUrl, Function<ActionContext,ActionResult> handler, Function<ActionRow,String> iconFn, Function<ActionRow,String> labelFn, Predicate<ActionRow> visibleFn, Predicate<ActionRow> enabledFn)
extends Record
A resolved action button. Exactly one of
navigateUrl / handler is set.
icon/label are the fixed values (and the fallback). logo is an
optional image URL/path shown in place of the lucide icon — a brand mark ("Connect
with X"), rendered on page-action and list/row/toolbar buttons. iconFn,
labelFn, visibleFn and enabledFn are the optional per-row overrides
for a ActionScope.ROW action — any that are non-null are evaluated against each
ActionRow when the list renders.
-
Constructor Summary
ConstructorsConstructorDescriptionAction(String key, String label, String icon, String logo, ActionScope scope, String navigateUrl, Function<ActionContext, ActionResult> handler, Function<ActionRow, String> iconFn, Function<ActionRow, String> labelFn, Predicate<ActionRow> visibleFn, Predicate<ActionRow> enabledFn) Creates an instance of aActionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theenabledFnrecord component.final booleanIndicates whether some other object is "equal to" this one.handler()Returns the value of thehandlerrecord component.final inthashCode()Returns a hash code value for this object.icon()Returns the value of theiconrecord component.iconFn()Returns the value of theiconFnrecord component.booleanWhether any aspect of this action varies per row (so the list must resolve it per row).booleanisServer()key()Returns the value of thekeyrecord component.label()Returns the value of thelabelrecord component.labelFn()Returns the value of thelabelFnrecord component.logo()Returns the value of thelogorecord component.Returns the value of thenavigateUrlrecord component.scope()Returns the value of thescoperecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thevisibleFnrecord component.
-
Constructor Details
-
Action
public Action(String key, String label, String icon, String logo, ActionScope scope, String navigateUrl, Function<ActionContext, ActionResult> handler, Function<ActionRow, String> iconFn, Function<ActionRow, String> labelFn, Predicate<ActionRow> visibleFn, Predicate<ActionRow> enabledFn) Creates an instance of aActionrecord class.- Parameters:
key- the value for thekeyrecord componentlabel- the value for thelabelrecord componenticon- the value for theiconrecord componentlogo- the value for thelogorecord componentscope- the value for thescoperecord componentnavigateUrl- the value for thenavigateUrlrecord componenthandler- the value for thehandlerrecord componenticonFn- the value for theiconFnrecord componentlabelFn- the value for thelabelFnrecord componentvisibleFn- the value for thevisibleFnrecord componentenabledFn- the value for theenabledFnrecord component
-
-
Method Details
-
isServer
public boolean isServer() -
isDynamic
public boolean isDynamic()Whether any aspect of this action varies per row (so the list must resolve it per row). -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
label
Returns the value of thelabelrecord component.- Returns:
- the value of the
labelrecord component
-
icon
Returns the value of theiconrecord component.- Returns:
- the value of the
iconrecord component
-
logo
Returns the value of thelogorecord component.- Returns:
- the value of the
logorecord component
-
scope
Returns the value of thescoperecord component.- Returns:
- the value of the
scoperecord component
-
handler
Returns the value of thehandlerrecord component.- Returns:
- the value of the
handlerrecord component
-
iconFn
Returns the value of theiconFnrecord component.- Returns:
- the value of the
iconFnrecord component
-
labelFn
Returns the value of thelabelFnrecord component.- Returns:
- the value of the
labelFnrecord component
-
visibleFn
Returns the value of thevisibleFnrecord component.- Returns:
- the value of the
visibleFnrecord component
-
enabledFn
Returns the value of theenabledFnrecord component.- Returns:
- the value of the
enabledFnrecord component
-