public static void closeWindow(@NotNull Window window, boolean modalOnly) { if (window instanceof IdeFrameImpl) return; if (modalOnly && window instanceof Frame) return; if (window instanceof DialogWrapperDialog) { ((DialogWrapperDialog)window).getDialogWrapper().doCancelAction(); return; } window.setVisible(false); window.dispose(); }
private boolean dialogWrapperClose(Container window) { if (!(window instanceof DialogWrapperDialog)) return false; while (window instanceof DialogWrapperDialog) { DialogWrapperDialog dlg = (DialogWrapperDialog)window; window = window.getParent(); dlg.getDialogWrapper().doCancelAction(); } return true; }
@Nullable public static Window findWindowForBalloon(Project project) { Window frame = WindowManager.getInstance().getFrame(project); if (frame == null && project == null) { frame = KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow(); while (frame instanceof DialogWrapperDialog && ((DialogWrapperDialog)frame).getDialogWrapper().isModalProgress()) { frame = frame.getOwner(); } } if (frame == null && project == null) { frame = (Window)WelcomeFrame.getInstance(); } return frame; }
private boolean dialogWrapperClose(Container window) { if (!(window instanceof DialogWrapperDialog)) return false; while (window instanceof DialogWrapperDialog) { DialogWrapperDialog dlg = (DialogWrapperDialog)window; window = window.getParent(); dlg.getDialogWrapper().close(DialogWrapper.OK_EXIT_CODE); } return true; }
public static void closeWindow(@Nonnull Window window, boolean modalOnly) { if (window instanceof IdeFrameImpl) return; if (modalOnly && window instanceof Frame) return; if (window instanceof DialogWrapperDialog) { ((DialogWrapperDialog)window).getDialogWrapper().doCancelAction(); return; } window.setVisible(false); window.dispose(); }
@Nullable public static Window findWindowForBalloon(@Nullable Project project) { Window frame = WindowManager.getInstance().getFrame(project); if (frame == null && project == null) { frame = (Window)WelcomeFrame.getInstance(); } if (frame == null && project == null) { frame = KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow(); while (frame instanceof DialogWrapperDialog && ((DialogWrapperDialog)frame).getDialogWrapper().isModalProgress()) { frame = frame.getOwner(); } } return frame; }