Hi,
One solution is to use JFace's ApplicationWindow & override ApplicationWindow.close() method. This method is called when the user closes the window. You can then do something like:
public boolean close() {
String title = "Confirm";
String message = "Are you sure you want to close this window?";
if (org.eclipse.jface.dialogs.MessageDialog.openQuestion(Display.getCurrent().getActiveShell(), title, message)) {
super.close();
}
Hope it helps!