Browse Source

REPORT-13614 【10.0.2回归】预定义控件设置不可用失效

bugfix/10.0
Hades 6 years ago
parent
commit
31088893d8
  1. 9
      designer-base/src/main/java/com/fr/design/gui/core/UserDefinedWidgetOption.java
  2. 5
      designer-form/src/main/java/com/fr/design/mainframe/FormParaPane.java
  3. 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,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

5
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));
}
}
}

2
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));
}
}
}

Loading…
Cancel
Save