avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Defoort <fi...@cirquedigital.com>
Subject Re: merlin swing apps
Date Wed, 22 Oct 2003 09:34:47 GMT
Stephen McConnell wrote:

> <snip/>
> I would take something like kernel/unit package as an example and 
> retro fit to handle the swing context (using a variant of 
> DefaultEmbeddedKernel as Alex suggested).  This will let you handle 
> errors, exceptions, etc.  I figure some of this will be changing but 
> the changes will be based on experience gained in different embedded 
> scenarios - and a swing scenario is more input.
> Cheers, Steve. 

Another related question: suppose I bootstrap my container and one of 
the components is actually
the swing application; how do I shut the kernel down when the user kills 
the swing app?

I can see a couple of different approaches:
1/ components are allowed to shutdown the kernel. Obviously there are 
"issues" with
this approach..
2/ let the bootstrapper make the main window and on windowClose() do 
and put the reference to the main window in the Context(); the actual 
components then can put stuff inside of the
main window, but cannot create other "root" windows...  Also has some 
problems in cases
where you want multiple top windows or different windows based on 
configuration settings
(e.g. my app runs in standalone and in plugin mode: standalone uses a 
JFrame, plugin mode
uses a JDialog and a slightly different gui -- it'd be nice to simply 
make this difference in
a config file).
3/ Put a RootWindowFactory in the Context -- instead of components doing 
a new JFrame,
they do a service.lookup("window-factory") and do 
the instance that gets created already has the windowClose() handler 
atl. set up.  Looks most
appealing to me for the moment... Also not 100% secure though..

All this obviously in the case of starting a merlin session for the gui 
app, not in the case of
deploying a "gui container" in an already running merlin. Which would 
still be the niftiest
solution. Actually this will have a similar 'problem': in that case I 
would need a way to
dispose of the container that created the window (as opposed to getting 
rid of the entire

any preferences and/or gotcha's ?

Thanks a lot,
- Filip

>> Thanks a lot,
>> - Filip
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
>> For additional commands, e-mail: dev-help@avalon.apache.org

To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org

View raw message