Browse Source

真正成因: XNameWidegt漏加setEnable

bugfix/10.0
Hades 6 years ago
parent
commit
84d6fdb7ec
  1. 9
      designer-base/src/main/java/com/fr/design/gui/core/UserDefinedWidgetOption.java
  2. 4
      designer-form/src/main/java/com/fr/design/designer/creator/XNameWidget.java
  3. 2
      designer-form/src/main/java/com/fr/design/mainframe/FormParaPane.java
  4. 2
      designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java

9
designer-base/src/main/java/com/fr/design/gui/core/UserDefinedWidgetOption.java

@ -9,19 +9,14 @@ import com.fr.form.ui.Widget;
public class UserDefinedWidgetOption extends WidgetOption { public class UserDefinedWidgetOption extends WidgetOption {
private String widgetConfigName; private String widgetConfigName;
private Widget widget;
public UserDefinedWidgetOption(String name, Widget widget) { public UserDefinedWidgetOption(String name) {
this.widgetConfigName = name; this.widgetConfigName = name;
this.widget = widget;
} }
@Override @Override
public Widget createWidget() { public Widget createWidget() {
Widget widget = new NameWidget(widgetConfigName); return new NameWidget(widgetConfigName);
widget.setEnabled(this.widget.isEnabled());
widget.setVisible(this.widget.isVisible());
return widget;
} }
@Override @Override

4
designer-form/src/main/java/com/fr/design/designer/creator/XNameWidget.java

@ -68,7 +68,9 @@ public class XNameWidget extends XWidgetCreator {
Widget widget; Widget widget;
if (wc != null && (widget= wc.toWidget()) != null) { if (wc != null && (widget= wc.toWidget()) != null) {
editor = XCreatorUtils.createXCreator(widget); editor = XCreatorUtils.createXCreator(widget);
toData().setVisible(widget.isVisible()); Widget currentWidget = toData();
currentWidget.setVisible(widget.isVisible());
currentWidget.setEnabled(widget.isEnabled());
this.setBorder(null); this.setBorder(null);
} else { } else {
this.setBorder(DEFALUTBORDER); this.setBorder(DEFALUTBORDER);

2
designer-form/src/main/java/com/fr/design/mainframe/FormParaPane.java

@ -157,7 +157,7 @@ public class FormParaPane extends JPanel {
//预定义控件工具栏这儿不显示工具栏中没有的预定义控件 //预定义控件工具栏这儿不显示工具栏中没有的预定义控件
continue; continue;
} }
predifinedwidgeList.add(new UserDefinedWidgetOption(name, widget)); predifinedwidgeList.add(new UserDefinedWidgetOption(name));
} }
} }
} }

2
designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java

@ -256,7 +256,7 @@ public class FormParaWidgetPane extends JPanel {
//预定义控件工具栏这儿不显示工具栏中没有的预定义控件 //预定义控件工具栏这儿不显示工具栏中没有的预定义控件
continue; continue;
} }
predifinedwidgeList.add(new UserDefinedWidgetOption(name, widget)); predifinedwidgeList.add(new UserDefinedWidgetOption(name));
} }
} }
} }

Loading…
Cancel
Save