public static class EntityList.VetoableEntityEvent extends EntityList.EntityEvent
A type of entity event which is fired before the add/remove occurs, and allows the listener to veto/cancel the add/remove.
This event type can be handy if you need to be notified of a change before it is made, if, for
example you need to know the state of the list before the change. This is used by the PropertySelector
to detect when sub-properties may have been invalidated because a parent entity has been removed from a list.
ActionEvent.Type
Constructor and Description |
---|
VetoableEntityEvent(EntityList source,
Entity entity,
int index) |
Modifier and Type | Method and Description |
---|---|
String |
getReason()
Gets the reason for the veto, or null, if no veto was made.
|
boolean |
isVetoed()
Checks if the add/remove has been vetoed.
|
void |
veto(String reason)
Veto the add/remove.
|
getEntity, getIndex, getTransaction, setTransaction
as
consume, getActualComponent, getCommand, getComponent, getDraggedComponent, getDropTarget, getEventType, getKeyEvent, getProgress, getSource, getX, getY, isConsumed, isLongEvent
public VetoableEntityEvent(EntityList source, Entity entity, int index)
Copyright © 2021. All Rights Reserved.