Adding a file to the IDE


The Forte for Java Open File feature provides the ability to open existing (meaning not created in the IDE) source files in the IDE straight from a file chooser without the need to first mount directories under the Filesystems tab in the Explorer or navigate to them in the Explorer.

To open a file in the IDE:

If you are opening a Java source file, the IDE tries to determine the correct directory to mount by looking through the source file and trying to find a package declaration. For example, if you are opening C:\mysources\com\mycom\MyClass.java, and this file begins with the declaration package com.mycom;, then C:\mysources will be selected as the default. If there is no package declaration, the directory directly containing the source file will be the default to mount.

You can override the default, but be sure that you choose the right mount point. If you do not choose the correct mount point, you will not be able to work with the file (your package declaration will be invalid, you will not be able to compile or execute the source, debugging will not work, and so on). When opening other types of files (such as GIF images, HTML, or resource property files) that do not have package declarations, you must be sure to mount the correct directory - look at the bottom of the dialog box to see what "package" will be used for the file. The choice will affect any Java sources that are in the same mounted directory. If you are using classloader-based resource loading (that is, based on an abstract resource name such as /com/mycom/myImage.gif), such as when creating a JAR file for distribution, then the resource names and JAR manifest entry names will be relative to the mounted directory as well.

Files that cannot be opened for editing will typically just be displayed in their own Explorer window. You can also select ZIP or JAR archives with Open File. When you do, they are immediately mounted in the Explorer and an Explorer window is opened on their contents to make it easy to browse archives.

Note: Mounted JAR archives are read-only.


Contents Prev Next Index