# What's new in JBuilder 6

JBuilder 6 has several new features and customer-requested enhancements of existing features. These include:

- Visualizing code with UML
- Refactoring
- Unit testing features
- Javadoc support
- Compiling
- Debugging
- Deployment
- Enterprise JavaBean development
- Team Development enhancements
- IDE enhancements
- Web Development enhancements

JBuilder is tested on Solaris, Linux, and Windows XP, NT, and 2000. JBuilder is hosted on JDK version 1.3 to take advantage of its debugging capabilities and enhanced client-side performance.

## Visualizing code with UML

> This is a feature of JBuilder Enterprise.

JBuilder, rather than replace the many available UML design tools, focuses on code visualization and UML diagramming specific to the Java language. UML functionality in JBuilder allows you to visually browse packages and classes in order to help you better design, understand, and troubleshoot your application development process.

Two UML diagrams are available in JBuilder:

- Limited package dependency diagrams
- Combined class diagrams

JBuilder's UML browser provides access to such features as:

- Navigating UML diagrams
- Finding references
- Viewing source code
- Viewing Javadoc
- Refactoring
- Filtering of diagrams
- Customizing diagram display
- Including references from libraries
- Saving diagrams as images
- Printing diagrams

See "Visualizing code with UML" in Building Applications with JBuilder for more information.

## Refactoring

> This is a feature of JBuilder Professional and Enterprise.

JBuilder provides two types of refactorings: rename refactor and move refactor. JBuilder also provides import handling features, which are addressed in "IDE Enhancements."

Rename refactoring applies a new name to a package, class, method, field, local variable, or property, ensuring that all references to that name are correctly handled. Rename refactoring a constructor renames the class.

Move refactoring, only available for classes, moves a specified class to a new package. Move refactoring is only allowed on a top-level public class.

You can access JBuilder's refactoring features from both the editor and a UML package or class diagram:

- Rename refactoring for classes, methods, and variables, as well as move refactoring for classes, is available from both areas.
- Rename refactoring for properties, a feature of JBuilder Enterprise, is only available from a UML class diagram.
- Rename refactoring for packages, a feature of JBuilder Enterprise, is only available from a UML package or class diagram.

Before a rename or move refactoring, you can view, by category, all locations in the current project where the selected symbol is referenced. You can also navigate to the symbol's definition. Additionally, you can view all potential changes in source files.

If JBuilder can't complete the refactoring, the IDE provides warning and error messages to help explain why. Warnings don't stop the refactoring. However, if an error is encountered, the refactoring is prevented.

For information about refactoring in JBuilder, see "Refactoring code symbols" in Building Applications with JBuilder.

## Unit testing features

> This is a feature of JBuilder Enterprise.

JBuilder's unit testing features integrate JUnit into JBuilder's IDE and provide tools for writing unit tests and organizing them into test suites, running tests, analyzing tests, and debugging tests. JBuilder provides a set of predefined test fixtures for performing common tasks that your tests may require. JBuilder's JBTestRunner offers a way to run tests that combines both text and GUI output. JBuilder includes the following unit testing features:

- Test Case wizard - Generates skeleton test cases.
- Test Suite wizard - Generates test suites.
- JDBC Fixture - Manages JDBC connections used in your tests.
- JNDI Fixture - Performs JNDI lookups.
- Comparison Fixture - Records test output and compares it to previous test output.
- Custom Fixture wizard - Generates the skeleton of a test fixture.
- Test running - Run tests within the JBuilder IDE.
- JBTestRunner - JBuilder's test runner which combines text and GUI output.
- JUnit TextUI support - JUnit's TextUI test runner is integrated into the JBuilder IDE.
- JUnit SwingUI support - JUnit's SwingUI test runner is integrated into the JBuilder IDE.
- Test debugging - Debug tests using JBuilder's debugger.

For more information about unit testing features in JBuilder, see "Unit testing." For a tutorial that shows you how to create a test case and a test suite and run them, see "Tutorial: Creating and running test cases and test suites." For a tutorial that shows you how to create a comparison fixture and a JDBC fixture and use them in your test cases, see "Tutorial: Working with test fixtures."

## Javadoc support

> This is a feature of JBuilder Professional and Enterprise.

Javadoc is a tool created by Sun Microsystems to generate API documentation in HTML-formatted files. The generated HTML documentation is derived from comments that you enter into your API source files. The comments must be formatted according to Javadoc standards.

JBuilder includes a number of features to support Javadoc generation:

- The Javadoc wizard (Wizards|Javadoc) creates a documentation node that holds properties for a Javadoc run. This node is displayed in the project pane. Right-click the node and select Make to create the Javadoc output files.
- A comment template that fills in parameters based on the class, interface, method, field, or constructor signature
- A template for adding `@todo` tags
- Reporting of Javadoc comment conflicts
- "On-the-fly" Javadoc generation
- Documentation archiving with the Archive Builder

For information about Javadoc support in JBuilder, see >"Creating Javadoc from API source files" in Building Applications with JBuilder.

See also

- Javadoc wizard

## Compiling

JBuilder's compiler now includes an option for setting the target VM in the IDE on the Build page of Project Properties. See "Project Properties." bmj and bcj also support this option.

bmj and bcj have a `-source 1.4` option that turns on JDK 1.4-style assertion support. See "Assertion Facility" at http://java.sun.com/j2se/1.4/docs/guide/lang/assert.html for more information.

bmj and bcj are features of JBuilder Professional and Enterprise.

## Debugging

> These are features of JBuilder Professional and Enterprise.

Several changes have been made to debugging dialog boxes.

- The Disable Tracing dialog box no longer displays when the Add Package is selected from the Classes with tracing disabled view. Instead, the Browse Classes dialog box displays.
- The Edit Class/Package command has been added to the Classes with tracing disabled view context menu. Right click a file in the Classes with tracing disabled view and choose Edit Class/Package to display the Edit Disable Tracing Class/Package dialog box. Here you can edit the selected class or package using partial wildcard class/package names. This dialog box only lets you select or type a valid class/package name. You can also choose the ellipsis button to browse to the class or package.

## Deployment

> This is a feature of JBuilder Professional and Enterprise.

The Archive Builder has two new archive types:

- Documentation: The Archive Builder adds all files and directories on the project documentation paths to produce a JAR during a make/rebuild. The project documentation paths are set on the Paths page of Project Properties (Project|Project Properties).
- Source: The Archive Builder finds all Java source files and currently configured resource types on the project source paths to produce a JAR during a make/rebuild. Resource types are configured on the Build page of Project Properties (Project|Project Properties). The project source paths are set on the Paths page of Project Properties (Project|Project Properties).

## Enterprise JavaBean development

To help you create your EJB 2.0-compliant beans, JBuilder 6.0 introduces the EJB Designer, which provides a rapid application development (RAD) environment for EJB 2.0 development. The EJB Designer is a true Two-Way ToolTM that allows you to design your enterprise bean visually as JBuilder generates the code from your design. You can make changes to your design either through the EJB Designer, or by editing the generated source code directly. Your source code and your design remain synchronized. As you work with the EJB Designer, your deployment descriptors are being created for you, preparing your bean for deployment to your target application server.

Working with the EJB Designer, you can right-click the EJB Designer pane and choose New Session Bean, New Entity Bean, or New Message-Driven Bean to begin creating your enterprise beans. Inspectors let you set and modify properties of the beans and context menus let you add and delete fields and methods.

If you want to use an existing data source as the foundation of your entity beans, you can import the data source schema, modify it to meet your needs, and use the schema to create your beans. You can also export a data source schema you have modified.

The EJB Designer lets you visually create relationships between entity beans, including one-to-one, one-to-many, many-to-one, and many-to-many relationships.

The Deployment Descriptor editor has been expanded to include support for EJB 2.0 components. You now access all panels of the Deployment Descriptor from the project pane.

JBuilder now supports enterprise bean development for these additional application servers:

- Borland Enterprise Server 5.0
- WebLogic Server 6.1
- WebSphere Application Server 4.0 Advanced Edition
- WebSphere Application Server 4.0 Single Server
- iPlanet Application Server 6.0

It's now easier to set up your target application server.

## Team Development enhancements

Team development has been enhanced in features that show up in the CVS and Visual SourceSafe integrations. Changes focus on the Commit Browser in both of these integrations, and on handling of certain file-level tasks in CVS.

### File-level CVS task changes

Behind the scenes, the commit process for adding files is handled in two visible steps instead of one. For instance, if you add a file from CVS within JBuilder, you must commit it separately. It's not committed automatically after being added to the repository. This gives you more flexibility and allows you to change your mind after running your project with the file.

The project (.jpx) file is committed and updated separately from the rest of the project. It must be done manually. Select Team|Sync Project Settings and choose Pull Latest or Post Current .jpx. Only global settings are shared in the shared project file, specifically,

- source path
- library path
- output path
- test path
- backup path
- ignore files/directories list

JBuilder overwrites older settings; it doesn't attempt to merge this file.

### Commit Browser

The Commits page of the Commit Browser provides more helpful status messages and more task options for each file. The file list has three columns: Action, Status, and File Name. The Action column has popup menus that let you choose possible CVS tasks to perform on each file. The most reasonable task under the circumstances is the default action. For instance, if you add a file to CVS within JBuilder and then invoke the Commit Browser, the file's status is "Not in repository" and the default option is "Add"; other options are "Delete" and "No action."

To perform a default action on an individual file in the list, right-click on that file and click the menu option that appears. The rest of the project will remain unaffected by that action.

Use the context (right-click) menu in the node view to perform the default actions on all of the files within the selected node.

Merge conflicts flagged by the Commit Browser generate `@merge` tags in the source code. This engages JBuilder's merge conflict handling mechanisms, such as flagging these tags in the message pane at compile time and providing merge assistance in the History pages.

## IDE enhancements

IDE enhancements for JBuilder 6 include:

- Import handling features
- Project wizard and Import Project wizard features and enhancements
- Enhancements to panes, menus, and Project Properties options.

### Import handling

JBuilder 6 provides two import handling features: ClassInsight and Optimize Imports.

#### ClassInsight

ClassInsight auto-imports classes and enters the short class name where you put the cursor. The package is imported to the level you specify in the Import Style page of the Project Properties dialog box (Project|Project Properties.)

#### Optimize Imports

> This is a feature of JBuilder Professional and Enterprise.

Optimize Imports updates your import statements to include all necessary import statements and eliminate all defunct or extraneous ones. Normally, it imports a package at a higher level, as `<package>.*`. Where there's an ambiguity about what to import, it imports the class directly.

Right-click in a `.java` file in the editor to invoke the context menu. Select Optimize Imports. Select whether to use a short name in the code and a class import, a short name in code and a package import (this is hidden -- press `Ctrl + Enter` as a shortcut to use this option), or a fully qualified name in code and no import.

Control it like this:

- Set import properties in the Project|Project Properties dialog on the Import Style page. This controls how many classes to import and how to group them. It also offers the option of always importing classes instead of using import statements.
- Create a keybinding to call Optimize Imports from within the editor.

### Project wizard and Import Project wizard

Project handling has evolved in three important ways:

- The Project wizard reflects the Project Properties dialog box, notably the Paths and General pages. This makes the UI more internally consistent and the Project wizard more streamlined.
- In JBuilder Professional and Enterprise, the new Import Project wizard provides a way to create a new JBuilder project from an existing body of work, deriving needed paths from the directory tree.
- In the object gallery (File|New), both wizards are found under the Project tab.

Specific changes in each step are detailed below.

#### The Project wizard

The first step names the project and sets the template. The second step sets the project paths. The third step sets general project properties.

Step 1: Select name and template for your new JBuilder project

Specify the name, file type, working directory name, and template for the project. Also, choose whether to create an HTML project notes file.

Any file name legal to the file system is allowed as a project name. However, there are other names which are derived from this name. These derived names must meet the following restrictions:

1. No spaces. The project directory name can appear on a Java classpath. Since embedded spaces can cause problems, if there are spaces, they are replaced with underbars.
2. Java-legal package name. The wizard uses the project name as the default package name. Therefore, it must be a legal Java package name. This means that leading numbers are removed from the file name and the case is forced to lowercase.
3. Platform-legal path and name. Native file systems have restrictions on the length of paths and the length of directory names. The name may be truncated if the path or project name is too long.

Step 2: Specify project paths

This step provides the same features as the Paths page of Project Properties (Project|Project Properties). The default values in these fields are determined by the settings from Step 1 of the Project wizard and are fully configurable. Set the following paths for the project:

- JDK
- Output Path
- Backup Path
- Working Directory path
- Source and Test paths (on Source tab)
- Documentation paths (on Documentation tab)
- Required Libraries (on Required Libraries tab)

On the Source tab, you can specify the path for source files as default or test, or you can set the same path to both default and test. The Default source path is used by wizards when creating source files. The Test source path is used by the unit testing wizards when creating test source files.

Step 3: Specify general project settings

This step provides the same features as the General page of Project Properties (Project|Project Properties). Set encoding, enable JDK 1.4-style assertions with the `assert` keyword, automatic source package options, and class Javadoc fields.

#### Import Project wizard

> This is a feature of JBuilder Professional and Enterprise

The Import Project wizard allows you to import an existing project or source tree into a JBuilder project.

Step 2 and Step 3 of the Import Project wizard are identical to Step 2 and Step 3 of the Project wizard. Only Step 1 differs.

Step 1: Select source directory and name

First, select the directory where the existing material resides. Then choose a name and a project file type for the imported project. Select a template. Decide whether to generate a project notes file when using certain wizards. You must click Next to continue with the wizard.

JBuilder scans the existing directory and builds paths based on what it finds. These paths are used for compiling, searching, debugging, and other processes. Any JAR or ZIP files that can't be found in an existing library are placed in a new library and added to the project. Project libraries are listed on the Required Libraries tab of the Paths page of Project Properties (Project|Project Properties).

### Other IDE enhancements

- IDE Options
- Project pane
- Project Properties
- Other dialog boxes
- Other menus

#### Tools|IDE Options

Tab Insertions

On the Browser page of the IDE Options dialog box, the Content Pane Tabs group now has an Insertions selection which controls where new tabs are added in the content pane.

Note: The default for Tab Insertions has changed from Insert At End to Sort Alphabetically.

The Content Pane Tabs Insertions option includes:

- Sort Display Order sorts the same way as the project pane. For example, tabs for package nodes and other lightweight nodes will sort to the beginning of the tab control. This is now the default for tab insertions.
- Sort Alphabetically positions tabs in alphabetical order.
- Insert At Beginning inserts a new file as the first tab.
- Insert At End inserts a new file as the last tab.
- Insert To Left Of Tab For Active Node inserts a new file to the left of the currently selected tab.
- Insert To Right Of Tab For Active Node inserts a new file to the right of the currently selected tab.

#### Project pane

Double-clicking a node in the project pane now activates that node if there are any registered viewers for it regardless of node type. Prior to this you had to right-click and select Open on package nodes.

Double-clicking an icon or text of any node (except the root project node) will no longer expand or collapse that node. Use the handle to expand or collapse a view of the children of that node.

#### Project Properties (Project|Project Properties)

Paths page

On the Source tab, you can specify the path for source files as default or test, or you can set the same path to both default and test. The Default source path is used by wizards when creating source files. The Test source path is used by the unit testing wizards when creating test source files.

Java tab of Build page

- Debug options are now in a drop-down list.
- A Target VM drop-down list has been added. Choose from several VMs: All Java SDKs, Java 2 SDK v1.2 or later, Java 2 SDK v1.3 or later, Java 2 SDK v1.4 or later.

General page

The option, Enable Assert Keyword, has been added to let you turn on the `assert` keyword. The `assert` keyword, previously reserved for future use, is a new feature of JDK 1.4 and is supported in JBuilder 6. See http://java.sun.com/j2se/1.4/docs/guide/lang/assert.html for more information.

#### Dialog boxes

Object gallery

The object gallery has two new tabs: Project and Test.

The Project tab provides access to the Project wizard, the Import Project wizard in JBuilder Professional and Enterprise, and the Pull Project team development wizards in Enterprise.

The Test tab is a feature of JBuilder Enterprise. It provides access to wizards related to unit testing, such as Test Case and Test Suite wizards and the different Fixture wizards.

File and Directory dialog boxes

The All Files filter now appears immediately after All JBuilder Files instead of as the last filter in the Open File dialog box.

File|Save As

A new check box, Open Saved File, is added.

File|Close, File|Close Projects, Save Modified Files

These dialog boxes now display the node icon next to each check box.

Window|More Windows

This dialog box, which appears if you have more than 10 files open, displays the node icon next to each file name.

#### Menus

File menu

The Reopen menu option has changed so that it adds projects and files which have been reported closed and removes projects and files which have been reported opened.

The Close Files menu option has been changed to Close to reflect that the content pane may contain viewers for node types that either have no storage associated with them or otherwise do not reside in a file.

Run Menu

Two new Run and Debug menu items appear which allow running the currently active node if it contains a `public main()` method.

Help Menu

The About menu is changed to About JBuilder.

Editor context menu

Browse Symbol has been changed to Find Definition.

Content pane context menu

Several items have been added to the file tab's context menu in the content pane.

- Close All Except <filename>
- Make
- Rebuild
- Run and Debug if the file has a `public static main()` method

Project pane context menu

Open In New Browser has been added to the project pane's context menu. This command opens the selected file(s) in a new JBuilder AppBrowser. This is a feature of JBuilder Professional and Enterprise.

## Web Development enhancements

> Web Development is a feature of JBuilder Professional and Enterprise. JSP debugging is a feature of JBuilder Enterprise. Applet development is a feature of all editions of JBuilder.

Web Development enhancements for JBuilder 6 include:

- Tomcat 4.0.1 support
- WebApp DD Editor enhancements
- Improved directory selection for WebApps

### Tomcat 4.0.1 support

JBuilder 6 ships with both Tomcat 3.2 and Tomcat 4.0.1. Tomcat 3.2 is still the default web server.

### WebApp DD Editor enhancements

The WebApp DD Editor has enhanced support for the Servlet 2.3 specification. See "Deployment Descriptors" in Developing Web Applications for more information.

### Improved directory selection for WebApps

You can now specify custom directories to be included in or excluded from your WebApp and your archive files. See "Directories page."