commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Sell <christian.s...@netcologne.de>
Subject Re: [Jelly] Running Jelly:SWT's withouth creating a new shell?
Date Fri, 31 Jan 2003 14:11:34 GMT
Hi,

is there a chance to get this running on non-Windows OS's as well?

Christian

James Strachan wrote:
> Hey Dag
> 
> From: "Dag Liodden" <dag@liodden.no>
> 
>>Hi all!
>>
>>I'm working on a JMX-console for JBoss and am looking into using Jelly:Swt
>>for scripting custom configurators for each MBean.
> 
> 
> Cool!
> 
> 
>>The simple scripting that
>>Jelly allows for SWT right now is really enough for the basic
>>layouts/operations that need to be done with the MBeans. However, I'm not
>>familiar with Jelly and I'm wondering how to execute a Jelly:Swt script
> 
> that
> 
>>does not create a new shell (in Swing - Frame). In other words, I'd just
>>like to know how to set a parent (shell) tag -outside- of a script and
> 
> then
> 
>>execute it. I have a main app with a gui and just want to place
>>script-generated composites (in Swing - Panel) inside that gui. It would
>>also be nice to get a ref of the generated object back to my main app. :)
>>
>>Any ideas? (this is probably a non-swt-specific :)
>>
>>If you answer, pleas cc me as I'm not on the list yet. :)
> 
> 
> This was an oversight - I've just patched the SWT tags in CVS so that a
> parent (shell or Container) can now be specified in an attribute.
> 
> e.g.
> 
> <tree parent="${someShell}">
>     ...
> </tree>
> 
> There's a demo of this working - if you cd to jelly/jelly-tags/swt and with
> a recent CVS HEAD of Maven type
> 
>     maven demo
> 
> You should get an SWT screen which you can click on the 'parent demo' button
> on the toolbar which runs the parentDemo.jelly script.
> 
> 
> If you want to export any widget at any point in the hierarchy as a variable
> so that you can use it either from Java code or pass it into some bean or
> method, just use the var attribute.
> 
> <table var="myTable">
>     ...
> </table>
> 
> then in Jelly code you could do something like...
> 
>     <j:useBean var="foo" class="com.acme.MyHelperBean" table="${myTable}"/>
> 
> which would invoke the setTable() method of the MyHelperBean.
> 
> or in normal Java code
> 
>     JellyContext context = new JellyContext()
>     context.runScript("foo.jelly");
>     Object table = context.getVariable( "myTable" );
> 
> 
> On a closing note, it'd be easy to extend JellySWT to add some richer JFace
> widgets too, so the JFace abstraction for content providers, label producers
> and such like could be used. While we're on the subjet, Van's recent
> articles on SWT and JFace are worth a read...
> 
> http://www-106.ibm.com/developerworks/library/os-ecgui1/?ca=dnt-43
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> __________________________________________________
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> 



Mime
View raw message