From 31088893d87d2830e25a9a3e543bdd37159e1c58 Mon Sep 17 00:00:00 2001 From: Hades Date: Mon, 17 Dec 2018 16:18:03 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-13614=20=E3=80=9010.0.2=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E9=A2=84=E5=AE=9A=E4=B9=89=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=B8=8D=E5=8F=AF=E7=94=A8=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/core/UserDefinedWidgetOption.java | 9 +++++++-- .../main/java/com/fr/design/mainframe/FormParaPane.java | 5 ++++- .../java/com/fr/design/mainframe/FormParaWidgetPane.java | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/core/UserDefinedWidgetOption.java b/designer-base/src/main/java/com/fr/design/gui/core/UserDefinedWidgetOption.java index 40490702d..d57875e38 100644 --- a/designer-base/src/main/java/com/fr/design/gui/core/UserDefinedWidgetOption.java +++ b/designer-base/src/main/java/com/fr/design/gui/core/UserDefinedWidgetOption.java @@ -9,14 +9,19 @@ import com.fr.form.ui.Widget; public class UserDefinedWidgetOption extends WidgetOption { private String widgetConfigName; + private Widget widget; - public UserDefinedWidgetOption(String name) { + public UserDefinedWidgetOption(String name, Widget widget) { this.widgetConfigName = name; + this.widget = widget; } @Override public Widget createWidget() { - return new NameWidget(widgetConfigName); + Widget widget = new NameWidget(widgetConfigName); + widget.setEnabled(this.widget.isEnabled()); + widget.setVisible(this.widget.isVisible()); + return widget; } @Override diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormParaPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormParaPane.java index 647a0dd8a..1d990aeb6 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormParaPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormParaPane.java @@ -1,10 +1,12 @@ package com.fr.design.mainframe; +import com.fr.base.BaseUtils; import com.fr.design.ExtraDesignClassManager; import com.fr.design.constants.UIConstants; import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.gui.core.UserDefinedWidgetOption; import com.fr.design.gui.core.WidgetOption; +import com.fr.design.gui.core.WidgetOptionFactory; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.utils.gui.LayoutUtils; @@ -25,6 +27,7 @@ import java.awt.event.ComponentEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.ArrayList; +import java.util.Arrays; import java.util.Iterator; /** @@ -154,7 +157,7 @@ public class FormParaPane extends JPanel { //预定义控件工具栏这儿不显示工具栏中没有的预定义控件 continue; } - predifinedwidgeList.add(new UserDefinedWidgetOption(name)); + predifinedwidgeList.add(new UserDefinedWidgetOption(name, widget)); } } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java index 1958056b3..76cf26439 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java @@ -256,7 +256,7 @@ public class FormParaWidgetPane extends JPanel { //预定义控件工具栏这儿不显示工具栏中没有的预定义控件 continue; } - predifinedwidgeList.add(new UserDefinedWidgetOption(name)); + predifinedwidgeList.add(new UserDefinedWidgetOption(name, widget)); } } }