de.intarsys.tools.event
Class Event

java.lang.Object
  extended by java.util.EventObject
      extended by de.intarsys.tools.event.Event
All Implemented Interfaces:
IEvent, java.io.Serializable
Direct Known Subclasses:
ActivatedEvent, AttributeChangedEvent, CancelEvent, CancelRequestedEvent, CreatedEvent, DeactivatedEvent, DestroyedEvent, OkEvent, OkRequestedEvent, PreferencesChangeEvent, RequestEvent, ResumedEvent, SelectionEvent, StartedEvent, StoppedEvent, StopRequestedEvent, SuspendedEvent

public class Event
extends java.util.EventObject
implements IEvent

Abstract superclass for event implementations.

See Also:
Serialized Form

Field Summary
protected  boolean consumed
          Flag if the event is already handled.
static EventType ID
           
static java.lang.Object ID_ALL
           
protected  boolean veto
          Flag if execution of the action that is announced by the event is interrupted by one of the listeners.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
Event(java.lang.Object source)
          Create a new event object.
 
Method Summary
 void consume()
          Indicate that this event does not need to be propagated any further as it is already processed by some listener.
 EventType getEventType()
          A type for this event.
 java.lang.String getName()
          A name for this event.
 boolean getRc()
           
 boolean isConsumed()
          true if this event is already consumed by some listener.
 boolean isVetoed()
          true if this event is already vetoed by some listener.
 void setRc(boolean value)
           
 void setVeto(boolean value)
           
 void veto()
          Indicate that the behavior associated with this event should not be performed by the source.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.intarsys.tools.event.IEvent
getSource
 

Field Detail

ID_ALL

public static final java.lang.Object ID_ALL

ID

public static final EventType ID

consumed

protected boolean consumed
Flag if the event is already handled.


veto

protected boolean veto
Flag if execution of the action that is announced by the event is interrupted by one of the listeners.

Constructor Detail

Event

public Event(java.lang.Object source)
Create a new event object.

Parameters:
source - The object that created the event.
Method Detail

consume

public void consume()
Description copied from interface: IEvent
Indicate that this event does not need to be propagated any further as it is already processed by some listener.

Specified by:
consume in interface IEvent

getEventType

public EventType getEventType()
Description copied from interface: IEvent
A type for this event.

Specified by:
getEventType in interface IEvent
Returns:
A type for this event.

getName

public java.lang.String getName()
Description copied from interface: IEvent
A name for this event.

Specified by:
getName in interface IEvent
Returns:
A name for this event.

getRc

public boolean getRc()

isConsumed

public boolean isConsumed()
Description copied from interface: IEvent
true if this event is already consumed by some listener.

Specified by:
isConsumed in interface IEvent
Returns:
true if this event is already consumed by some listener.

isVetoed

public boolean isVetoed()
Description copied from interface: IEvent
true if this event is already vetoed by some listener.

Specified by:
isVetoed in interface IEvent
Returns:
true if this event is already vetoed by some listener.

setRc

public void setRc(boolean value)

setVeto

public void setVeto(boolean value)

veto

public void veto()
Description copied from interface: IEvent
Indicate that the behavior associated with this event should not be performed by the source.

Specified by:
veto in interface IEvent