Sunday Oct 19, 2008

NetBeans Platform APIs: Top 10 Runners Up

If yesterday's list of NetBeans APIs are to be seen as the NetBeans Platform's "Top 10 Greatest Hits" (the 10th place is still open to suggestions), then those that follow are its "Top 10 Runners Up". In other words, though the following don't belong to the central set of NetBeans APIs, they are important nonetheless and, in each case, are APIs that you need to have in your mental toolbox next time you start thinking about the infrastructure of your Swing application:

  1. Dialogs API. Enables you to provide user notifications, dialogs, and wizards that integrate well with the rest of the NetBeans Platform. In the NetBeans sources, see package "org.openide".

  2. Options Dialog and SPI. Enables you to integrate with the NetBeans Platform's Options window so that you can let the user customize the application. In the NetBeans sources, see package "org.netbeans.api.options/org.netbeans.spi.options".

  3. UI Utilities API. Enables you to provide a range of smaller visual items in your NetBeans Platform application—particular favorites are HTML browser integration, the Undo/Redo Manager, and status bar interaction. (Also have a look at the DropDownButtonFactory and TabbedPaneFactory, both of which I blogged about some time ago.) In the NetBeans sources, see package "org.openide.awt".

  4. MultiView Windows. Enables you create two views over the same file, typically a source view and a visual design view. In the NetBeans sources, see package "org.netbeans.core.api.multiview/org.netbeans.core.spi.multiview".

  5. Auto Update Services. Enables you to programmatically install/uninstall and enable/disable modules. In the NetBeans sources, see package "org.netbeans.api.autoupdate/org.netbeans.spi.autoupdate".

  6. I/O APIs. Enables you to write to the NetBeans Platform's Output window, including writing hyperlinks there, such as error messages which the user can then click on to jump to a relevant place in the source code or, possibly, somewhere on-line. In the NetBeans sources, see package "org.openide.windows".

  7. Progress API. Enables you to integrate with the NetBeans Platform's progress bar, to indicate to the user that they need to wait a bit longer during long running tasks. In the NetBeans sources, see package "org.netbeans.api.progress".

  8. Command Line Parsing API. Enables you to parse the command line from within a NetBeans Platform application. In the NetBeans sources, see package "org.netbeans.api.sendopts/org.netbeans.spi.sendopts".

The final two runners up (below, 9 and 10) are not actually APIs. They are, like the above, of course, provided in the form of a NetBeans module. However, in these cases, you can't program against these modules. I.e., for example, you need to do a bit of Java coding to work with the Command Line Parsing API. These two, however, require no coding. Simply include them in your NetBeans Platform application and you've immediately integrated them:

  1. Favorites. Provides the Favorites window, which functions as a file browser. You can brand it quite easily, replacing the strings with your own.

  2. JavaHelp Integration. Provides the infrastructure for JavaHelp help sets.

That's it. I believe that the above 10, and the previous 10, together make up the top 20 modules that the NetBeans Platform makes available. The remainder are mostly support modules for the above or low-level infrastructural modules that could be addressed in a future blog entry.

You might be wondering: "Where are all the editor-related APIs?" Well, those APIs are not part of the NetBeans Platform. They are made available by NetBeans IDE, which is just one of many applications on top of the NetBeans Platform. Those can also be looked at in a future blog entry, but have nothing to do with the modules that the NetBeans Platform makes available. From these two lists, therefore, you should be able to see that the NetBeans Platform isn't concerned with editor applications, necessarily. It provides the basis for any kind of Swing application (small or large) that needs the above services.

NetBeans Platform APIs: Top 10 Greatest Hits

In the first place, the NetBeans Platform is a runtime container for desktop applications, comparable to an application server for web applications. Both handle common concerns, such as lifecycle management, for their target application type. However, secondly, the NetBeans Platform is a set of libraries.

In my (humble) opinion, these are the top 10 libraries offered by the NetBeans Platform APIs:

  1. Module System API. Enables the modular structure of NetBeans Platform applications. In the NetBeans sources, see package "org.openide.modules". Start reading about it here.

  2. Window System API. Enables you to create an application with advanced logical window functionality, such as drag/drop, dock/undock, maximize/minimize. In the NetBeans sources, package "org.openide.windows". Start reading about it here.

  3. Lookup API. Enables communication between modules similarly to the ServiceLoader class in JDK 6, as well as the context sensitivity of windows, nodes, and data objects in the application. This API can also be used outside the NetBeans Platform. In the NetBeans sources, package "org.openide.util.lookup". Start reading about it here.

  4. File System API. Enables the modules in an application to communicate by means of a virtual file system which is, by default, a hierarchical structure of folders and files defined in XML documents. In the NetBeans sources, package "org.openide.filesystems". Start reading about it here.

  5. Nodes API. Enables you to provide visual representations of underlying objects, i.e., these are NetBeans Platform JavaBeans. This API can also be used outside the NetBeans Platform. In the NetBeans sources, package "org.openide.nodes". Start reading about it here.

  6. Explorer & Property Sheet API. Enables you to render nodes in one of several NetBeans Platform Swing components that are, via the NetBeans ExplorerManager, loosely coupled to the rendered nodes. This API can also be used outside the NetBeans Platform. In the NetBeans sources, package "org.openide.explorer". Start reading about it here.

  7. Datasystems API (also known as "Loaders API"). Enables custom file types to be represented in the application. If the application does not make use of custom file types, this API can be ignored. In the NetBeans sources, package "org.openide.loaders". Start reading about it here.

  8. Actions API. Enables you to include actions that can be hooked up to menu items and toolbar buttons in your application, where you can define them as being always available or context sensitively enabled. In the NetBeans sources, package "org.openide.actions", with the related package "org.openide.util.actions". Start reading about it here.

  9. Visual Library API. Enables you to add widgets to your application, with common functionality, such as 'zoom' and 'move' provided out of the box. This API can also be used outside the NetBeans Platform. In the NetBeans sources, package "org.netbeans.api.visual". Start reading about it here.

  10. What do you think..?

I doubt that there'll be much argument about the top 9 listed above (apart from, possibly, the Datasystems API, which those who don't use custom file types are probably not using; and potentially someone will argue that the whole 'runtime container' should be included in the first item, rather than just the Module System API). But... what should no. 10 be? Options? I/O? Common Palette? Something else? Suggestions (with justifications!) welcome.

About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« October 2008 »
SunMonTueWedThuFriSat
   
2
7
8
11
12
20
24
25
27
31
 
       
Today