Package Migration tool
The Package Migration tool helps you convert existing projects and source code by renaming all specified references to new references. This tool also creates new directories and moves files over based on new package names as applicable. Use this tool to:
- Change a class name and all references to it in your application.
- Change the package name (also called a namespace) and location (and all references to both) in your application.
- Update Java source files created using earlier versions of JBuilder's component libraries to JBuilder 4.
- Update Java source files created using earlier versions of Java Swing components to the latest javax.swing namespace.
To open the Package Migration tool, choose Tools|Package Migration.
This wizard includes these pages:
Settings
Select the type of update you want the Package Migration tool to make. Click the down arrow beside this field to select from previously saved settings or select New to create a new file that will store the settings you define. JBuilder 4 includes these predefined settings:
- Update to JBuilder 4 (including javax.swing): Updates your application for package references both the Borland and Swing components.
- Update to JBuilder 4: Updates your application for changes to Borland components.
- Update from JBuilder 2.01 beta (including javax.swing): Updates applications created with the beta version of JBuilder 2.01. This includes changes to the Swing components.
- Update to javax.swing:: Updates your application for changes to Swing components.
For information on the javax.swing
changes, see the Sun's web site at
http://http://java.sun.com/j2se/1.3/compatibility.html.
New
Allows you to create a new file where settings you define in this dialog will be stored. You specify the new file name and description in the Create New Settings dialog box. The name is then added to the list for the Settings field and automatically selected. The description is also displayed beneath the Settings field whenever this settings file is selected.
If you select to create a new package migration settings file and do not choose Save before closing this dialog, a confirmation dialog will display asking whether to save your settings.
Save As
Displays the Save Properties File dialog, which prompts you for the file name to store the settings defined in this dialog. By default, the file is given a .properties file extension and is saved in the migration
directory of your user/.jbuilder
directory. This option does not perform the package migration but merely saves the settings defined in this dialog.
Packages and Classes page
This page collects information in a two-column table on the packages and classes you want renamed (and moved) to new references/locations. The renaming process follows the order specified in the table; use the Move Up and Move Down buttons to change the processing order.
Existing Package/Class Name
The left column of the table lists the original package or class names that you want changed. Partial package names are acceptable as long as they include a full directory name, followed by a period then an asterisk. Do not specify the file extension; file extensions are listed in the File Types field on the Paths page. For example, these are valid values for this field:
- borland.*
- borland.sql.dataset.*
- borland.sql.dataset.Connection
New Package/Class Name
The right column of the table lists the new references for the package or class name indicated to the left of the same line. If a package name is specified with use of a wildcard character, new directory structures will be created to match the new package structure if necessary.
Add
Adds a blank entry at the bottom of the table for you to add a new pair of values for Existing Package/Class Name and New Package/Class Name.
Remove
Deletes the current line of the table and moves up all entries that follow. There is no undo capability so take care when selecting this option.
Move Up
Moves the current line up one row in the table, which affects the order in which the current package or class is processed.
Move Down
Moves the current line down one row in the table, which affects the order in which the current package or class is processed.
OK
Performs the package migration according to settings specified in this dialog.
While the Package Migration tool is processing, status information is displayed in the
Processing Package Migration dialog box.
Advanced Options page
This page collects settings for the locations of files to process, file types to process, and other options.
Migration Base Directory
The root directory where the source files are located. The Package Migration tool uses this path to search for the source files it will process.
Click the ellipsis button beside this field to choose a directory using the Select Migration Base Directory dialog box.
Backup Directory
Select this checkbox to have a backup copy of all files made before any source files are updated by this tool. Enter the name of the backup directory in the edit box beneath this field or click the ellipsis button to specify the directory where backups are to be stored.
File Types
The types of files that the Package Migration tool will process. Include the * wildcard for the filename, a period, then the file extension. Separate multiple file types with a semi-colon (;). This field defaults to *.jpr;*.java
.
Log File
Select this option to save the output to a log file. Enter the name of the log file in the edit box or click the ellipsis button to specify a log file.
Prompts
Prompt On Replace: Specifies that a confirmation dialog be displayed each time an existing file in the new directory location is about to be overwritten. This field is selected by default.
Prompt On Move: This tool creates new directories as needed based on new package/class names, processes the specified files, and moves them to these new directories as appropriate). This option specifies that a dialog should be displayed for each file processed to confirm whether it should be moved to its new location.
OK
Performs the Package Migration according to settings specified in this dialog.
While the Package Migration tool is processing, status information is displayed in the
Processing Package Migration dialog box.