PenProfile 2.x

com.livescribe.event
Class Event

java.lang.Object
  extended by com.livescribe.event.Event
Direct Known Subclasses:
MenuEvent, PenletEvent

public class Event
extends Object

This is the base class for penlet and menu events.

Events can be marked as consumed by calling consume(). This is useful for when events are passed along a chain of handlers and those handlers that understand this concept can choose to respect this flag. This is useful, for example, when plugins need to diallow an event from propagating. Note that this is a flag used in an advisory fashion.


Field Summary
protected  boolean consumed
          Whether the event is marked as consumed.
 int eventId
          The event ID.
 
Constructor Summary
protected Event(int id)
          Creates a new event having the specified ID.
 
Method Summary
 void consume()
          Marks this event as consumed.
 int getId()
          Returns the event's ID, an integer.
 boolean isConsumed()
          Checks if this event is marked as consumed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

eventId

public final int eventId
The event ID.


consumed

protected boolean consumed
Whether the event is marked as consumed.

Since:
2.3
Constructor Detail

Event

protected Event(int id)
Creates a new event having the specified ID.

Parameters:
id - the event ID
Method Detail

getId

public int getId()
Returns the event's ID, an integer.

Returns:
the event's ID, an integer.

consume

public void consume()
Marks this event as consumed. This notifies other handlers down a processing chain not to process this event.

Since:
2.3
See Also:
isConsumed()

isConsumed

public boolean isConsumed()
Checks if this event is marked as consumed. Unless it has been set, the default is false.

Returns:
whether this event is marked as consumed.
Since:
2.3
See Also:
consume()

PenProfile 2.x

Copyright © 2010 Livescribe Inc. All Rights Reserved.
Confidential and subject to NDA.