public class EventContext extends Object
Encapsulates a context in which an ActionNode
's event is fired. The context
includes the Component that the event originated from, the Entity
that the
event relates to (usually the value obtained from EntityView.getEntity()
of the
view in which the event is fired), and the ActionNode
that the event pertains to.
Constructor and Description |
---|
EventContext() |
EventContext(Entity entity,
Component source,
ActionNode action) |
Modifier and Type | Method and Description |
---|---|
EventContext |
copyWithNewAction(ActionNode action) |
ActionNode |
getAction() |
Entity |
getEntity() |
Component |
getEventSource() |
Object |
getExtra(Object key) |
Iterable |
getExtraDataKeys() |
boolean |
hasExtraData() |
void |
putExtra(Object key,
Object val) |
void |
setAction(ActionNode action) |
void |
setEntity(Entity entity) |
void |
setEventSource(Component eventSource) |
public EventContext(Entity entity, Component source, ActionNode action)
public EventContext()
public EventContext copyWithNewAction(ActionNode action)
public Entity getEntity()
public void setEntity(Entity entity)
entity
- the entity to setpublic Component getEventSource()
public void setEventSource(Component eventSource)
eventSource
- the eventSource to setpublic ActionNode getAction()
public void setAction(ActionNode action)
action
- the action to setpublic Iterable getExtraDataKeys()
public boolean hasExtraData()
Copyright © 2021. All Rights Reserved.