Geertjan's Blog

  • July 11, 2010

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

Geertjan Wielenga
Product Manager
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: cms.zip

Join the discussion

Comments ( 5 )
  • seb c Thursday, February 10, 2011

    Can you reattach the sources?

    I get a 404 error when trying to download from http://blogs.sun.com/geertjan/resource/cms.zip



  • Geertjan Wielenga Thursday, February 10, 2011

    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).

  • guest Thursday, July 14, 2011

    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.

  • Geertjan Thursday, July 14, 2011

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


  • Sérgio Saquetim Friday, September 21, 2012

    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!


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