| TWiki . Netbeans . DeveloperDocumentation |
A NetBeans module is a Java archive (JAR) file which contains Java classes written to interact with the NetBeans APIs. A module identifies itself as a module by an entry in its MANIFEST.MF file. NetBeans modules are packaged as NBM files (.nbm extension) for non-installer distribution, usually via the NetBeans Update Center. NetBeans modules are written with one of two aims in mind:
| API | Description | Related Sample Code and Tutorials |
|---|---|---|
| Actions API | Defines global singleton actions (such as Open, Cut, Paste) which your module may use. | NetBeans Google Toolbar Module Tutorial |
| File Systems API | An API for "virtual files". NetBeans uses this API to access user files on disk, files inside JARs, and configuration data for the IDE. | --- |
| Loaders API | "Parsed files". Provides DataObjects which wrap FileObjects and provide programmatic access to their contents. Each file type NetBeans recognizes (such as Java files or HTML files) has a corresponding DataObject subclass provided by the module that adds support for that file type. | NetBeans DataLoader Module Tutorial |
| Nodes API | Generic hierarchy and action context. Nodes are similar to TreeNodes, but can be used in more than trees. Nodes add user-visible things such as popup menu actions, localized display names and icons to DataObjects, but can also be used without DataObjects, by themselves. The Explorer API contains a variety of UI components such as trees, lists and tables which can be used to display a node and its children. Each window system UI component (TopComponent) has one or more "activated nodes" which determine what actions are enabled when that component has focus. | NetBeans System Properties Module Tutorial |
| Windows API | Allows modules to provide window-like components, mainly through embeddable visual components called topcomponents. | NetBeans Anagram Game Module Tutorial |
| Palette API | Provides a palette topcomponent with drag-and-droppable content. For example, this API is used to provide groups of related tags that can be inserted in HTML file and JSP files in the IDE. | NetBeans Component Palette Tutorial |
| Refactoring API | Enables you to extend the IDE's refactoring capabilities by providing facilities for plugging your own refactorings into the IDE. | NetBeans Copy Class Refactoring Module Tutorial |
| MultiView API | Lets you display multiple perspectives of the same data. For example, the web.xml multiview editor provides an XML view and a topcomponent view. | (coming soon) |
| JavaHelp Integration API | Adds helpset to the IDE or an application built on the NetBeans Platform. | NetBeans Help System Plug-in Tutorial |
| ... | ... | ... |
| ... | ... | ... |
| ... | ... | ... |
The general repository for commonly used API terms is the NetBeansDeveloperFAQ?. Here is a list of entry points to the most common of the commonly used terms:
NetBeans IDE 5.0 provides a set of wizards that create the basic files for various APIs. For example, when you want to implement the TopComponent class, use the New Window Component wizard to get started. After using the Window Component wizard, you have a bunch of files and sample code that you extend to build your module. Below, where an API is supported by a wizard, the wizard is listed, together with a list of files that is generated, as well as a related tutorial (with sample code) that illustrates a typical scenario.
(Note that all tutorials listed below include downloadable source code, which means that you can look at examples of how to extend the files created by the wizards.)
| Name of Wizard | Which API(s) was the wizard created to support? | Which files, sample code, etc, does the wizard give me? | Once I have them, what can I do with these files and sample code? | Which tutorial(s) make use of this wizard? |
|---|---|---|---|---|
| New Action wizard | NetBeans Actions API | Created files:
Impact on layer.xml (the module's NetBeans configuration file):
|
Do something with the action that the IDE created for you. For example, now that the menu item is attached to one or more of a variety of items—the main menu, a toolbar, a keyboard shortcut, the the pop-up menu of one or more of the editors (the Source Editor is made up of an XML editor, a Java editor, a JSP editor, etc), or the pop-up menu of a node in one of the windows (such as the pop-up menu of a JSP node in the Projects/Files/Favorites windows)— you need to provide the code that specifies what you want to have happen when the user invokes the action. What an action does is defined in its performAction() method. | NetBeans Google Toolbar Module Tutorial |
| New File Type wizard | NetBeans Loaders API |
Created files:
Impact on layer.xml (the module's NetBeans configuration file):
|
Now that the IDE (or your application built on top of the NetBeans Platform) recognizes your file type as being distinct from all other file types, you can provide a lot of functionality specifically for the newly-recognized file type—such as menu items, dialog boxes, wizards, syntax highlighting, code completion, multiview editors, code folding, component palettes, etc. etc. etc. For all of these features, the starting point is that the IDE is able to identify a file type as being distinct—and that's why the first step is to run through the New File Type wizard so that the basic file type recognition files are generated for you. | NetBeans DataLoader Module Tutorial |
| New Project Template wizard | WizardDescriptor class | Created files:
Impact on layer.xml (the module's NetBeans configuration file):
|
Extend the files to finetune a template that users build on when creating their own project. For example,
in the IDE a user chooses the 'Web Application' project template in the New Project wizard, then the IDE
creates a project consisting of a JSP file, a web.xml file, a server-specific deployment file,
and project metadata within a specific structure that is useful for web application projects.
Alternatively, extend the files to finetune a sample that illustrate some aspect of project functionality. For example, in the Samples directory within the New Project wizard, an Anagram Game is included to demonstrate J2SE? functionality. Samples are a kind of project template; they have the same behavior as project templates, but they are used for a different purpose. |
NetBeans Project Template Module Tutorial |
| New Window Component wizard | TopComponent class | Created files:
Impact on layer.xml (the module's NetBeans configuration file):
|
Extend the TopComponent implementation to create a window (also known as 'view') for a module. For example, the IDE's Projects window is a 'window', just as the Navigator, Output window, Palette, and Debugger. The multiview editor used by the web.xml file is also a topcomponent, so you would use the Window Component wizard to create a basic implementation of this class. | ... |
| New Wizard wizard | WizardDescriptor class | Created files:
The Wizard wizard's first panel lets you set a 'Registration Type' ('Custom' or 'New File') and a 'Wizard Step Sequence' ('Static' or 'Dynamic'). The consequences of these selections are outlined below:
|
Add user interface components to the visualpanels and wire them to their related wizardpanels so that the information is correctly passed from one to the other. Finetune the wizard's steps, graphics, left side-bar text, and a user panel on the right. For more complex wizards, set the sequences that the user will follow when using the wizard. | ... |
Ideas for other tutorials:
----- Revision r27 - 31 May 2007 - 21:04:16 - Main.katty1980
|