Results 1 to 4 of 4

Thread: How could I register a WindowAdapter?

  1. #1
    Join Date
    Oct 2005
    Posts
    29

    Default How could I register a WindowAdapter?

    Hi.
    I am building a simple spring-rcp application. One of my control (a JPanel) has to do some stuff before the application exit.
    In old swing applications, we register a WindowAdapter whose windowClosed method will do the stuff. How could I do this in a spring-rcp application?

  2. #2
    Join Date
    Aug 2004
    Location
    Mainz, Germany
    Posts
    42

    Default

    Hello,

    you could override ApplicationLifeCycleAdvisor's method:

    public boolean onPreWindowClose(ApplicationWindow window) {
    return true;
    }

    HTH

    Kambiz

  3. #3
    Join Date
    Oct 2005
    Posts
    29

    Default

    Quote Originally Posted by darabi
    Hello,

    you could override ApplicationLifeCycleAdvisor's method:

    public boolean onPreWindowClose(ApplicationWindow window) {
    return true;
    }

    HTH

    Kambiz
    Hnn. Thanks
    But the component I want to "close" is a JPanel(it is written by SUN). So the ApplicationLifeCycleAdvisor must ref to it.

  4. #4

    Default close a JPanel?

    You can not listen to a close on a JPanel

    If your jpanel needs to do something on close then I would in the ApplicationLifeCycleAdvisor's method:

    public boolean onPreWindowClose(ApplicationWindow window) {
    return true;
    }

    I would publish a close event...

    Then register the panel to listen for that event.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •