0

Here is the code which i am using to call the popup before closing,

@PostContextCreate void postContextCreate() {

}
@Execute
public void execute(final Shell shell,  MWindow window) {
    IWindowCloseHandler handler = new IWindowCloseHandler() {
        @Override
        public boolean close(MWindow window) {
            return MessageDialog.openConfirm(shell, "Close",
                    "You will loose data. Really close?");
        }
    };
    window.getContext().set(IWindowCloseHandler.class, handler);
}
Vishal89
  • 43
  • 1
  • 7
  • possible duplicate of [How to implement IWindowCloseHandler in Eclipse (e4) RCP?](http://stackoverflow.com/questions/22173143/how-to-implement-iwindowclosehandler-in-eclipse-e4-rcp) – greg-449 Mar 12 '15 at 07:49
  • i have followed that previous post but i am unable to get the popup – Vishal89 Mar 12 '15 at 07:51
  • Then show us the code you have tried – greg-449 Mar 12 '15 at 07:51
  • I have followed the same code as mentioned in the previous post , i am unable to register the iwindowclose handler in the eclipse context. – Vishal89 Mar 12 '15 at 07:55
  • Note: The close handler is not called if you use Quit to exit the app. Is that what you are doing? – greg-449 Mar 12 '15 at 08:01
  • Hi greg , i have provided my code . I am still unable to get the popup – Vishal89 Mar 12 '15 at 09:08
  • If this is the LifeCycle class @Execute is never run in that class. In the LifeCycle class you must use the exact code shown in my answer to the duplicate. – greg-449 Mar 12 '15 at 09:53
  • I have followed your previous post and corrected my previous code,its woring fine now. Thanks for you guidance. – Vishal89 Mar 12 '15 at 10:51

0 Answers0