public final class ActionDataEvent extends ActionEvent
ActionEvent
. Actions that can be invoked
on a bean are
() represented as event handler properties
with EventHandler
that accepts ActionEvent
or its
ActionDataEvent
subclass.
Stick to ActionEvent
if it provides enough information. Use
this subclass if additional
information about the
event properties
or type-safe view of the event source
is needed.
ACTION, ANY
consumed, eventType, NULL_SOURCE_TARGET, target
source
Constructor and Description |
---|
ActionDataEvent(FXBeanInfo.Provider model,
Object source,
Object event)
Constructs new event.
|
Modifier and Type | Method and Description |
---|---|
<T> T |
getProperty(Class<T> as,
String name)
Obtains property of the event.
|
<T> T |
getSource(Class<T> as)
Obtains the source of the event.
|
copyFor, getEventType
getSource, toString
public ActionDataEvent(FXBeanInfo.Provider model, Object source, Object event)
private static void dispatchEvent(FXBeanInfo
.Provider bean,String
name) { finalFXBeanInfo
info = bean.getFXBeanInfo(); finalMap
<String
,EventHandlerProperty
> actions = info.getActions();EventHandlerProperty
property = actions.get(name); finalEventHandler
<? superActionDataEvent
> handler = property.getValue(); handler.handle(newActionDataEvent
(bean, 7, 13)); }
model
- provider of the FXBeanInfo
source
- source of the event, possibly same as model
event
- the event object to deliverpublic <T> T getSource(Class<T> as)
T
- type of the source that is requestedas
- class of the requested typeClassCastException
- when the requested type isn't correctCopyright © 2020. All rights reserved.