Oracle Developer 6.0

Pluggable Java Components - The BeanArea


This directory contains an example of a Pluggable Java Component called the BeanArea. The BeanArea is a generic Pluggable Java Component that can instantiate and display any Java class from within an Oracle Form. Using the BeanArea alleviates the need to write a Java wrapper class around a Java class in order to insert it into an Oracle Form. This BeanArea is a prototype of functionality that may be included in a future release of Forms.


The Javadoc generated documentation for the BeanArea PJC is here.


The BeanArea can be controlled from Oracle Forms PL/SQL code using the SET_CUSTOM_ITEM_PROPERTY builtin.


To use the Bean, drop a BeanArea Item onto a Canvas. Set the implementation class of the BeanArea item to be oracle.demo.BeanArea.


The BeanArea PJC provides a method called 'name' which allows the Java class name to be specified. This can be done from PL/SQL using the SET_CUSTOM_ITEM_PROPERTY builtin. An example of this is SET_CUSTOM_ITEM_PROPERTY('BEAN_ITEM1','name','java.awt.TextField').


Once the name of the Java class is specified, the BeanArea PJC performs introspection on the specified Java class to find all the public getter/setter method and registers Forms properties for these. This means that all of the Java class methods may be called from the Oracle Forms builtin, SET_CUSTOM_ITEM_PROPERTY. An example of this is to set the value of the text in the Java class specified above SET_CUSTOM_ITEM_PROPERTY('BEAN_ITEM1','text','I am a Heavy TextField').

The BeanArea also manages the interaction between Java lightweight components and the Java heavyweight components, enabling them to be displayed correctly in the same Java window.


This directory contains the Java source code for the BeanArea as well as an example Form that demonstrates the use of the BeanArea PJC. The Forms uses the WHEN-NEW-FORM-INSTANCE trigger to configure and set some initial properties for the included JavaBeans. Also, the form contains an instance of a heavyweight Java component to show how the BeanArea PJC intelligently manages the interaction of heavyweight and lightweight components.


To compile the Java source code, you must have a Java Development Kit (JDK) installed on your computer. The JDK can be downloaded free of charge from JavaSoft. The BeanArea can then be compiled using the standard JDK compiler, javac.


To successfully compile the BeanArea, the Forms class libraries must be placed into the CLASSPATH environment variable which is used by the Java compiler to find external classes.


Once you have successfully compiled the Java source code, the Java classes must be placed into the Oracle Forms Java directory which is located at ORACLE_HOME/forms60/java. Be sure to keep the classes in the same directory structure when you copy them over.


Oracle Corporation 1999
Last Change 02/18/99