private boolean closeAllPopups(boolean forceRestoreFocus, Window window) { if (myDispatchStack.size() == 0) return false; boolean closed = true; for (IdePopupEventDispatcher each : myDispatchStack) { if (window != null && !(window instanceof Frame) && window == UIUtil.getWindow(each.getComponent())) { // do not close a heavyweight popup that is opened in the specified window continue; } if (forceRestoreFocus) { each.setRestoreFocusSilentely(); } closed &= each.close(); } return closed; }
boolean isPopupActive() { for (IdePopupEventDispatcher each : myDispatchStack) { if (each.getComponent() == null || !each.getComponent().isShowing()) { myDispatchStack.remove(each); } } return myDispatchStack.size() > 0; }
public boolean closeAllPopups(boolean forceRestoreFocus) { if (myDispatchStack.size() == 0) return false; boolean closed = true; for (IdePopupEventDispatcher each : myDispatchStack) { if (forceRestoreFocus) { each.setRestoreFocusSilentely(); } closed &= each.close(); } return closed; }
public boolean closeAllPopups() { if (myDispatchStack.size() == 0) return false; boolean closed = true; for (IdePopupEventDispatcher each : myDispatchStack) { closed &= each.close(); } return closed; }
public boolean isPopupWindow(Window w) { return myDispatchStack.stream() .flatMap(IdePopupEventDispatcher::getPopupStream) .map(JBPopup::getContent) .filter(Objects::nonNull) .anyMatch(jbPopupContent -> SwingUtilities.getWindowAncestor(jbPopupContent) == w); }
public void push(IdePopupEventDispatcher dispatcher) { if (!myDispatchStack.contains(dispatcher)) { myDispatchStack.add(dispatcher); } }
public void remove(IdePopupEventDispatcher dispatcher) { myDispatchStack.remove(dispatcher); }