Browse Source

Pull request #4219: REPORT-52085 装有老版本的新自适应插件 frm无法打开

Merge in DESIGN/design from ~HADES/design:release/10.0 to release/10.0

* commit '868cf0bd1507e2d5165f2d17adab4cf0209bd6ef':
  REPORT-52085 装有老版本的新自适应插件 frm无法打开
zheng-1641779399395
Hades 4 years ago
parent
commit
8ccf7acb45
  1. 22
      designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java

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

@ -18,6 +18,7 @@ import com.fr.exception.TplLockedException;
import com.fr.file.FILE;
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.Constants;
import com.fr.stable.bridge.StableFactory;
@ -57,20 +58,33 @@ class FormApp extends AbstractAppProvider {
@Override
public JTemplate<?, ?> call() throws Exception {
OpenResult<Form, Parameter[]> result = worker.getResult();
return (JTemplate<Form, ?>) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG,
new Object[]{result.getBaseBook(), tplFile, result.getRef()}, classType, BaseJForm.class);
return compatibleForm(result.getBaseBook(), result.getRef(), tplFile, classType);
}
});
FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Report_Template_Opening_And_Waiting", tplFile.getName()) + "...");
worker.start(tplFile.getPath());
OpenResult<Form, Parameter[]> result = worker.getResult();
if (result != null) {
return (JTemplate<Form, ?>) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG,
new Object[]{result.getBaseBook(), tplFile, new Parameter[0]}, classType, BaseJForm.class);
return compatibleForm(result.getBaseBook(), new Parameter[0], tplFile, classType);
}
return emptyForm;
}
/**
* 兼容外部注册的frm类型
*
* @return
*/
private JTemplate<Form, ?> compatibleForm(Form form, Parameter[] parameters, FILE tplFile, HashMap<String, Class> classType) {
if (ComparatorUtils.equals(StableFactory.getRegisteredClass(BaseJForm.XML_TAG).getName(), JForm.class)) {
return (JTemplate<Form, ?>) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG,
new Object[]{form, tplFile, parameters}, classType, BaseJForm.class);
} else {
return (JTemplate<Form, ?>) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG,
new Object[]{form, tplFile}, classType, BaseJForm.class);
}
}
@Override
public Form asIOFile(FILE file) {

Loading…
Cancel
Save