Another interesting choice is Abeille Forms, which is supported via a Builder and a plugin. Abeille Forms includes a visual designer that arranges the widgets with either JGoodies FormLayout or the JDK's GridBagLayout. Integrating these kind of views is a bit easier than the previous ones, as Abeille Forms views are usually distributed in either XML or a binary format. The plugin provides a View node that is capable of reading both formats. Follow these steps to setup a View of this type.#1 Install the Abeille Forms plugin
As with any oher plugin, just call the install-plugin
command with the name of the plugingriffon install-plugin abeilleform-builder
#2 Place the form definition in your source code
If you have direct access to the files generated by Abeille's designer then place them somewhere under griffon-app/resources
. Otherwise if the files are packaged in a jar, place the jar in your application's lib
directory. Alternatively you can use the Dependency DSL if the jar is available from a jar file repository (such as Maven or Ivy).#3 Use the formPanel node
As a final step you just need to use the formPanel
node in a regular Groovy View script. All of the form's elements will be exposed to the Script, which means you can tweak their bindings and actions too, like thisdialog(owner: mainFrame,
id: "loginDialog",
resizable: false,
pack: true,
locationByPlatform:true,
iconImage: imageIcon('/griffon-icon-48x48.png').image,
iconImages: [imageIcon('/griffon-icon-48x48.png').image,
imageIcon('/griffon-icon-32x32.png').image,
imageIcon('/griffon-icon-16x16.png').image]) {
formPanel('login.xml')
noparent {
bean(model, username: bind{ usernameField.text })
bean(model, password: bind{ passwordField.text })
bean(okButton, actionPerformed: controller.loginOk)
bean(cancelButton, actionPerformed: controller.loginCancel)
}
}