From 78f3c06d3a448d9cfe08656c1f11009780f42a0b Mon Sep 17 00:00:00 2001 From: "Joe.Jiang" Date: Mon, 2 Dec 2019 20:17:46 +0800 Subject: [PATCH 1/3] =?UTF-8?q?REPORT-24478=20=E9=A2=84=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E8=AE=BE=E7=BD=AE=E4=B8=8D=E5=8F=AF=E7=94=A8?= =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E8=A7=81=E5=90=8E=E9=A2=84=E8=A7=88=E6=97=A0?= =?UTF-8?q?=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/widget/WidgetPane.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/widget/WidgetPane.java b/designer-realize/src/main/java/com/fr/design/widget/WidgetPane.java index 00e80c5d4..4fc678759 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/WidgetPane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/WidgetPane.java @@ -243,11 +243,22 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener if (item.getValue() instanceof Integer) { return getWidgetOptions()[(Integer) item.getValue()].createWidget(); } else if (item.getValue() instanceof String) { - return new NameWidget((String) item.getValue()); + return getPredefinedWidget((String) item.getValue()); } return null; } + private NameWidget getPredefinedWidget(String name) { + NameWidget nameWidget = new NameWidget(name); + WidgetInfoConfig mgr = WidgetInfoConfig.getInstance(); + WidgetConfig widgetConfig = mgr.getWidgetConfig(name); + nameWidget.setEnabled(widgetConfig.toWidget().isEnabled()); + nameWidget.setVisible(widgetConfig.toWidget().isVisible()); + nameWidget.setWidgetName(widgetConfig.toWidget().getWidgetName()); + + return nameWidget; + } + private WidgetOption[] getWidgetOptions() { return (WidgetOption[]) ArrayUtils.addAll(WidgetOption.getReportWidgetInstance(), ExtraDesignClassManager.getInstance().getCellWidgetOptions()); } From 3a8b21762d364d0681fc8bb307630aee9bba9574 Mon Sep 17 00:00:00 2001 From: "Joe.Jiang" Date: Tue, 3 Dec 2019 11:04:08 +0800 Subject: [PATCH 2/3] =?UTF-8?q?REPORT-24478=20=E9=A2=84=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E8=AE=BE=E7=BD=AE=E4=B8=8D=E5=8F=AF=E7=94=A8?= =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E8=A7=81=E5=90=8E=E9=A2=84=E8=A7=88=E6=97=A0?= =?UTF-8?q?=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/widget/WidgetPane.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/widget/WidgetPane.java b/designer-realize/src/main/java/com/fr/design/widget/WidgetPane.java index 4fc678759..16d7429f7 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/WidgetPane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/WidgetPane.java @@ -248,14 +248,15 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener return null; } + //为了保持预定义控件的配置界面不变,返回类型必须为NameWidget private NameWidget getPredefinedWidget(String name) { NameWidget nameWidget = new NameWidget(name); WidgetInfoConfig mgr = WidgetInfoConfig.getInstance(); - WidgetConfig widgetConfig = mgr.getWidgetConfig(name); - nameWidget.setEnabled(widgetConfig.toWidget().isEnabled()); - nameWidget.setVisible(widgetConfig.toWidget().isVisible()); - nameWidget.setWidgetName(widgetConfig.toWidget().getWidgetName()); - + Widget widget = mgr.getWidgetConfig(name).toWidget(); + nameWidget.setEnabled(widget.isEnabled()); + nameWidget.setVisible(widget.isVisible()); + nameWidget.setWidgetName(widget.getWidgetName()); + nameWidget.setWidgetPrivilegeControl(widget.getWidgetPrivilegeControl()); return nameWidget; } From 35fdd38f46f16d26a1fb10c1fc73830381df780f Mon Sep 17 00:00:00 2001 From: "Joe.Jiang" Date: Wed, 4 Dec 2019 10:07:24 +0800 Subject: [PATCH 3/3] =?UTF-8?q?REPORT-24478=20=E9=A2=84=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E8=AE=BE=E7=BD=AE=E4=B8=8D=E5=8F=AF=E7=94=A8?= =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E8=A7=81=E5=90=8E=E9=A2=84=E8=A7=88=E6=97=A0?= =?UTF-8?q?=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/widget/WidgetPane.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/widget/WidgetPane.java b/designer-realize/src/main/java/com/fr/design/widget/WidgetPane.java index 16d7429f7..d746c4066 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/WidgetPane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/WidgetPane.java @@ -251,12 +251,13 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener //为了保持预定义控件的配置界面不变,返回类型必须为NameWidget private NameWidget getPredefinedWidget(String name) { NameWidget nameWidget = new NameWidget(name); - WidgetInfoConfig mgr = WidgetInfoConfig.getInstance(); - Widget widget = mgr.getWidgetConfig(name).toWidget(); - nameWidget.setEnabled(widget.isEnabled()); - nameWidget.setVisible(widget.isVisible()); - nameWidget.setWidgetName(widget.getWidgetName()); - nameWidget.setWidgetPrivilegeControl(widget.getWidgetPrivilegeControl()); + WidgetInfoConfig manager = WidgetInfoConfig.getInstance(); + if (manager.getWidgetConfig(name) != null) { + Widget widget = manager.getWidgetConfig(name).toWidget(); + nameWidget.setWidgetName(widget.getWidgetName()); + nameWidget.setEnabled(widget.isEnabled()); + nameWidget.setVisible(widget.isVisible()); + } return nameWidget; }