Next |
The Bean Wizard provides a way for you to easily generate basic code for most of the objects you need to build a Bean Works component. Like other Java development environments, the wizard deals with each Java program as a project, collecting all the necessary files together into their own directory. This reentrant wizard lets you create new application projects or modify existing projects, and provides a simple GUI interface for:
Currently you can only use the wizard to extend
existing projects, for example, to add new classes or interfaces.
You cannot use the wizard to modify already generated code.
Click on any of the following steps for additional information or to see the associated wizard panel. You can also browse through all of the steps by following the browse sequence at the top or bottom of the page.
Launch the wizard from the WebRunner Bean Tools program group, or by typing wizard at the command prompt. On the first screen, you specify whether you want to create a new project or open an existing project.
If you are a VisualAge for Java user, see Using Bean Tools with VisualAge for Java for information on running the wizard from within VisualAge.
Setting up or loading a project
To set up a new project, fill in a name. The wizard creates default package, model, view, and controller names and a three-letter file extension based on the name you enter, and creates a project folder in your default directory.
To load an existing project, select it from the drop-down list and press the Load Project button.
The project options screen lets you specify additional characteristics of your component such as whether it includes customized menus and whether it supports data exchange operations via the clipboard. You can also specify a component icon on this screen that is used to represent your bean in building tools such as the Bean Tester.
The Interfaces panel lets you specify names of new interfaces you want to introduce to the project. Use the Methods panel to add methods to these interfaces.
The Classes panel lets you define additional classes you want to add to the project. You can declare the class visibility and base class, and choose to implement any interfaces you defined in the Interfaces panel.
The Properties panel lets you add properties to any class in the project. You specify whether you want accessor methods for the property, as well as whether the property is transient and the type of notification generated by a change to the property's value.
The Methods panel lets you add methods to any class or interface in the project. You specify the visibility and return type of the method, as well as any parameters the method takes.
The Java Events panel lets you specify that you want a class in your project to be a listener for one of the standard Java AWT events, including mouse, key, and window events.
The User Events panel lets you specify special events for your component, and identify the source and target objects for each event. The wizard generates an event class and an event listener interface for each event you define. After generating your project code, you can use these classes to implement the notification mechanism and the correct event handling for each target.
The Commands panel lets you specify any command classes you want to include in the project. You specify the command name, and the wizard generates skeletal code for a serially undoable command. You override the Command class's handleDo, handleUndo, and handleRedo methods to implement the functionality of the command.
The final wizard panel lets you generate and preview code for each of the classes and interfaces you have defined. You can preview code for individual files, or generate the code for all files. After generating code, you can compile and run it, or add more code using any code editor.
Note that if you are modifying an existing project, you cannot use the wizard to remove items that were added in an earlier session.You must do this manually. You can use the wizard to add new code. However items that are added within the same session can be removed.
Caution: The code generated by the wizard contains comments lines that are used if you reload the project into the wizard. These comments have the form //[append XXX]. Do NOT remove these lines from your source code. The wizard also generates a WizGen.java file that you must not remove if you want to open the project with the wizard later.
Next |
Copyright ©
Taligent, Inc. 1996 - 1997.
Copyright © IBM Corporation 1996 - 1997.
All Rights Reserved.