Class HandlerInput<T>
- Type Parameters:
T- the runtime type of the value produced
- All Implemented Interfaces:
Serializable
event argument
(e.g. event.screenX for a DomEventTrigger).
Carries the trigger class the expression is valid for so that
Trigger.triggers(Action...) refuses to render an input meant for one
trigger family into the handler of an unrelated trigger (where the referenced
variable would not be in scope). Class-based scoping lets a single input
instance be exposed as a public static final field (see
MouseEventTrigger.EventData) and reused across every instance of the
owning class and its subclasses. Custom trigger families expose their event
state the same way: declare a HandlerInput per property instead of
subclassing Action.Input by hand.
For internal use only. May be renamed or removed in a future release.
- Since:
- 25.2
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionHandlerInput(String propertyName, Class<? extends Trigger> ownerClass) Creates an input that yieldsevent[propertyName]at fire time, valid in the handler of any trigger that is an instance ofownerClass. -
Method Summary
Modifier and TypeMethodDescriptionBuilds theJsFunctionthat yields this input's value when called.
-
Constructor Details
-
HandlerInput
Creates an input that yieldsevent[propertyName]at fire time, valid in the handler of any trigger that is an instance ofownerClass.- Parameters:
propertyName- the event property name, notnullownerClass- the trigger class the expression is valid for, notnull
-
-
Method Details
-
toJs
Description copied from class:Action.InputBuilds theJsFunctionthat yields this input's value when called. The function may takeeventas a runtime argument (declared by the subclass viaJsFunction.withArguments(String...)); inputs that don't needeventsimply omit the declaration and ignore the argument the caller passes.Public so that
Actionimplementations in any package can consume inputs they receive as parameters, not only inputs they created themselves.- Specified by:
toJsin classAction.Input<T>- Parameters:
trigger- the surrounding trigger this render is for, notnull- Returns:
- the input's JS function, not
null
-