Adding packages and files to a project
You can add packages and files (including source, HTML, and plain text files) to a project so that they are viewable on the Projects tab in the Explorer. This enables you to view and access all of the files crucial for your project from one place. In addition, it enables you to compile all project files at the same time.
This does not affect which files or file systems are mounted under Filesystems in the Explorer or which files are available for editing. The files mounted in Filesystems are always available for editing, whether you have added them to the project or not.
To add an existing file or package to a project:
- Select the Project tab in the Explorer, right-click on the root
Project
node, and choose Add Existing... from the contextual menu.- In the Select Objects dialog box that appears, browse to the directory, package, or file you want to add to the project and select OK.
You can also add existing files or packages to a project by selecting files or packages under the Filesystems tab in the Explorer and then choosing Tools | Add to Project from the contextual menu or Tools | Tools | Add to Project from the main menu.
When you switch to the tab of your project in the Explorer, the files you have added will appear under the main project node. You can work with the files from either the project's tab or the Filesystems tab in the Explorer.
Important: The package or file that you have added will appear under the Project tab as a link. If you delete its node, the files in its hierarchy will be deleted from the project but will remain in Filesystems. However, if you delete any of other the nodes in the hierarchy, those files will be completely deleted from Filesystems.
When you are working in the Explorer with the Project tab selected, you can create new objects by using the contextual menus of the Explorer nodes. When you create new files this way, the objects are added to the selected file system (as represented on the Filesystems tab) and to the project (as represented on the Project tab).
To add a new file to the root of a project:
- Select the Project tab in the Explorer, right-click on the root
Project
node, and choose Add New... from the contextual menu.![]()
- In the New From Template wizard that appears, expand the appropriate template category node (for example, Classes) and then select one of the templates. In the right panel of the dialog, a description of that template will appear.
- Press Next to move to the Target Location page of the wizard.
- In the Name field, type the name you want to give the object. Do not type the extension for the file type. It will be added automatically.
- In the same page of the wizard, choose a package for the template. You can do this either by typing a package name in the Package field or by selecting one of the packages shown in the tree view just below it.
- Press Finish to exit the wizard and have the template created.
You can also create new files in existing packages, much as you would under the Filesystems tab in the Explorer.
To add a new file to a package in the project:
- Select the Project tab in the Explorer, right-click on a package in its hierarchy, and choose New From Template... from the contextual menu and navigate the submenus to choose a template. The second page of the New From Template wizard will appear.
- Fill in the wizard page as described in steps 4 and 5 of the previous procedure.
Note: Any file that you add to a directory that is already in the current project will also be added to that project, even if do not have the Project tab in the Explorer selected when you are adding the file.
Contents | Prev | Next | Index |