Project Explorer (Visual J++)

See Also   Tasks

Project Explorer is a graphical navigation tool for accessing the different files in your Visual J++ project.

Project Explorer allows you to view the files that make up your project. Because Visual J++ projects are directory based, Project Explorer is dynamic. Files that are added to your Visual J++ project directory are automatically added to Project Explorer. When directories are added to a Visual J++ project, Project Explorer treats the directory as a package where groups of source files and other project support files can be added and maintained.

When a Visual J++ project is selected in Project Explorer you can:

Views

Two views are available in Project Explorer when a Java project is selected: Package View and Directory View. The views are designed to make finding elements of a project easier. You can change the view to Directory View by clicking the Directory View button in Project Explorer or by clicking Directory View on the Project menu. You can change the view to Package View by clicking the Package View button in Project Explorer or by clicking Package View on the Project menu.

Directory View

The default view for Project Explorer is Directory View. It displays the editable files and directories that make up your Visual J++ project structure. Files that are not directly editable in Visual J++ are filtered out by default. You can view all the files that are in your project directory structure, including files that are filtered out, by selecting the Show All Files button or clicking Show All Files from the Project menu. Files can be removed from the project, but kept in the project's directory structure. To remove a file from the project right-click on the file you wish to remove and click Remove From Project on the shortcut menu. When a file is removed from a project, its icon is shaded and cannot be opened for editing in Visual J++. If you want to add a file that is not currently in your project but is located in your project directory, click the Show All Files button to display all files in your project directory structure. Right-click on the file that you want to add to your project, and then click Add To Project on the shortcut menu. The file is now added to your project.

Package View

Package View displays all the packages in your project and their source files. Unlike Directory View, packages located under the project directory are not displayed as sub-items of the project, but instead are displayed as items directly under the project name. Each package is displayed using the package's declared name (for example PackageA.PackageB) instead of just the directory name in which the package's source files are located. Package View allows you to view the project as another Java program would view your project — as a group of packages. Also, unlike Directory View, Package View only displays Java source files. Non-Java source files are filtered out in Package View. If a non-Java source file is added while in Package View, the file will only be displayed until your Project Explorer view is changed. Since only Java source files are displayed in Package View, the Show All Files button is disabled.

Note   If a directory within your project directory structure does not contain a Java source file, it will not be displayed in Package View. Only directories that contain at least one Java source file are displayed in Package View.