Browse Source

REPORT-24478 预定义控件设置不可用不可见后预览无效

feature/big-screen
Joe.Jiang 5 years ago committed by Joe.Jiang
parent
commit
78f3c06d3a
  1. 13
      designer-realize/src/main/java/com/fr/design/widget/WidgetPane.java

13
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) { if (item.getValue() instanceof Integer) {
return getWidgetOptions()[(Integer) item.getValue()].createWidget(); return getWidgetOptions()[(Integer) item.getValue()].createWidget();
} else if (item.getValue() instanceof String) { } else if (item.getValue() instanceof String) {
return new NameWidget((String) item.getValue()); return getPredefinedWidget((String) item.getValue());
} }
return null; 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() { private WidgetOption[] getWidgetOptions() {
return (WidgetOption[]) ArrayUtils.addAll(WidgetOption.getReportWidgetInstance(), ExtraDesignClassManager.getInstance().getCellWidgetOptions()); return (WidgetOption[]) ArrayUtils.addAll(WidgetOption.getReportWidgetInstance(), ExtraDesignClassManager.getInstance().getCellWidgetOptions());
} }

Loading…
Cancel
Save