Griffon plugins walktrough: builders - No Fluff Just Stuff

Griffon plugins walktrough: builders

Posted by: Andres Almiray on March 20, 2009

The Griffon team is very excited with the latest release (0.1.0) as it sports a plugin system based on the one found in Grails. This means that the framework can now be extended in many ways, same as Grails can. The current list includes 14 plugins, and we're just getting started!. Let's review what they bring to the table, first stop: builder plugins.

SwingBuilder is one of the key components of a Griffon application, it allows you to build UIs using a DSL like approach, but as much as we love Swing its component set is simply not enough to create compelling UIs or even enterprise-grade applications, that is why third-party components suites (both open source and commercial) have been built. Because SwingBuilder is packaged with Groovy core it would be a bad idea to distribute a 3rd party swing set friendly version with it, luckily SwingBuilder is highly configurable, it can even be extended as this list of Griffon builders can attest. It is worth mentioning that each one of those builders can be used outside of a Griffon application, but given that the framework takes care of boring, repetitive tasks for you, why would you want to do that in the first place? ;-) The following screenshots were taken with a handy Griffon based application, called SwingPad, which basically is an exploratory tool for building UIs using the builders or to put in a another way, the closest thing to a WYSIWYG SwingBuilder editor.

1. FlamingoBuilder

Flamingo is a component suite developed by Kirill Grouchnikov (of Substance L&F fame), it includes useful components as JRibbon (based on Microsoft's design for Office) and friends, CommandButton and friends, BreadcrumBar, JFlexiSlider and resizable icons. The current release of the builder (0.1) does not provide support for JRibbon yet, as it is a highly customizable component (basically I need more time to configure the builder's knobs and levers). The following screenshot demonstrates resizable icons (svg based) and a FlexiSlider, and improvement over JSlider as it enables both discrete and continuous ranges at the same time for example



2. JideBuilder

JideSoft is a well-known company on the Swing components ecosystem, it provides a huge suite of components in both commercial and open source distributions. While the open source distributions is about 1/3 in size of the full commercial suite it still provides handy, enterprise grade components. The following screenshots shows JideButton, JideSplitButton and BannerPanel in action.



3. MacWidgetsBuilder

Ken Orr's brainchild, macwidgets was born out of a necessity to create Java applications that looked and behaved like native MacOSX applications. The good news is that you're able to use those components in other operating systems as well, as a matter of fact the following screenshot was taken on a Linux box



4. SwingXBuilder

The first builder to extend SwingBuilder, a product of Google's Summer of Code program, SwingXBuilder provides full access to all Swingx components, painters and effects, plus a personal favorite: withWorker, an abstraction over jdk5/jdk6's SwingWorker. The following screenshot demonstrates painters and bannerPanel



5. SwingxtrasBuilder

If you google "Swing component" chances are you'll find plenty of information on the previously described suites, as well as other projects that do not provide a suite themselves. SwingxtrasBuilder is an effort to group together those projects into a loosely coupled suite. At the moment the builder supports BalloonTip, xswingx and L2fprod. You may be aware that some of L2fprod's components can be found at SwingX too. This screenshot shows xswingx and BalloonTip in action



6. TrayBuilder

Last but not least there is TrayBuilder. This is the only exceptional builder that can't be used outside of Griffon, as it relies on Griffon's CompositeBuilder to do 50% of its job, the reason being that TrayBuilder allows you to place Swing components on the system tray, whose access unfortunately has to be done with pure AWT. Here is an example of the builder displaying some basic menus



All plugins can be installed using the 'griffon install-plugin' command, same way as in Grails. you may specify a particular version or let the command line figure out the latest stable version. If you happen to install the bash auto-completion script (as detailed here) then the command line will even suggest you which plugins can be installed ;-)

We'll cover the testing plugins on the next part.

Keep on Groovying!
Andres Almiray

About Andres Almiray

Andres is a Java/Groovy developer and a Java Champion with more than 20 years of experience in software design and development. He has been involved in web and desktop application development since the early days of Java. Andres is a true believer in open source and has participated on popular projects like Groovy, Griffon, and DbUnit, as well as starting his own projects (Json-lib, EZMorph, GraphicsBuilder, JideBuilder). Founding member of the Griffon framework and Hackergarten community event. https://ch.linkedin.com/in/aalmiray

Why Attend the NFJS Tour?

  • » Cutting-Edge Technologies
  • » Agile Practices
  • » Peer Exchange

Current Topics:

  • Languages on the JVM: Scala, Groovy, Clojure
  • Enterprise Java
  • Core Java, Java 8
  • Agility
  • Testing: Geb, Spock, Easyb
  • REST
  • NoSQL: MongoDB, Cassandra
  • Hadoop
  • Spring 4
  • Cloud
  • Automation Tools: Gradle, Git, Jenkins, Sonar
  • HTML5, CSS3, AngularJS, jQuery, Usability
  • Mobile Apps - iPhone and Android
  • More...
Learn More »