boolean (@NotNull Editor editor) { for (Component parent : UIUtil.uiParents(editor.getComponent(), false)) { if (parent instanceof JComponent) { ComponentValidator validator = ComponentValidator.getInstance((JComponent)parent).orElse(null); if (validator != null && validator.getValidationInfo() != null) { return true; } } } return false; }