Creating an IDE Module

The IDE's modular architecture makes it possible for you to extend the IDE with your own modules. You can use the New Module wizard to create a code outline for a new IDE module, including basic code for working with a new file type and for adding a new menu or toolbar item.

To create a new module:

  1. Choose File and choose New.
  2. In the New wizard, expand NetBeans Extensions and choose IDE Plug-in Module. Click Next to continue in the wizard.
  3. After completing the wizard, mount the four OpenIDE JAR files as filesystems. These JAR files are located in the IDE's lib directory.

    The classes generated by the wizard are dependent on classes in these JAR files, and mounting the JAR files makes them a part of the IDE's classpath.

    1. Choose File and choose Mount Filesystem, and select Add JAR File.
    2. Navigate to your user directory, open the lib directory, select openide.jar, and click OK. When prompted, you can choose to display or hide the JAR in the Explorer.
    3. Repeat the previous two steps to mount the openide-fs.jar, openide-nodes.jar, and openide-utils.jar files.
  4. If you so desire, edit the sources, filling in the specific code you want to include, and compile.
  5. Create a JAR file by choosing File and choose New, expanding the Jar Packager node and selecting Jar Contents. In the wizard, add the generated sources plus any other necessary classes and resources and edit the manifest if necessary. See Creating a JAR File for more information.
  6. Test the module by right-clicking the JAR Contents file in the Explorer and choosing Execute.

    This installs the module in the IDE. If you need to make corrections in the code, you can repeat this step without having to uninstall the module. If you restart the IDE, the module remains installed and you can continue working with it.

If you would like to learn more about the Open APIs, which are used in module creation, visit http://openide.netbeans.org/ to browse or download the documentation.

The New Module wizard's API support is limited. The OpenAPIs Support module provides more thorough support for module authors and includes the API documentation. You can learn more about this module by visiting http://apisupport.netbeans.org/. Or you can install the module through the Update Center.

To install the OpenAPIs Support module:

  1. Choose Tools and choose Update Center from the main window.
  2. In the first panel of the wizard, select the NetBeans Update Center and click Next.
  3. In the Available Updates and New Modules panel, expand the Extensions folder and select OpenAPIs Support. Click the Add button to add the module to the list of modules you want to install. Click Next.

    You are then prompted with the license. Once you click Accept, the module starts downloading. Then you can verify digital signatures and have the module installed.

tip Choose Help and choose Help Sets and choose OpenAPIs Support for more assistance. The OpenAPIs Support online help is installed with the module.

Legal Notices