Observer Class Template

The Class

The ExampleObserver class is intended to be used as the template for an observer.

API Documentation

Click HERE to view the API documentation for this class template. The complete documentation for all of the classes can be found in the API Reference.

Source Code

Click HERE to view the source for this class. This class does not include any code and it is intended to be used as a template for creating new observers.

Review the Class

Class Description

The theDescription$ private property must be set to a description for the new class.

Event Notification

The theNotificationFlag private property must be set to indicate the events that this observer will process. The values for this property can be one of the following:

_pvxConstants'_idePreProcess'
Register as a listener for pre-process events
_pvxConstants'_idePostProcess
Register as a listener for post-process events
_pvxConstants'_idePrePostProcess
Register as a listener for both pre-process and post-process events
_pvxConstants'_ideNone
Do not register as a listener; this is used for contributed tools

As long as the flag is not set to _pvxConstants'_ideNone, an preference will get added to the Contributed Extensions / Tools preference page to allow the user to enable use of the extension - the default value for this preference is disabled.

Do the Work

The update() method must be modified to add the logic that will be executed when the event has been triggered.

Event Arguments

The arguments that are passed into an event are generally the same for all events that share the same major ID. A summary of these arguments is listed later in this document.