3.1.3 Implementing Custom Adapter Wizard Pages

All adapter wizard pages must extend techAdapterWizardPage (which inherits from Jpanel).

The page constructors must invoke setContextAndPage() which adds the page to the Wizard and sets up other context information that is needed. See the example in oracle.tip.tools.ide.pm.wizard.adapter.custom.CustomConnectionPage.java

When the user chooses the Finish button, the Adapter Framework invokes the buildDataModel() method on each wizard page in the same order that the pages were displayed. The buildDataModel() method is responsible for copying its screen data to the data model. You can do this simply with code similar to the following:

JcaDataInterface jdata = (JcaDataInterface)getDataModel();
jdata.setProperty(propname,screenField.getText().trim());

The JcaAdapterContext is available on all pages. It has many accessor methods for obtaining useful information. Following is a partial list of accessors that will be commonly used by wizard pages:

Table 3-2 JcaAdapterContext Accessor Methods

Accessor Method Notes

Object getAdapterSpecificContext();

The Adapter context object.

JcaDataInterface getDataModel();

Obtains the data model

Project getProject();

Obtains the jdeveloper Project object that is needed for most jdev interactions. It contains the project name also.

Frame getAdapterFrame();

This returns a Frame object that is required when invoking new dialogs or pop-up error messages.

Frame getAdapterFrame();

This returns a Frame object that is required when invoking new dialogs or pop-up error messages.

boolean isUpdateMode();

Indicates that an existing Adapter is being updated

String getServiceName();

Obtains a service name

String getServiceType();

Obtains a service type

WsdlInfo getExistingWsdlInfo();

Null if the existing WSDL is not selected. This would be the WsdlInfo for the Wsdl/porttype the user selected on the WsdlSelectionPage.

String getOperationName();

Obtains an Operation name

Boolean isInbound();

True if the adapter is inbound (Read, Get)

Connection getConnection();

Obtains a connection for adapters that use a connection object, like the Database adapter.

See the oracle.tip.tools.ide.pm.wizard.adapter.custom.CustomPropertiesPage.java for an example of a wizard page developed from scratch.