Download NetBeans!

20070331 Saturday March 31, 2007

Matisse for Groovy: The Early Days

I'm beginning to investigate the rewriting of Matisse for Groovy. What is abundantly clear, thus far, is that it will be impossible to support both Matisse for Java and Matisse for Groovy in the same NetBeans IDE. However, I suspect that SwingBuilder users (i.e., Groovy programmers) are not interested in programming straight Swing simultaneously with SwingBuilder, so that's okay.

The biggest problem is not the rewriting of the templates (e.g., there's a JFrame template that should be rewritten to a SwingBuilder Frame template and so on) that are used to generate the code. But the problem is that Swing containers like JFrame are represented in the IDE by two files simultaneously, a Java file and a Form file. The point is to change that representation from a Java file to a Groovy file. So, when a Groovy file is opened, there should be a Form file in the Design view for the layout and structure of the container, and a Groovy file in the Source view. That is the difficult part that I'm struggling with, meaning that I have to rewrite code in the "Form" module (which is the module that provides the Matisse GUI Builder).

The good news is that I've been able to take the Form module and completely separate it from the rest of the NetBeans sources, so that it is now part of my own module suite. And I've integrated my Groovy support code (e.g., Schliemann) into that Form module. Together with the "Coyote - Groovy Projects" module from the Coyote site (slightly modified as described in earlier blog entries) and the Groovy JAR from the embedded folder in the Groovy download, that's currently all I need for my module suite.

So, I now have three tabs (look at the toggle buttons below, for "Source", "Design", and "Console"). The Design view will be where Matisse will do its thing. Visually, this is how it looks:

Once I get the FormDataObject to work with Groovy instead of Java, assuming that is even possible, things should be well on their way to us having a Matisse for Groovy.

Mar 31 2007, 01:54:18 PM PDT Permalink

Trackback URL: http://blogs.sun.com/geertjan/entry/matisse_for_groovy_the_early
Comments:

Wow! this is the greatest news for my day! I was just wondering if Matisse make use of Groovy SwingBuilder it will make the generated code very clean. Also, it will be a good way to let people notice how cool Groovy is. Thank you, for posting this entry before April comes : )

Posted by deans4j on March 31, 2007 at 03:46 PM PDT #

This is great news. Having Matisse/Groovy integration makes a lot of sense. SwingBuilder is great for quick/simple UI's like dialogs, but for more complex UI's having Matisse will make big gains in developer productivity. Thank you for all your hard work on Groovy integration Geertjan!

Posted by Brian Moelk on March 31, 2007 at 07:34 PM PDT #

Wouldn't it be logical to speak to the Matisse team to enhance the base code to support code generation in different languages instead via some sort of plugin mechanism (Java, Groovy, JRuby, etc.). Wouldn't that be a more worthwhile enhancement to NB?

Posted by Jacek on April 01, 2007 at 01:07 AM PDT #

Thanks for the support, deans4j and Brian Moelk. Jacek, yes that would be logical, but if you knew how much work they currently have, there's no way you'd suggest that this is a doable activity in the near future. It would be a LOT of work to implement optimally. I hope that at some stage Matisse will be extendable without rewriting it as I am now doing. However, in the meantime, while that hasn't happened yet, I have to do it my own way, and I see no other way than the way I am now taking.

Posted by Geertjan on April 01, 2007 at 01:10 AM PDT #

very cool. this is great news. good by VB :-)

Posted by Markus on April 01, 2007 at 11:05 AM PDT #

园林公司园林公司花木租摆luhua18

Posted by 礼仪公司 on April 30, 2007 at 07:30 PM PDT #

Thanks lot for your hard work. It is the thing I want to finde for along time.

Posted by Maxgen on June 17, 2007 at 01:01 PM PDT #

What are the chances of getting rid of that bloody XML file for Matisse altogether. It seems we could do a lot with annotations. Also, Visual Studio's Form editor which works much the same way are using partial classes for this (generated code in one, user code in another) and it works great.

Posted by Casper on May 15, 2008 at 06:14 PM PDT #

It's been over two years since this post. What's the status of this? Is there a way to build a Groovy Swing app with a graphical designer?

Posted by Lee on April 28, 2009 at 08:00 AM PDT #

No. This stuff was pretty experimental and no progress has been made on it.

Posted by Geertjan on April 28, 2009 at 08:21 AM PDT #

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed