Previous Next

Bean Tester

Setting up Event Handling

The Bean Tester lets you connect an event generated by a bean (the source bean) to an event handling method in another bean (the target bean). For example, you can assemble a component with a button that can be pressed to cause another bean to do something.

The Bean Tester provides two ways to wire events: Layout mode and Visual Connect mode.

To set up event handling in Layout mode:

Connect Events Dialog

To set up event handling in Visual Connect mode:

Note: In Visual Connect mode, you can move any of the objects without affecting the underlying layout.

Once the connection is made, the Tester displays a wire showing you the beans you connected. The source event and target method are joined by an arrow (-->) indicating that this is an event connection. For example, in this figure, an actionPerformed (button pressed) even on the ExplicitButton cause the startJuggling method to be called on the Juggler bean:

Connecting Events in Visual Connect Mode

The Tester generates an adapter class to implement the event handling. After the adapter is generated, you can save the composite bean as a new bean that includes the event handling functionality.


Copyright © Taligent, Inc. 1996 - 1997.
Copyright
© IBM Corporation 1996 - 1997.
All Rights Reserved.