public void contentRemoveQuery(final ContentManagerEvent event) { if (event.getContent() == myContent) { final boolean canClose = closeQuery(); if (!canClose) { event.consume(); } } }
@Override public void contentRemoveQuery(ContentManagerEvent event) { if (event.getContent() == myContent) { if (!myIndicator.isCanceled() && shouldAskUser()) { int result = Messages.showOkCancelDialog( myProject, CompilerBundle.message("warning.compiler.running.on.toolwindow.close"), CompilerBundle.message("compiler.running.dialog.title"), Messages.getQuestionIcon()); if (result != Messages.OK) { event.consume(); // veto closing } myUserAcceptedCancel = true; } } }