Harold Steptoe | 2 Sep 19:21
Picon

[groovy-user] SwingBuilding in a real application?


I'm currently investigating ways of integrating Groovy into an application
UI.  

I was initially thinking of using Groovy simply as an embedded script engine
allowing a user to customise menu actions. 

Now I am wondering how feasible it would be to use Groovy and SwingBuilder
to wire together the whole application at the surface level instead. 

This could be by 

a) At start time, reading in a number of scripts to configure the UI. 
b) Dynamically loading in a script which alters which UI 'views' are loaded
and how they are arranged. 

Has anyone tried putting together a large UI using Groovy and SwingBuilder? 
I'm thinking that this should have adequate performance because I'm just
wiring up components which do most of the work (out of the script execution
itself). 

I can see the potential of building a UI framework with much of the
functionality of a 'Portlet' style web app, but instead building a client
application.  

--

-- 
View this message in context: http://www.nabble.com/SwingBuilding-in-a-real-application--tp19274585p19274585.html
Sent from the groovy - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
(Continue reading)

Danno Ferrin | 2 Sep 20:46

Re: [groovy-user] SwingBuilding in a real application?

On Tue, Sep 2, 2008 at 11:24 AM, Harold Steptoe <paul-/KmwPUWnfB69FHfhHBbuYA@public.gmane.org> wrote:

I'm currently investigating ways of integrating Groovy into an application
UI.

I was initially thinking of using Groovy simply as an embedded script engine
allowing a user to customise menu actions.

Now I am wondering how feasible it would be to use Groovy and SwingBuilder
to wire together the whole application at the surface level instead.

This could be by

a) At start time, reading in a number of scripts to configure the UI.
b) Dynamically loading in a script which alters which UI 'views' are loaded
and how they are arranged.

Has anyone tried putting together a large UI using Groovy and SwingBuilder?
I'm thinking that this should have adequate performance because I'm just
wiring up components which do most of the work (out of the script execution
itself).

The API you are likely looking for is FactoryBuidlerSupport.build(String, GroovyClassLoader).  in your view script when you make your menus...

def contextLoader = getClass().getClassLoader()
def userScript = ... // however you get the scriot
SwingBuilder.build {
//...
 menuBar {
   build(userScript, contextLoader)
  }
}

and the script would be code as though it was included via a c-style #include statement.  Although not identically the same, they are sufficiantly similar,

 

I can see the potential of building a UI framework with much of the
functionality of a 'Portlet' style web app, but instead building a client
application.


Have you had a look at Griffon?  I haven't promoted it much, I'm waiting for 1.6 Beta 2 to release so I don't have to ship custom snapshots in the 0.0 release.

http://docs.codehaus.org/display/GROOVY/griffon
 
Not quite a portlet approach, but some alot of streamlining in a grails like fashion.

------------------------------------------------------
I'm Danno Ferrin, and I approved this message.
Harold Steptoe | 3 Sep 08:04
Picon

Re: [groovy-user] SwingBuilding in a real application?


This looks very interesting. I'm certainly interested to see what this looks
like once you release it. 

shemnon wrote:
>  
> Have you had a look at Griffon?  I haven't promoted it much, I'm waiting
> for
> 1.6 Beta 2 to release so I don't have to ship custom snapshots in the 0.0
> release.
> 
> http://docs.codehaus.org/display/GROOVY/griffon
> 
> Not quite a portlet approach, but some alot of streamlining in a grails
> like
> fashion.
> 
> ------------------------------------------------------
> I'm Danno Ferrin, and I approved this message.
> 
> 

--

-- 
View this message in context: http://www.nabble.com/SwingBuilding-in-a-real-application--tp19274585p19283411.html
Sent from the groovy - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Gmane