Working with packages


All objects you create when writing an application in Forte for Java are displayed under the Filesystems tab in the Explorer, where they can be added, removed, and edited. You can organize these objects in packages, which are visually represented by folder icons.

When starting a new development project, identify the data path or file system (see above) to use for your work, right-click on that path, and choose New Package from the contextual menu. Once you enter a name for the new package, it appears in the Explorer under the path you have selected. You can also create a package at the same time as you create a new class from template in the New From Template wizard.

You can create several layers of packages (meaning packages within packages) in the same way. You can delete a package by right-clicking on its node and choosing Delete from the contextual menu or by selecting it and pressing the DELETE key on your keyboard.

Note: When you cut or copy source files and paste them to a different package, the sources' package declarations are automatically updated to reflect the new package. If you copy and paste a file to the same package, the pasted copy is automatically given a unique name (which you can change, either from the contextual menu, or by clicking on it in the Explorer to select it and then clicking again for an in-place rename).

The contextual menu commands available on nodes in the Explorer enable a wide range of operations - from creating new packages to changing properties. The following is a list of menu items that appear in various contextual menus.

Table 1: Package contextual menu commands
Command
Description
Explore from Here
Opens a new Explorer window with the selected package as the root.
Find...
Enables you to conduct a search of files in directories mounted in the Explorer.
Refresh Folder
Updates the view, reflecting any changes to files in the folder made outside the IDE.
Compile
Compiles all uncompiled or modified objects in the selected package, at the selected level in the hierarchy.
Compile All
Compiles all uncompiled or modified objects in the selected package and recursively in all sub-packages.
Build
Compiles or re-compiles all objects (whether already compiled or not) in the selected package at the selected level in the hierarchy.
Build All
Builds all objects in the selected package and recursively in all subpackages.
Cut / Copy / Delete / Rename
Standard clipboard-style operations.
Paste | Copy
Pastes a copy of the object most recently copied under the selected node.
Paste | Create Link
Creates a link under the selected node to the most recently copied object. The object remains stored in the location where it was copied, but it can also be opened from the node where the link is pasted.
Paste | Instantiate
Creates a new instance of the copied template (only available when a template is on the clipboard).
Paste | Serialize
Serializes the instance of the copied JavaBeans object and places it in the selected package.
Paste | Default instance
Places the default instance of the copied JavaBeans object in the selected package, meaning that the name of the class is stored and the class name is provided as the default constructor in the pasted copy.
New Package
Creates a new, empty package as a sub-folder of the selected package.
New from Template
Creates a new object in this package, using one of the pre-built templates available under the Templates node in the Explorer.
Tools | Update Parser Database
Updates the Java parser database with the classes of the selected package, thus making those classes available in addition to the standard Java 2 Platform SDK classes when using the Java code completion feature in the Editor.
Tools | Generate Javadoc
Generates Javadoc documentation for the selected classes or elements and places it in the directory that you specify.

Contents Prev Next Index