From f3708aadeb90e02d8dce8725a18333496aa512e4 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Mon, 7 Sep 2020 20:38:16 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-38969=20=E4=BF=AE=E6=94=B9=E6=8C=89?= =?UTF-8?q?=E7=85=A7=E7=82=B9=E5=87=BB=E5=9D=90=E6=A0=87=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/designer/creator/XCreatorUtils.java | 7 +++++++ .../com/fr/design/mainframe/FormDesigner.java | 17 +++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java index 42069e4d8a..072e21fa9f 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java @@ -336,4 +336,11 @@ public class XCreatorUtils { } return IOUtils.readIcon(iconPath); } + + public static boolean containComponent(Container ancestor, Container xCreator) { + while (xCreator != null && xCreator.getParent() != ancestor) { + xCreator = xCreator.getParent(); + } + return xCreator != null; + } } \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index d66f1f2a6a..40da109cf2 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -191,6 +191,7 @@ public class FormDesigner extends TargetComponent