Reusing Project Settings and Configurations


Creating a project with several different configurations and settings within those configurations can be a time-consuming process. If you often want to support the same set of deployment platforms for each application you create, it is useful to reuse those configurations and settings. The NetBeans IDE has several features that address this need.

Duplicating Project Settings

If you have configured an entire project that has settings you would like to reuse on a new project, you can do so using the Copy Project command.

To reuse a project's settings in another project:

  1. Right-click your project in Projects window and choose Copy Project.

  2. Optionally, update the Project Name and Project Location fields.

  3. Click Copy.

    All files in the original project's source root are copied to the src folder contained in the new project. This occurs even when the original project has an external source root.

Your newly created project has all of the settings and configurations from the original project. These may include some settings that are no longer appropriate (for example, JAD file and JAR filename, filtering options, and some JAD file attributes).

Using Project Configuration Templates

Alternatively, you might want just to reuse the settings from one or two configurations. You can do this with configuration templates, which allow you to create new configurations based on the saved settings of other useful configurations. Only the settings from panels that are not taking their values from the default configuration are stored in templates. They are very easy to create:

  1. Right-click your project in Projects window and choose Properties.

  2. Click Manage Configurations.

  3. Select the configuration that contains the reusable settings and click Save As Template.

  4. In the Save Project As Configuration Template dialog box, enter a name for the template and click Save.

    Templates are uniquely stored in the IDE, so choose a descriptive name.

Now that you have saved this configuration template, it is possible to create new configurations based on it:

  1. Right-click your project in the Projects window and choose Properties.

  2. Select Add Configuration from the Project Configurations combo box.

  3. Select the template you would like to use from the Use Configuration Template combo box.

  4. Modify the name of the configuration in the New Configuration Name text box if desired. Click OK.

This template-based configuration has the same settings as the template for each panel of the template that was not using the values from the default configuration.

Once a template is created, it does not remain synchronized with its original configuration. Also, it is not possible to update existing templates directly. Instead, create a new configuration based on the template, update it, delete the original template, and then save the new configuration as a new template with the original template name.




NetBeans IDE Field Guide(c) Developing Desktop, Web, Enterprise, and Mobile Applications
NetBeans IDE Field Guide(c) Developing Desktop, Web, Enterprise, and Mobile Applications
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 279

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net