NetBeans HTML Editor and Groovy Editor in a Multiview Component (Part 1)

The reason I began investigating integrating the NetBeans HTML Editor into a multiview component is that Edvin Syse from Syse Data in Norway is porting this CMS to the NetBeans Platform:

So, each multiview component represents one article in the CMS. And each article in the CMS is represented by a domain object, with various fields for the article name, date, etc... as well as a field for HTML content. Hence the HTML content shown in the HTML tab of the multiview component should NOT come from an actual HTML file on disk. Instead, the NetBeans MemoryFileSystem should be used, while the features of the NetBeans HTML Editor should be made available for that specific field in the domain object.

After help from Vita Stejskal from the NetBeans editor team, everything is now working as expected:

To illustrate the point, I even integrated the NetBeans Groovy editor into the multiview component, within a new tab:

And one of the best things about it is that each tab is provided by a different module. Handy for the developers, handy for the end users, and handy for the pricing structure of the application.

Complete sources:



Can you reattach the sources?
I get a 404 error when trying to download from


Posted by seb c on February 09, 2011 at 08:50 PM PST #

Drop me a line at geertjan dot wielenga at oracle dot com and then I'll send them to you (my blog got too full with images and ZIPs, so I had to remove several of the larges ones, such as this one).

Posted by Geertjan Wielenga on February 09, 2011 at 08:52 PM PST #

Hi Geertjan,

can you do an example (with code snippets) on how to use the netbeans platform editor ? I mean simple things like "turn on" syntax highlight, line numbers etc.

There is a need for it and there is no proper documentation anywhere, I was looking for it but it seems that everyone is looking for it :

it is really frustrating to see all the fancy features in netbeans but its almost unbearable the luck of examples for such a simple task.

Posted by guest on July 13, 2011 at 10:57 PM PDT #

No, it's not a simple task. Anyway, here are the tutorials:

Posted by Geertjan on July 14, 2011 at 08:20 AM PDT #

Hi Mr. Geertjan,

I'm currently studying the Netbeans Platform and this example it's perfect for me. Thank you very much for that!

However, I'm struggling with something for the past weeks and since I couldn't find any suitable answer I wonder if you could point me in the right direction.

In your CMS system, if you edit any item, click in the HTML tab, then right click in the document tab and then Clone the editor, everything goes ok, but if you edit the document in the cloned window and then close it, the system will ask to save the document even if there is another window opened.

Worst, if you clone the remaining window again the text of the document won't reflect the editions made to the source. What I'm trying to do is correct this behavior but I'm totally stucked.

Since this is an old post, I'm not even sure that you will read it, but just in case, thanks!


Posted by Sérgio Saquetim on September 20, 2012 at 08:12 PM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed

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.


« July 2016