boolean (@NotNull RelativePoint target) { if (component == null) return false; Component cmp = target.getOriginalComponent(); if (!cmp.isShowing()) return true; if (cmp instanceof MenuElement) return false; if (myActionButtons != null && myActionButtons.contains(cmp)) { return true; } if (UIUtil.isDescendingFrom(cmp, component)) return true; if (component == null || !component.isShowing()) return false; Point point = target.getScreenPoint(); SwingUtilities.convertPointFromScreen(point, component); return component.contains(point); }