JBuilder Enterprise Setup dialog concepts

General description

JBuilder provides an OpenTools API for adding a Setup page to the Enterprise Setup dialog that comes up when the user chooses Tools|Enterprise Setup.

This dialog brings up various custom Setup pages that can be used to let the user set up some custom tools that might be added to JBuilder. JBuilder itself uses this Setup mechanism for setting up CORBA, Application Servers, and Database Drivers. Although this menu is titled Enterprise Setup, it's available in both Enterprise and Professional versions, although only the Database Drivers Setup page is available from in the Professional version.

The basic process for adding your own Setup is to register a class that extends the Setup abstract class, and also to provide a class that extends either the SetupPropertyPage class or the NestingSetupPropertyPage class. These page classes are extensions of the PropertyPage class, and they are the ones that define the actual controls that will be used to provide the setup values.

The classes and interfaces that are used for the OpenTools Setup mechanism reside in the com.borland.jbuilder.ide package. They consist of:

Detailed description of feature/subsystem

Registering a Setup

To register a custom Setup, you must first extend the Setup abstract class, and define all of its abstract functions. You should then define an initOpenTools() method to register this class with the SetupManager as shown in the following example:
public static void initOpenTool(byte majorVersion, byte minorVersion) {
   SetupManager.registerSetup(new AppServerSetup()); 
} 
This adds a Setup that appears at the highest level tab list in the Enterprise Setup dialog. If you provide an optional second argument to registerSetup() that is the name of an existing Setup, the setup you register will appear as a tab underneath the existing Setup's tab. However, make sure that the existing Setup is one that provides a NestingSetupPropertyPage definition. Here is an example:
public static void initOpenTool(byte majorVersion, byte minorVersion) { 
   SetupManager.registerSetup(new IASSetup(), 
   AppServerSetup.APPSERVER_SETUP_NAME); 
} 
You must also provide a class that extends the SetupPropertyPage class, or the NestedPropertyPageClass. This class provides a JPanel with controls to display on its Setup page. This class should be instantiated and returned in the implementation of the getSetupPropertyPage() function in your extended Setup class. Here's an example:
public PropertyPage getSetupPropertyPage(final Browser browser) { 
  return new IASSetupPage(browser, getName()); 
} 

Defining a Setup

The functions you need to implement in your class that extends the Setup class are fairly simple:

Defining a SetupPropertyPage

SetupPropertyPage is an abstract class that extends the PropertyPage class; it requires you to implement two functions:

If you are extending NestingSetupPropertyPage, all you need to define is the getDescription() method and the subordinate pages will be added by the Setup internal mechanism.