boolean (@NotNull Window window, boolean modalOnly) { if (window instanceof IdeFrameImpl || (modalOnly && canBeHiddenBehind(window))) { return false; } if (window instanceof DialogWrapperDialog) { ((DialogWrapperDialog)window).getDialogWrapper().doCancelAction(); return !window.isVisible(); } window.setVisible(false); window.dispose(); return true; }