-
Notifications
You must be signed in to change notification settings - Fork 19
CancelEvent
DaanVanYperen edited this page Sep 15, 2014
·
1 revision
Implement Cancellable interface.
public class CancellableEvent implements Event, Cancellable {
private boolean cancelled;
public boolean isCancelled() { return cancelled; }
public void setCancelled(boolean value) { cancelled = value; }
}
Toggle cancelled on event.
@Subscribe
public void handleMyEvent( CancellableEvent event ) {
event.setCancelled(true);
}
/** Will not be called by cancelled event. */
@Subscribe(ignoreCancelledEvents=true)
public void handleMyEvent( CancellableEvent event ) { .. }