Search the web
Sign In
New User? Sign Up
uispec4j
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
closing window   Message List  
Reply | Forward Message #542 of 610 |
Re: [uispec4j] closing window

Hi Laurent,

Thanks a lot, this is a very interesting suggestion.
There is indeed a call for improvement here.

However, I don't feel good about adding a 'close' service, next to 'dispose'... their resemblance may be misleading.

What about changing the dispose service implementation itself?

            window.dispatchEvent(new WindowEvent(
                                 window, WindowEvent.WINDOW_CLOSING));

=> listeners will get called (including your applicative ones), and the awt Window takes care of disposing.


Thanks again for bringing this to our attention,

Regards,

Pascal

On Jul 13, 2009, at 10:51 AM, Laurent wrote:

Hi,

In my application I have a window with no functional button to close it,
I'm relying on the closing button provided by the window manager. When the
user closes the window I want to display a (bit annoying) confirmation
JOptionPane.

In UISpec4J, the method to close a window when no functional button is
"dispose()" (which call the dispose() method on the actual window). My
problem is that I'm displaying the message window on WindowClosing event
which is not generated when calling dispose().

My solution is to generate a WindowClosing event myself like this:

private void closeWindow(final org.uispec4j.Window window) {
   final Container container = window.getAwtComponent();
   final WindowEvent event = new WindowEvent((java.awt.Window) container,
WindowEvent.WINDOW_CLOSING);
   for (final WindowListener listener :
container.getListeners(WindowListener.class)) {
       listener.windowClosing(event);
   }
}

I'm wondering if that kind of function should be added in uispec4j
(org.uispec4j.Window.close() for instance). What do you think of it?
Cheers,

Laurent.



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
   http://groups.yahoo.com/group/uispec4j/

<*> Your email settings:
   Individual Email | Traditional

<*> To change settings online go to:
   http://groups.yahoo.com/group/uispec4j/join
   (Yahoo! ID required)

<*> To change settings via email:
   mailto:uispec4j-digest@yahoogroups.com
   mailto:uispec4j-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
   uispec4j-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
   http://docs.yahoo.com/info/terms/




Tue Jul 14, 2009 11:02 am

pratmartyp
Offline Offline
Send Email Send Email

Forward
Message #542 of 610 |
Expand Messages Author Sort by Date

Hi, In my application I have a window with no functional button to close it, I'm relying on the closing button provided by the window manager. When the user...
Laurent
laurent+uispec4j@...
Send Email
Jul 14, 2009
8:24 am

Hi Laurent, Thanks a lot, this is a very interesting suggestion. There is indeed a call for improvement here. However, I don't feel good about adding a 'close'...
Pascal PRATMARTY
pratmartyp
Offline Send Email
Jul 14, 2009
11:03 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help