Package su.onno.ui
Record Class ActionSpec.Action
java.lang.Object
java.lang.Record
su.onno.ui.ActionSpec.Action
- Enclosing class:
ActionSpec
public static record ActionSpec.Action(String key, String label, String icon, String logo, String color, ActionScope scope, String menu, String navigateUrl, Function<ActionContext,ActionResult> handler, Function<ActionRow,String> iconFn, Function<ActionRow,String> labelFn, Predicate<ActionRow> visibleFn, Predicate<ActionRow> enabledFn, List<InputSpec.InputField> form, List<InputSpec.InputGroup> formGroups, InputSpec.ActionFormDialog formDialog, Function<ActionContext,ActionSpec.FormDefaults> formDefaultsFn, List<String> roles)
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. color is an optional
presentation hint for compact menu swatches such as status choices. iconFn,
labelFn, visibleFn and enabledFn are the optional per-record
overrides for a ActionScope.ROW or ActionScope.DETAIL action — any that are
non-null are evaluated against the ActionRow (a list row, or the loaded detail
record) as the surface renders.
-
Constructor Summary
ConstructorsConstructorDescriptionAction(String key, String label, String icon, String logo, String color, ActionScope scope, String menu, String navigateUrl, Function<ActionContext, ActionResult> handler, Function<ActionRow, String> iconFn, Function<ActionRow, String> labelFn, Predicate<ActionRow> visibleFn, Predicate<ActionRow> enabledFn, List<InputSpec.InputField> form, List<InputSpec.InputGroup> formGroups, InputSpec.ActionFormDialog formDialog, Function<ActionContext, ActionSpec.FormDefaults> formDefaultsFn, List<String> roles) Creates an instance of aActionrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncolor()Returns the value of thecolorrecord component.Returns the value of theenabledFnrecord component.final booleanIndicates whether some other object is "equal to" this one.form()Returns the value of theformrecord component.Returns the value of theformDefaultsFnrecord component.Returns the value of theformDialogrecord component.Returns the value of theformGroupsrecord component.handler()Returns the value of thehandlerrecord component.booleanWhether the form's opening values are computed server-side per open (formDefaults).booleanhasForm()Whether clicking must first collect the declared form fields (scalar or row group) in a modal dialog.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.menu()Returns the value of themenurecord component.Returns the value of thenavigateUrlrecord component.roles()Returns the value of therolesrecord 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, String color, ActionScope scope, String menu, String navigateUrl, Function<ActionContext, ActionResult> handler, Function<ActionRow, String> iconFn, Function<ActionRow, String> labelFn, Predicate<ActionRow> visibleFn, Predicate<ActionRow> enabledFn, List<InputSpec.InputField> form, List<InputSpec.InputGroup> formGroups, InputSpec.ActionFormDialog formDialog, Function<ActionContext, ActionSpec.FormDefaults> formDefaultsFn, List<String> roles) 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 componentcolor- the value for thecolorrecord componentscope- the value for thescoperecord componentmenu- the value for themenurecord 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 componentform- the value for theformrecord componentformGroups- the value for theformGroupsrecord componentformDialog- the value for theformDialogrecord componentformDefaultsFn- the value for theformDefaultsFnrecord componentroles- the value for therolesrecord component
-
-
Method Details
-
isServer
public boolean isServer() -
hasForm
public boolean hasForm()Whether clicking must first collect the declared form fields (scalar or row group) in a modal dialog. -
hasDynamicForm
public boolean hasDynamicForm()Whether the form's opening values are computed server-side per open (formDefaults). -
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
-
color
Returns the value of thecolorrecord component.- Returns:
- the value of the
colorrecord 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
-
form
Returns the value of theformrecord component.- Returns:
- the value of the
formrecord component
-
formGroups
Returns the value of theformGroupsrecord component.- Returns:
- the value of the
formGroupsrecord component
-
formDialog
Returns the value of theformDialogrecord component.- Returns:
- the value of the
formDialogrecord component
-
formDefaultsFn
Returns the value of theformDefaultsFnrecord component.- Returns:
- the value of the
formDefaultsFnrecord component
-
roles
Returns the value of therolesrecord component.- Returns:
- the value of the
rolesrecord component
-