Previous | Next |
Use the User Events panel to define events that are unique to your component. The User Events panel contains two nested panels::
You enter a name and press the Add Event>> button, and the wizard defines an event class by appending "Event" to the string you specify.
You can remove events that are added in the current session by returning to the User Events->Create Events panel, select the event you want to remove, and pressing the Remove button. However if you are modifying an existing project, you cannot use the wizard to remove events that were added in an earlier session.You must do this manually.
Use the Wire Events panel to identify the source and sink(s) for each type of event you define. The Event drop-down menu contains each event you defined in the Create Events panel. The Event Source and Event Sink(s) lists show all the classes in the project that can act as a source or a sink, respectively.
The class that you identify as the source for an event will have methods that handle registration of listeners for that type of event, and that create an event object and notify those listeners whenever the event occurs. To implement event notification, you need to call the AddListener method in the source class once for each event sink, passing an instance of the sink class as an argument. This is done automatically for model, view, and controller classes, but not for other classes you define.
The classes that you identify as the sink for an event implement the listener interface for that type of event, including the method that is called when the event occurs. The Wizard generates skeletal code for this method that you complete as necessary. You can identify multiple sinks for an event.
Select another tab to define other aspects of the component. Press the Next>> button to go to the code generation panel.
Previous | Next |
Copyright ©
Taligent, Inc. 1996 - 1997.
Copyright © IBM Corporation 1996 - 1997.
All Rights Reserved.