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