Bean Customization in Java Technology

Bean Customization in Java Technology
Bean Customization in Java Technology

A bean appearance and behaviour can be customised
at design time with ABT . But There are 2 ways

-> by using Property Editor
-> by using customizers

Property Editors: using property sheet

Event Adapter Classes
The BeanBox generates an adapter class that interposes between the event source and target. The adapter class implements the appropriate event listener interface (and so is the actual listener), catches the event fired by the button, and then calls the selected target Bean method. Here is the BeanBox-generated adapter class that interposes between the start button and the JugglerBean:

// Automatically generated event hookup file.

package tmp.sunw.beanbox;
import sunw.demo.juggler.Juggler;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class ___Hookup_1474c0159e implements
java.awt.event.ActionListener, java.io.Serializable {

public void setTarget(sunw.demo.juggler.Juggler t) {
target = t;
}

public void actionPerformed(java.awt.event.ActionEvent arg0) {
target.startJuggling(arg0);
}

private sunw.demo.juggler.Juggler target;
}

The adapter implements the ActionListener interface that you selected in the BeanBox’s Edit|Events menu. ActionListener declares one method, actionPerformed(), which is implemented by the adapter to call the target Bean method (startJuggling()) that you selected. The adapter’s setTarget() method is called by the BeanBox to set the actual target Bean, in this case Juggler. See section 6.7 of the JavaBeans specification for a complete discussion of event adapters.

Leave a Reply