Browse Source

Pull request #6731: REPORT-62554 再打开设计器模板会空白

Merge in DESIGN/design from ~HENRY.WANG/design:release/10.0 to release/10.0

* commit 'a992039144f20522d64e707de1da6ec46e4bed2c':
  REPORT-62554 再打开设计器模板会空白
zheng-1641779399395
Henry.Wang 3 years ago
parent
commit
d72bc467a6
  1. 16
      designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java

16
designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java

@ -73,15 +73,13 @@ class FormApp extends AbstractAppProvider {
@Override @Override
public JTemplate<?, ?> call() throws Exception { public JTemplate<?, ?> call() throws Exception {
OpenResult<Form, Parameter[]> result = worker.getResult(); OpenResult<Form, Parameter[]> result = worker.getResult();
return (JTemplate<Form, ?>) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, return getJForm(result.getBaseBook(), tplFile, result.getRef());
new Object[]{result.getBaseBook(), tplFile, result.getRef()}, classType, BaseJForm.class);
} }
}); });
worker.start(tplFile.getPath()); worker.start(tplFile.getPath());
OpenResult<Form, Parameter[]> result = worker.getResult(); OpenResult<Form, Parameter[]> result = worker.getResult();
if (result != null) { if (result != null) {
return (JTemplate<Form, ?>) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, return getJForm(result.getBaseBook(), tplFile, result.getRef());
new Object[]{result.getBaseBook(), tplFile, new Parameter[0]}, classType, BaseJForm.class);
} }
return emptyForm; return emptyForm;
} else { } else {
@ -90,6 +88,16 @@ class FormApp extends AbstractAppProvider {
} }
} }
@Nullable
private JForm getJForm(Form form, FILE file, Parameter[] parameters) {
try {
return new JForm(form, file, parameters);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e, e.getMessage());
return null;
}
}
@Nullable @Nullable
private Form getForm(FILE tplFile) { private Form getForm(FILE tplFile) {
ReadXmlTypeLocalManager.setReadXmlType(ReadXmlType.DESIGN); ReadXmlTypeLocalManager.setReadXmlType(ReadXmlType.DESIGN);

Loading…
Cancel
Save