Announcement Announcement Module
Collapse
No announcement yet.
How could I register a WindowAdapter? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    Hello,

    you could override ApplicationLifeCycleAdvisor's method:

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

    HTH

    Kambiz

    Comment


    • #3
      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.

      Comment


      • #4
        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.

        Comment

        Working...
        X