Geertjan's Blog

  • April 21, 2011

New & Cool in NetBeans Platform 7

Geertjan Wielenga
Product Manager
Together with NetBeans IDE 7, the latest & greatest release of the world's only modular Swing application framework, the NetBeans Platform, has also been pushed out the door.

The release notes can be found here. I asked the engineers working on the NetBeans Platform for the new features considered most significant. The list that resulted, a subset of the link above, is as follows:

  • @Messages. Use the @Messages annotation and you'll not need to work with bundle files anymore. Read this blog entry for all the great reasons for using this annotation. Be careful, this particular annotation is addictive and will slowly take over your life. See the System Properties Tutorial for a full blown example that makes heavy use of this annotation.

  • @TopComponent.\* Use the @TopComponent.\* annotations to register TopComponents in the window system. The annotations let you specify, among other things, the position and the default opened state of each window, as class-level annotations at the top of each TopComponent class. To try this out, use the "New Window Component" wizard and you'll end up with an annotated TopComponent class.

  • @Action\*. Use the @Action\* annotations to bind Actions to menus, toolbars, keyboard shortcuts, and popups on the NetBeans Platform. To try these out, use the "New Action" wizard, which will (instead of creating entries in a layer file) create an Action class with annotations. See the NetBeans Platform Quick Start for a full blown example that uses these annotations a lot.

  • @Mime\*. Use the @Mime\* annotations to bind features to MIME types. Read the NetBeans Zone article @MimeLocation, @MimeRegistration and @MimeRegistrations added for details.

  • @HelpSetRegistration. Use @HelpSetRegistration to register helpsets in the central registry, i.e., no need to manually use a layer anymore, since at compile time the registration will be done for you thanks to this annotation. To see this in action, use the "JavaHelp Help Set" wizard in the IDE.

  • Profiler integration with the NetBeans Platform. A subset of the Profiler has been added to the NetBeans Platform, enabling self-sampling, which is typically during the development phase. Visible evidence of this is the new Profile button in a deployed NetBeans Platform application.

  • Better IconView. The IconView looked quite bad previously, each node was displayed very large and no visualization was shown for the selected node. Read here on NetBeans Zone how Aljoscha Rittner, a NetBeans Dream Team member, fixed this problem and contributed it to the NetBeans sources.

  • Functional testing in Maven-based NetBeans Platform applications. Together with many enhancements in the Maven areas of NetBeans IDE, you can now refer to
    Functional Tests in a Maven-Based NetBeans Platform Application
    , since functional testing is now possible in Maven based NetBeans Platform applications. Also read about NbModuleSuite, since this is the key NetBeans API class used in this process.

  • Network Settings API. A new API, described here by Jirka Rechtacek, the API's author, in his blog.

  • New implementation of WeakSet with two new methods, 'putIfAbsent' and 'resize'. New method putIfAbsent gives access to key already stored in Set. Method resize allows to change capacity of internal hash map. Read about this here.

  • New native library lookup mechanism. You can now distribute native libraries into architecture and OS specific directories under modules/lib. Read about this here.

  • Better support for vi mode. Support for chunking edits via BEGIN_COMMIT_GROUP and END_COMMIT_GROUP. Read about this here.

Again, the full list of NetBeans Platform 7 changes can be found here.

Many of the NetBeans Platform tutorials have already been updated to NetBeans Platform 7, with many thanks to particularly Charles Bedon from NetCat for his involvement and the many reviews of the tutorials that he did. Other NetBeans Platform tutorials still need to be updated to 7.0 and this will occur during the coming weeks. A special focus will be placed on including the samples as downloads attached to each of the tutorials. Not all the samples in the New Project dialog have been updated yet, this should happen by the next release of NetBeans.

In addition to all of the above, quite a lot of NetBeans Platform training events have taken place in the past months. (I've personally traveled from Germany to Mexico City to Boston to Sweden to France in a matter of a few weeks recently.) Jesse Glick and Tim Boudreau were recently involved in training events too, as reported here, while Eppleton in Munich, Germany, led by NetBeans Dream Team member Toni Epple, now has a full blown classroom to cater to the growing demand for NetBeans Platform trainings there.

Let's also not forget to mention the various community contributions that assist work on the NetBeans Platform. On this front, I think first prize goes to the University of Southern Denmark in Odense, for Javeleon and Featureous. If you're using the NetBeans Platform and haven't checked out those two projects, you need to do so now, they're really great.

Finally, the NetBeans Platform 7.0 DZone Refcard has become available (sponsored by Eppleton), while a number of NetBeans Platform books are in the pipeline.

Join the discussion

Comments ( 6 )
  • Java Getriebe Saturday, April 23, 2011
    [Trackback] Mit erscheinen der Version 7 der NetBeans Plattform sind auch einige neue Annotations hinzugekommen. Es scheint als würden die NetBeans Entwickler so langsam das Potential dieses Programmierkonstruktes nutzen wollen. Mit allen Konsequenzen. Eine dieser...
  • Eirik Bakke Monday, December 17, 2012

    Hi, Geertjan--hope you're doing well! If I understand NetBeans Platform annotations correctly, they serve to replace equivalent entries in a module's layer.xml file. Is there a way to see the equivalent layer entries that are generated when I use annotations like @ActionID and @ActionReferences? I tried adding an empty layer and accessing the "<this layer in context>" node, but it doesn't seem to show the actions that were added using annoations.

  • Geertjan Tuesday, December 18, 2012

    Hi Eirik! To see the layer entries generated by the NetBeans annotation processor, go to the Files window (after you have built the module) and then look in the "build" folder, where you'll find a file named "generated-layer.xml".

  • guest Monday, January 28, 2013

    I'm attempting to use Bundle-related annotations in NB 7.2.

    However, when I try using a wrapper module that encapsulates jboss-client.jar from JBoss AS 7.1.3.Final, I get an error saying the symbol Bundle could not be found when creating a top component in a module dependent on said wrapper.

    I notice that AS 7.1.3.Final's jboss-client.jar is registering org.jboss.logging.processor.apt.LoggingToolsProcessor as an annotation processor via META-INF.services. This AP is interfering with NbBundleProcessor.

    Is manually removing javax.annotation.processing.Processor from that jar 's META-INF.services package the only way of working around this?

  • guest Friday, June 28, 2013

    Is it possible to have multiple annotations for one class? Say for instance you wanted to create undo and redo actions(this is just an example), could they be registered at the same place with the actions performed in the same class. What are possible ways to achieve what I wanted?

  • guest Sunday, June 30, 2013

    OK, I got the solutions following this tutorial you guys presented: https://platform.netbeans.org/tutorials/nbm-google.html

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.