这是我用来在关闭之前调用弹出窗口的代码,
@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);
}