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.

Comments:

You missed Lexer API..

Also, how about adding Top 10 enhancements in 10th spot-
http://nbguru.wordpress.com/2008/08/23/top-10-enhancements-for-nb-platform-by-geertjan-wielenga/

Posted by Varun on October 19, 2008 at 04:36 AM PDT #

Lexer isn't part of the NetBeans Platform. It is part of NetBeans IDE and, since it is a module, can be reused on the NetBeans Platform. The point of this article is to focus on the NetBeans Platform's modules, not some application created on top of it.

Posted by Geertjan on October 20, 2008 at 03:16 AM PDT #

Geertjan, Thanks for the update. I was not aware of that..

Posted by Varun on October 20, 2008 at 03:37 AM PDT #

You mentioned Lookup, which IMHO is the greatest hit of all because it enables loose coupling between modules and allows you to replace implementations of many core NetBeans services with your own implementation if you like. It's part of the Utilities API, but there are many other things in the Utilities API that are extremely valuable for Swing application development.

Even if you're not using the NetBeans Platform, you can still just drop the org-openide-util.jar into the classpath of a standalone Swing application and gain the benefits of Lookup, plus other helpful things like Mutex, Parameters, RequestProcessor and WeakListeners. Plus, the utilities class itself has a lot of handy convenience methods for determining the operating system, image loading and manipulation, centering screen components and object comparison. In other words, it's the same things you wind up writing your own convenience classes and methods for, but these have been written by others -- and more importantly, they've generally been tested under a wide range of conditions over the years.

Posted by Tom Wheeler on October 20, 2008 at 04:05 AM PDT #

Good points. So, maybe the Utilities API should take the no. 10 spot? Lookup API is part of it, but you highlight various other parts of its parent API (and you can't get Lookup API without Utilities API, plus Utilities API is part of the runtime container). For these reasons, it seems to me that Utilities API needs to be included in the top 10 list. I agree also that Lookup API needs to be higher up, above Window System API. But... to put it above Module System API seems wrong to me.

Posted by Geertjan Wielenga on October 20, 2008 at 04:09 AM PDT #

Wow! I've just seen your screen cast on this topic on netbeans.tv ... it's fantastic. Please keep up and cover all ten API's mentioned.

Posted by Adam Skalny on October 23, 2008 at 06:33 AM PDT #

Definitely Adam. Hopefully part 2 will go up today. If not, it will be there early next week. Thanks for your support!

Posted by Geertjan Wielenga on October 23, 2008 at 09:12 PM PDT #

I found that PROPERTYSHEET api only working with nodes.
e.g.

public class MyNode extends AbstractNode {
....
@Override
protected Sheet createSheet() {
....
}
}

Is that any way the createsheet method could be called without extends the AbstractNode. Or maybe you have another option to create propertysheet in different way.

My idea is I want to display data from datagrid(on select or click) to properties window so user can update it directly without going to another form, or open another frame, etc.

thanks lot.

Posted by eric abd hal on November 16, 2008 at 11:19 AM PST #

This is all great information. Is there any way we can download the videos for offline viewing? The best time I have to watch these is during my commute on the train, but I can't get a fast enough connection for watching video.

I'm really looking to get into NetBeans RCP development for a couple of personal projects and I might push it at the company I work for if all goes well.

Posted by Steven on November 18, 2008 at 06:00 AM PST #

Hi, Geertjan.
This sieries is great, I have downloaded 1-7 thus far and can't wait for the rest. Do you have a estimated timeline as to when the rest will be available?
Thanx.

Posted by Neil on January 26, 2009 at 08:50 PM PST #

Hi Geertjan

First off a big thank you for creating this series of tutorials, I'm sure they will be of benefit to a great many people (myself included)

Unfortunately I have come across a problem, I would like to download the videos, as my internet is to slow to watch them (and there's nothing more irritating then a stutterng video!)

I did see that you got the series hosted at www.mediacast.sun.com, however this has its own problems, as the server does not support download resuming and the connection keeps on dropping!

Is there anyway that you could host the videos somewhere else?

Thanks

Posted by TimSparg on April 28, 2009 at 06:49 AM PDT #

Hallo Neil,

direct download links:

mediacast.sun.com/users/GWiel

Posted by Hans-Peter Dollhopf on May 25, 2009 at 01:33 AM PDT #

Hi, Geertjan

I know how to use BeanTreeView to render a tree based structure in to the top component.

But how to get a table in to topcompnent. Do we have any view that supports table like beanTreeView.. ???

If so can you please post a small example snippet on this .. !??

Thanks,
Krishna

Posted by Krishna on September 27, 2010 at 07:11 PM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
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
« April 2014
SunMonTueWedThuFriSat
  
12
13
14
24
25
26
27
28
29
30
   
       
Today