diff --git a/plugins/ui-designer-core/src/com/intellij/designer/model/RadComponent.java b/plugins/ui-designer-core/src/com/intellij/designer/model/RadComponent.java index 1a701775d42e..b2064e0cef84 100644 --- a/plugins/ui-designer-core/src/com/intellij/designer/model/RadComponent.java +++ b/plugins/ui-designer-core/src/com/intellij/designer/model/RadComponent.java @@ -465,7 +465,6 @@ public abstract class RadComponent extends PropertiesContainer { // ////////////////////////////////////////////////////////////////////////////////////////// - public static List getError(RadComponent component) { List errorInfos = component.getClientProperty(ERROR_KEY); return errorInfos == null ? Collections.emptyList() : errorInfos; @@ -558,4 +557,17 @@ public abstract class RadComponent extends PropertiesContainer { return components; } + + public boolean isAncestorFor(@NotNull RadComponent component, boolean strict) { + RadComponent parent = strict ? component.getParent() : component; + while (true) { + if (parent == null) { + return false; + } + if (parent == this) { + return true; + } + parent = parent.getParent(); + } + } } \ No newline at end of file