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);
}