Control Projects and Packaging

 <  Day Day Up  >  

You've learned about control projects in previous chapters. In general, projects are a packaging mechanism for grouping similar functionality. Control projects are principally designed to contain control implementations and generate a JAR file that can be shared by other applications.

To create a project, select the root of your application in the Application pane, right-click it, and choose New, Project to open the New Project dialog box (see Figure 8.2). Try creating a control project and an EJB project. In Figure 8.2, (A) represents all the possible project types, with the All option selected by default. (B) represents the possible project types within the selected category. (C) represents the name of the project and is displayed as a top-level directory in the application.

Figure 8.2. The New Project dialog box.

graphics/08fig02.gif

Control projects can contain folders, which represent package names in the generated JAR file. This chapter's Shop Talk discusses a naming convention to use with projects to avoid package and class name clashes . On disk, a project is simply a directory; however, when it's built, a project generates a JAR file that's placed into the APP-INF\lib directory of the application. The JAR file can be used by other applications by simply dragging and dropping it into the application's Libraries folder.

The real power of control projects]md]and other projects, for that matter ”comes from their packaging. WebLogic Workshop provides a number of properties related to control projects for specifying how controls are added to an application. Figure 8.3 shows some of the control properties within a project ”the jc-jar properties. They are used for many of the GUI display elements of a control; Table 8.3 describes some of these properties.

Figure 8.3. Control properties.

graphics/08fig03.gif

Table 8.3. Control Properties

PROPERTY

USE

jc-jar/label

Name displayed in the application's Data Palette.

jc-jar/description

Popup control description.

jc-jar/ group -name

The name of the group this control will be displayed in when selected in Workshop's Add Control dialog box.

jc-jar/icon-16 and j c-jar/icon-32

Path to the icon to be displayed with this control ”for example, images/icons/myctr016.gif .

jc-jar/display-in-palette

Indicates whether this control will be displayed in the application's Data Palette. Set to false for controls that are used only as support within a project.

The insert-wizard-class property defines a fully qualified path to a class that implements a custom dialog box, which can be used to gather information the actual control requires. The Control Developer's Kit contains a complete example of how to implement an insert wizard. This example has been packaged in the chapter08 source under the chapter08Controls\insertwizard folder on the CD accompanying this book. Figure 8.4 shows the specialized Insert dialog box the insert-wizard-class property generates when it's added by selecting Controls, Add, Insert Wizard, ServerCheck from the Data Palette. The fields shown in the Step 2 section of the Insert dialog box are all custom defined by the developer.

Figure 8.4. The custom Insert dialog box.

graphics/08fig04.gif

 <  Day Day Up  >  


BEA WebLogic Workshop 8.1 Kick Start
BEA WebLogic Workshop 8.1 Kick Start: Simplifying Java Web Applications and J2EE
ISBN: 0672326221
EAN: 2147483647
Year: 2004
Pages: 138

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net