The NetBeans Platform

This is the place revealing CERTivity implementation details.

The NetBeans Platform

Postby david » Fri Jun 01, 2012 2:57 pm

This post describes implementation details about how we use the NetBeans Platform[] on which CERTivity KeyStores Manager is built. The article is also published on augmented by an overview and snapshots.

Why CERTivity KeyStores Manager is using the NetBeans Platform
We decided to use the NetBeans Platform as the basis for CERTivity KeyStores Manager as a result of an internal evaluation and selection from multiple possibilities. We basically wanted:
- A professional look for our desktop application(s);
- A RCP that we could learn and use for more than one product because we target more desktop applications;
- A platform RCP based on Swing so that could run on as much target systems as possible, practically anywhere Swing can run;
- Uniform components and modules, created on the same philosophy, easy to interconnect, not just Swing components from disparate sources;
- Constant development;
- Maven integration.

NetBeans proved to be the single platform satisfying all of these needs. Besides, there is an active community which offers a lot of support for a better understanding and using of the platform and thus helping us to achieve optimal performance from the application that we have developed. Back in 2001 we also used the nb-editor module in an internal desktop application and we had a very nice experience - this was a plus on the long lasting and constant development and improvement of the NetBeans Platform and IDE.

We have also taking into consideration reviews of other developers who have successfully used it in their applications.

How CERTivity KeyStores Manager is using the NetBeans Platform
CERTivity KeyStores Manager is a relatively complex application handling KeyStores, Certificates and several type of keys (private, public, secret), and other PKI related elements. For this reason, we have used several of the NetBeans built-in facilities, such as the modular application development, the built-in GUI components, the data management, the built-in file system or the windows system.

Being an application which offers multiple features, we have grouped them into separate modules using the NetBeans modules system, each one handling some important part of the application, thus making it easier to add or remove features, or allowing parallel development. Using the modular structure we have also separated the core parts from the GUI representation allowing each one of them to be changed if necessary without affecting the others too much. The interaction and communication between modules was realized mostly with the help of the Lookup feature of the platform which allows our modules to communicate in a type-safe manner, and so we reduced the degree of dependency between modules. Although for now CERTivity KeyStores Manager is a standalone application, as we devised the application into modules we are not neglecting the possibility to create pluggable modules for the future, also depending on the marketing directions.

Below there are implementation specific details and facts:
- We are using maven as the building infrastructure hence we involved the NBM Maven Plugin (version 3.5) and so we are using the Maven POM approach for the project definitions;

- We experienced good native maven support in the NetBeans IDE and although the NetBeans documentation and examples are described more via the classic project approach we managed to use and configure everything we needed through the NBM Maven Plugin approach;

- Regarding the GUI, we have used many of the components offered by the NetBeans RCP such as the Top Components, Explorer Manager, Tree Table View components or the built-in dialogs. Because our application handles KeyStores and Certificates mainly, each opened KeyStore or Certificate is displayed using a Top Component. This, together with the Windows Management offered by the platform has allowed us to easily take advantage of the docking framework offered by the NetBeans RCP without writing additional code for this. The user can arrange the KeyStores and Certificates in any way he/she desires by simply dragging and dropping the KeyStore or Certificate tabs;

- Because each KeyStore contains more entries (KeyPairs or Certificates), for representing each KeyStore, we have used the TreeTableView component together with the Explorer Manager to display the content of a KeyStore in a tree-like structure, where each direct child of the root is a KeyStore entry (certificate, key pair or secret key). This has also allowed us to display additional information regarding each entry as the Nodes API provides a generic model for presenting the data. More than this, we have also used the sorting facility offered by the TreeTableView and we have managed to use a quick navigation through the nodes of the tree based on key-pressed events. In the next versions of CERTivity we intend to replace TreeTableView with OutlineView as it seems that the first one will be deprecated and has some bugs which are solved in the OutlineView;

- We have used the built-in event system to communicate between the modules of the application, providing a standard application context. For CERTivity this is necessary for performing actions on specific entries. For example when selecting a KeyStore entry into the KeyStore view, additional details can be displayed for the selected entry, or other actions from the context menu of the selected entry can be initiated using this system;

- The actions used for performing different operations are based on the AbstractAction class from the RCP, and most of the tasks which may take longer to execute (like signing or verifying JAR, PDF or XML files for example) are run on separate threads using the RequestProcessor component from the NetBeans platform;

- We have used the framework offered in the platform for Undo/Redo to implement the undo / redo functionality via extending the AbstractUndoableEdit for the tasks that can be performed on the KeyStores and the KeyStore entries some storing the whole state, some storing just the change;

- Another useful aspect of the platform that we have used is the File System which allowed us a better handling of the files in which the KeyStores and Certificates are stored thus allowing us to easily load from or save them back to disk. This was achieved using the built-in DataObject and FileObject components. This facilitated the process of marking the files which contain changes to be saved, without us having to implement additional support only for that;

- For displaying information message dialogs or other dialogs for some features (e.g. when displaying the results of the signature verification process for JAR, PDF or XML files, or when displaying the SSL certificate retriever functionality), we have used the built-in dialogs system using components such as DialogDescriptor, MessageDescriptor or DialogDisplayer, because they already handle most of the displaying process, so that we only had to set the messages or the panels to be displayed on the dialog. Also for similar reasons we have used for creating and displaying file choosers the FileChooserBuilder instead of creating the FileChoosers in the standard Swing manner;

- We have used many other GUI components which were already built in, such as the Tools -> Options dialog, which we have customized to fit our needs, starting from the existing component, or the status line provider which we used to display statistical information about the currently opened KeyStore such as the number of entries, KeyPair entries, SecretKey entries or Certificate entries, the number of selected entries and others;

- We've also done some nice work on aspects such as having menu items hidden for certain OS platforms, changing the Application version dynamically at build time based on the maven version or having the JavaHelp (org-netbeans-modules-javahelp) available with TOC entries synchronized with the contextual help topic.

- We are using Obfuscation and we have followed the NetBeans Guide on Proguard (;

- As we started with NetBeans 6.9 and then switched to NetBeans 7.0 which made extensive use of Annotation for the layer.xml we tried to cope with this as that will be the direction. There are still some items remaining in the layer.xml as we didn't find a place for them at that time. Such items are: hiding menu items, dealing with Submenus, handling toolbars;

- We used branding customizations such as the Splash Screen while loading the modules, versions, About screen;

- We successfully implemented persistence options, so that if there are opened KeyStores/Certificates when the application is closed, they will be remembered and reopened on the next launch, the user having the possibility to choose if the passwords of the KeyStores will also be remembered by the persistence mechanism or not.

Overall, we have used many components of the NetBeans platform which eased our development work and ensured a professional aspect for our application, allowing us to offer the users plenty of features grouped in an easy to use application.

Environment Details
CERTivity KeyStores Manager 1.0 was built using NetBeans Platform 7.0.1 via the NBM Maven Plugin (version 3.5). It was developed using NetBeans IDE, on systems running Windows XP & 7.

The build machine is Linux and our production is multiplatform; the recommended JRE is 1.6 from Oracle (Sun). We target end-users running all the main platforms Windows, Linux, and Mac OS X. For future CERTivity versions, we will keep up with the NetBeans Platform and the NBM Maven Plugin version.
Posts: 9
Joined: Wed Jan 11, 2012 8:00 am

Return to Implementation Specifics

Who is online

Users browsing this forum: No registered users and 0 guests