From d2ee60be7cb93215b794a5beceda6e88fb739671 Mon Sep 17 00:00:00 2001 From: Alexander Lobas Date: Fri, 4 Apr 2014 17:57:26 +0400 Subject: [PATCH] Storyboard format --- .../com/intellij/designer/model/RadComponent.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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