Browse Source

REPORT-59952&REPORT-60057&REPORT-60139 解决打开空白模板和布局模板有差异的一类问题

research/11.0
方磊 3 years ago
parent
commit
ab7298f13f
  1. 8
      designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java

8
designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java

@ -15,6 +15,7 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.main.Form;
import com.fr.form.ui.container.WBorderLayout;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
@ -264,13 +265,12 @@ public class NewFormPane extends BasicPane {
private void newForm(String path) {
BaseJForm jForm;
try {
Form form = new Form(new WBorderLayout("form"));
if (StringUtils.isNotEmpty(path)) {
Form form = new Form();
form.readStream(NewFormPane.class.getResourceAsStream(path));
jForm = StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, new Object[]{form}, BaseJForm.class);
} else {
jForm = StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, BaseJForm.class);
form = (Form) form.cloneAsLayoutTemplate();
}
jForm = StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, new Object[]{form}, BaseJForm.class);
DesignerContext.getDesignerFrame().addAndActivateJTemplate((JTemplate<?, ?>) jForm);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);

Loading…
Cancel
Save