Class NotificationEvent
- Direct Known Subclasses:
AttributeEvent
,ContentEvent
,ContentReplaceEvent
,CssEvent
,CssReloadedEvent
,CustomMsgEvent
,DisposeEvent
,ElementDeletedEvent
,ElementLocalizeEvent
,EncryptionEvent
,ExtendsEvent
,ExtensionPropertyDefinitionEvent
,LayoutChangedEvent
,LibraryEvent
,LibraryReloadedEvent
,NameEvent
,NameSpaceEvent
,PropertyEvent
,ResourceChangeEvent
,StyleEvent
,TemplateTransformEvent
,ThemeEvent
,UserPropertyEvent
,ValidationEvent
,ViewsContentEvent
A notification specifies the kind of change by its class. Subclasses provide additional context information appropriate for that specific event.
Notifications are routed to listeners though a number of delivery
paths. For example, a listener may hear about changes to an element
itself, to an ancestor element, to an associated style, and so on. Some
listeners may want to react differently depending on the element that
actually changed. The getDeliveryPath( )
method lets
the listener determine which path this event has taken.
Notifications are created in response to a model change. The UI that triggers the change can identify itself as the sender of the event. This allows the UI to ignore events that represent changes that it, itself, made. Using the sender attribute is purely optional, and is for the convenience of each particular bit of UI.
There are several constants defined in this class. Each of them is
corresponding to a kind of Event. When doing some operations, specified
command and record are invoked and the record will eventually send out a kind
of NotificationEvent, when calling the getEventType()
of the event,
the return value will be one of the constants defined here.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The event type of attributeEvent.static final int
Event is being sent to the elements that contains the current element.static final int
The event type of ContentEvent.static final int
The event type of CONTENT_REPLACE_EVENT.static final int
Event is being sent to the contents of the target.static final int
The event type of css CRUD eventstatic final int
The event type of css reload eventstatic final int
The event type of CustomMsgEvent.static final int
The event type of event that the data design is reloaded.static final int
The event type of DataMartPropertyEvent.protected int
The current delivery path for the notification.static final int
Event is being sent to the descendants of the object.static final int
Event is being sent to the listeners of the object itself.static final int
The event type of DISPOSE_EVENT.static final int
Event is being sent to the elements that use an element.static final int
The event type of ElementDeletedEvent.static final int
The event type of ELEMENT_LOCALIZE_EVENTstatic final int
The event type of encryption change event.static final int
The event type of ExtendsEvent.static final int
The event type of PropertyListEvent.static final int
The event type of LAYOUT_CHANGED_EVENT.static final int
The event type of LIBRARY_CHANGE_EVENTstatic final int
The event type of LibraryEventstatic final int
The event type of LIBRARY_RELOADED_EVENTstatic final int
The event type of NameEvent.static final int
Deprecated.since BIRT 2.1static final int
The event type of PrpertyEvent.protected Object
The sender of the event.static final int
Event is being sent to the elements that use a structure defined in report design.static final int
Event is being sent to elements that use a style.static final int
The event type of StyleEvent.protected org.eclipse.birt.report.model.core.DesignElement
The design element that changed.static final int
The event type of TEMPLATE_TRANSFORM_EVENT.static final int
The event type of THEME_EVENT.static final int
The event type of UserPropertyEvent.static final int
The event type of ValidationEventstatic final int
The event type of multiple views event. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.NotificationEvent
(org.eclipse.birt.report.model.core.DesignElement obj) Convenience constructor that specifies the target element. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the delivery path by which the event was sent to the listener.abstract int
Returns the event type.Returns the sender: the UI or other application object that caused the event to be sent.org.eclipse.birt.report.model.core.DesignElement
Returns the target element: the part of the design that actually changed.boolean
isSame
(NotificationEvent event) Compares and justifies whether this event and the given event is the same.void
setDeliveryPath
(int path) Sets the delivery path.void
Sets the sender based on the information provided to the command.void
setTarget
(org.eclipse.birt.report.model.core.DesignElement target) Sets the target element.
-
Field Details
-
CONTENT_EVENT
public static final int CONTENT_EVENTThe event type of ContentEvent.- See Also:
-
ELEMENT_DELETE_EVENT
public static final int ELEMENT_DELETE_EVENTThe event type of ElementDeletedEvent.- See Also:
-
EXTENDS_EVENT
public static final int EXTENDS_EVENTThe event type of ExtendsEvent.- See Also:
-
NAME_EVENT
public static final int NAME_EVENTThe event type of NameEvent.- See Also:
-
NAME_SPACE_EVENT
Deprecated.since BIRT 2.1The event type of NameSpaceEvent.- See Also:
-
PROPERTY_EVENT
public static final int PROPERTY_EVENTThe event type of PrpertyEvent.- See Also:
-
STYLE_EVENT
public static final int STYLE_EVENTThe event type of StyleEvent.- See Also:
-
USER_PROP_EVENT
public static final int USER_PROP_EVENTThe event type of UserPropertyEvent.- See Also:
-
CUSTOM_MSG_EVENT
public static final int CUSTOM_MSG_EVENTThe event type of CustomMsgEvent.- See Also:
-
EXTENSION_PROPERTY_DEFINITION_EVENT
public static final int EXTENSION_PROPERTY_DEFINITION_EVENTThe event type of PropertyListEvent.- See Also:
-
VALIDATION_EVENT
public static final int VALIDATION_EVENTThe event type of ValidationEvent- See Also:
-
LIBRARY_EVENT
public static final int LIBRARY_EVENTThe event type of LibraryEvent- See Also:
-
ATTRIBUTE_EVENT
public static final int ATTRIBUTE_EVENTThe event type of attributeEvent.- See Also:
-
DISPOSE_EVENT
public static final int DISPOSE_EVENTThe event type of DISPOSE_EVENT.- See Also:
-
LAYOUT_CHANGED_EVENT
public static final int LAYOUT_CHANGED_EVENTThe event type of LAYOUT_CHANGED_EVENT.- See Also:
-
THEME_EVENT
public static final int THEME_EVENTThe event type of THEME_EVENT.- See Also:
-
CONTENT_REPLACE_EVENT
public static final int CONTENT_REPLACE_EVENTThe event type of CONTENT_REPLACE_EVENT.- See Also:
-
TEMPLATE_TRANSFORM_EVENT
public static final int TEMPLATE_TRANSFORM_EVENTThe event type of TEMPLATE_TRANSFORM_EVENT.- See Also:
-
ELEMENT_LOCALIZE_EVENT
public static final int ELEMENT_LOCALIZE_EVENTThe event type of ELEMENT_LOCALIZE_EVENT- See Also:
-
LIBRARY_RELOADED_EVENT
public static final int LIBRARY_RELOADED_EVENTThe event type of LIBRARY_RELOADED_EVENT- See Also:
-
LIBRARY_CHANGE_EVENT
public static final int LIBRARY_CHANGE_EVENTThe event type of LIBRARY_CHANGE_EVENT- See Also:
-
CSS_RELOADED_EVENT
public static final int CSS_RELOADED_EVENTThe event type of css reload event- See Also:
-
CSS_EVENT
public static final int CSS_EVENTThe event type of css CRUD event- See Also:
-
ENCRYPTION_EVENT
public static final int ENCRYPTION_EVENTThe event type of encryption change event.- See Also:
-
VIEWS_CONTENT_EVENT
public static final int VIEWS_CONTENT_EVENTThe event type of multiple views event.- See Also:
-
DATA_DESIGN_RELOADED_EVENT
public static final int DATA_DESIGN_RELOADED_EVENTThe event type of event that the data design is reloaded.- See Also:
-
DATA_MART_PROPERTY_EVENT
public static final int DATA_MART_PROPERTY_EVENTThe event type of DataMartPropertyEvent.- See Also:
-
DIRECT
public static final int DIRECTEvent is being sent to the listeners of the object itself.- See Also:
-
DESCENDENT
public static final int DESCENDENTEvent is being sent to the descendants of the object. descendants are those that extend the target, directly or indirectly.- See Also:
-
STYLE_CLIENT
public static final int STYLE_CLIENTEvent is being sent to elements that use a style.- See Also:
-
CONTENTS
public static final int CONTENTSEvent is being sent to the contents of the target.- See Also:
-
ELEMENT_CLIENT
public static final int ELEMENT_CLIENTEvent is being sent to the elements that use an element.- See Also:
-
STRUCTURE_CLIENT
public static final int STRUCTURE_CLIENTEvent is being sent to the elements that use a structure defined in report design.- See Also:
-
CONTAINER
public static final int CONTAINEREvent is being sent to the elements that contains the current element.- See Also:
-
target
protected org.eclipse.birt.report.model.core.DesignElement targetThe design element that changed. -
sender
The sender of the event. This is generally the UI that made the change. This allows the UI to ignore, if it chooses, events that indicate changes that the that UI made itself. -
deliveryPath
protected int deliveryPathThe current delivery path for the notification. Updated as the event works though the delivery system.
-
-
Constructor Details
-
NotificationEvent
public NotificationEvent()Default constructor. -
NotificationEvent
public NotificationEvent(org.eclipse.birt.report.model.core.DesignElement obj) Convenience constructor that specifies the target element.- Parameters:
obj
- the target element.
-
-
Method Details
-
getDeliveryPath
public int getDeliveryPath()Returns the delivery path by which the event was sent to the listener.- Returns:
- the Delivery path. One of:
- DIRECT
- DESCENDENT
- STYLE_CLIENT
- CONTENTS
-
setDeliveryPath
public void setDeliveryPath(int path) Sets the delivery path. Called by the sender to indicate the context.- Parameters:
path
- the delivery path to set.
-
getSender
Returns the sender: the UI or other application object that caused the event to be sent. The UI component can use this to avoid responding to changes that the UI component itself caused.- Returns:
- the sender.
-
setSender
Sets the sender based on the information provided to the command.- Parameters:
sender
- the sender to set.
-
getTarget
public org.eclipse.birt.report.model.core.DesignElement getTarget()Returns the target element: the part of the design that actually changed.- Returns:
- the target.
-
setTarget
public void setTarget(org.eclipse.birt.report.model.core.DesignElement target) Sets the target element.- Parameters:
target
- the target element to set.
-
getEventType
public abstract int getEventType()Returns the event type. The following event types are defined:- CONTENT_EVENT
- ELEMENT_DELETE_EVENT
- EXTENDS_EVENT
- NAME_EVENT
- NAME_SPACE_EVENT
- PROPERTY_EVENT
- STYLE_EVENT
- USER_PROP_EVENT
- CUSTOM_MSG_EVENT
- EXTENSION_PROPERTY_DEFINITION_EVENT
- NOTIFICATION_EVENT
- VALIDATION_EVENT
- LIBRARY_EVENT
- ATTRIBUTE_EVENT
- DISPOSE_EVENT
- CONTENT_REPLACE_EVENT
- TEMPLATE_TRANSFORM_EVENT
- Returns:
- the event type.
-
isSame
Compares and justifies whether this event and the given event is the same.- Parameters:
event
- the event to compare- Returns:
- true if the two events are the same, otherwise false
-