The plug-in is organized around the processing of events that are triggered by user actions within the Eclipse Workbench. Most of the events will use logic that is written in both Java and ProvideX; some of these events are implemented entirely in Java.
A large number of events are triggered within the Eclipse Workbench. It is beyond the scope of this document to provide the details of these events and how to interact with them. Please see the Plug-in Development Environment Guide for documentation.
All events within the ProvideX Plug-in are organized using both major and minor code names. Most of the events do not use the minor code name.
Every event that is handled by the ProvideX Event Manager can be identified by major and a minor code names. The minor code name is not always required. Every major/minor code name can be referenced using a variable that is stored within the PvxConstants class.
The diagram (above) shows the name of the constant to be used to identify a specifc event. The name of the constant is derived by replacing "<event>" in the following reference "_pvxConstants'<event>$" with a name from the diagram.
For example, to refer to the event that is triggered when the user chooses to strip line numbers from the current program use the variable "_pvxConstants'strip_Line_No$". The mixed case for the varible name is intended to make the code more readable, it is not required to properly identify the variable.
The following is a simple example of ProvideX code that could be used to display a message when the user chooses to strip line numbers from the program. This example is based on the logic that can be found in the source file ExampleObserver.pvc included with the plug-in. A more complete explanation can be found in a later section of this document.
aPvxState=new("PvxState") psMajor$=aPvxState'getMajor$(), \ psMinor$=aPvxState'getMinor$() if psMajor$=_pvxConstants'strip_Line_No$ { print "The line numbers have been stripped from the program." }
This is not an actual implementation of an observer. It is simply a demonstration of how to identify the event and then execute logic that will add to the existing functionality of the plug-in.