There are two wizards defined for creating new files. One wizard creates a new Ada source file and (optionally) inserts a header comment block at the top. Another wizard creates a "basic" file and in fact this wizard is just the standard Eclipse "new-file" wizard, provided here for convenience. We describe the Ada Source File wizard below.
There are many ways to select and invoke the GNATbench wizards. See Wizards for illustrations of all the different methods.
Perhaps the easiest way to invoke one of these new-file wizards is to click on the down-arrow next to the GNATbench new-file icon on the toolbar, as shown below, and select from the list. Clicking directly on the icon will invoke the "Ada Source File" wizard.
The "Ada Source File" wizard will automatically insert the content of a header file if the corresponding preference is enabled. Different header files can be inserted for specs and for bodies; selection is determined by the file name extension.
Like the standard new-file wizard, you choose the parent folder for the file and specify the name of the new file, including extension. The "Advanced" button allows creating a linked file.
See the Editor preference page for the preference controlling whether the header text is inserted and for the paths to the files containing the text. The preference is disabled by default.
The header file preferences are intended to designate regular text files containing text capable of being processed by an Eclipse text editor.
Separate text headers are possible for declaration and body files because separate file paths are provided in the preferences. However, there is no requirement that they be different so you can simply specify the same file in both preferences to have the same header text inserted.
When the preference to insert the header is enabled but no file(s) containing the header text is also specified, the file is still created but the following dialog box will pop up, explaining why no text was inserted (this sample is for specs):
Note that if the overall enabling preference is checked, both file preferences must be specified (one each for both spec and body files). However, if only one kind of file should have a header inserted, simply specify the name of an existing empty file for the other preference.
The wizard ensures that the new file's proposed extension is valid for the given project's source file naming scheme. For example, the following figure shows the error message displayed when the default GNAT naming scheme is in effect for the given project. Once a valid name is specified, the Finish button will be enabled.