From 78f3c06d3a448d9cfe08656c1f11009780f42a0b Mon Sep 17 00:00:00 2001 From: "Joe.Jiang" Date: Mon, 2 Dec 2019 20:17:46 +0800 Subject: [PATCH] =?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 00e80c5d47..4fc678759e 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()); }