Module VirtualizedFX
Class EventAction<E extends Event>
java.lang.Object
io.github.palexdev.virtualizedfx.controls.behavior.actions.EventAction<E>
- All Implemented Interfaces:
DisposableAction
An
EventAction
is a convenience bean which implements DisposableAction
used by BehaviorBase
to register an EventHandler
on a certain Node
for
a certain EventType
, and dispose it once it's not needed anymore.
This bean also has a boolean flag to indicate whether this should be registered as a handler or a filter.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEventAction
(Node node, EventType<E> eventType, EventHandler<E> handler) EventAction
(Node node, EventType<E> eventType, EventHandler<E> handler, boolean isFilter) -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Disposes this action.static <E extends Event>
EventAction<E>filter
(Node node, EventType<E> et, EventHandler<E> handler) Equivalent toEventAction(Node, EventType, EventHandler, boolean)
but this also registers the action on the node already.getNode()
static <E extends Event>
EventAction<E>handler
(Node node, EventType<E> et, EventHandler<E> handler) Equivalent toEventAction(Node, EventType, EventHandler)
but this also registers the action on the node already.boolean
isFilter()
-
Field Details
-
isFilter
protected boolean isFilter
-
-
Constructor Details
-
EventAction
-
EventAction
-
-
Method Details
-
handler
public static <E extends Event> EventAction<E> handler(Node node, EventType<E> et, EventHandler<E> handler) Equivalent toEventAction(Node, EventType, EventHandler)
but this also registers the action on the node already. -
filter
public static <E extends Event> EventAction<E> filter(Node node, EventType<E> et, EventHandler<E> handler) Equivalent toEventAction(Node, EventType, EventHandler, boolean)
but this also registers the action on the node already. -
dispose
public void dispose()Disposes this action. Removes the handler from the node, then sets all the fields to null.- Specified by:
dispose
in interfaceDisposableAction
-
getNode
-
getEventType
-
getHandler
-
isFilter
public boolean isFilter()
-