org.bushe.swing.event
Interface VetoEventListener


public interface VetoEventListener

Interface for classes that can veto class-based event publication from the EventService.

Author:
Michael Bushe michael@bushe.com

Method Summary
 boolean shouldVeto(java.lang.Object event)
          Determine whether an event should be vetoed or published.
 

Method Detail

shouldVeto

boolean shouldVeto(java.lang.Object event)
Determine whether an event should be vetoed or published.

The EventService calls this method before class-based publication of objects. If any of the VetoEventListeners return true, then none of the subscribers for that event are called.

Prequisite: VetoEventListener has to be subscribed with the EventService for the event object's class.

Guaranteed to be called in the SwingEventThread when using the SwingEventService (EventBus). See EventService

Parameters:
event - The event object to veto or allow to be published.
Returns:
true if the event should be vetoed and not published, false if the event should be published.