Browse Source

Pull request #4306: REPORT-52564 插件-新自适应-插件和新主jar有不兼容问题,有的模板切换新老模式不成功 &&REPORT-52554 安装了抽数缓存插件 存在npe

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

* commit 'dfa979bd453d9863273a71929f1ad3163881c695':
  REPORT-52554 安装了抽数缓存插件 存在npe
  REPORT-52564 插件-新自适应-插件和新主jar有不兼容问题,有的模板切换新老模式不成功
final/10.0
Kara 4 years ago
parent
commit
431c8999fc
  1. 2
      designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java
  2. 31
      designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java

2
designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java

@ -497,8 +497,10 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp
} }
public void refreshToolBar() { public void refreshToolBar() {
if (toolbarDef != null) {
toolbarDef.refreshToolBar(FORBIDDEN_SET); toolbarDef.refreshToolBar(FORBIDDEN_SET);
} }
}
public void checkEnable() { public void checkEnable() {

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

@ -44,6 +44,17 @@ class FormApp extends AbstractAppProvider {
HashMap<String, Class> classType = new HashMap<String, Class>(); HashMap<String, Class> classType = new HashMap<String, Class>();
classType.put(Constants.ARG_0, Form.class); classType.put(Constants.ARG_0, Form.class);
classType.put(Constants.ARG_1, FILE.class); classType.put(Constants.ARG_1, FILE.class);
FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Report_Template_Opening_And_Waiting", tplFile.getName()) + "...");
return compatibleForm(tplFile, classType);
}
/**
* 兼容外部注册的frm类型
*
* @return
*/
private JTemplate<Form, ?> compatibleForm(FILE tplFile, HashMap<String, Class> classType) {
if (ComparatorUtils.equals(StableFactory.getRegisteredClass(BaseJForm.XML_TAG), JForm.class)) {
classType.put(Constants.ARG_2, Parameter[].class); classType.put(Constants.ARG_2, Parameter[].class);
JForm emptyForm = new JForm(new Form(new WBorderLayout("form")), tplFile); JForm emptyForm = new JForm(new Form(new WBorderLayout("form")), tplFile);
OpenWorker<OpenResult<Form, Parameter[]>> worker = new OpenWorker<>( OpenWorker<OpenResult<Form, Parameter[]>> worker = new OpenWorker<>(
@ -58,30 +69,20 @@ 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 compatibleForm(result.getBaseBook(), result.getRef(), tplFile, classType); return (JTemplate<Form, ?>) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG,
new Object[]{result.getBaseBook(), tplFile, result.getRef()}, classType, BaseJForm.class);
} }
}); });
FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Report_Template_Opening_And_Waiting", tplFile.getName()) + "...");
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 compatibleForm(result.getBaseBook(), new Parameter[0], tplFile, classType); return (JTemplate<Form, ?>) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG,
new Object[]{result.getBaseBook(), tplFile, new Parameter[0]}, classType, BaseJForm.class);
} }
return emptyForm; 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 { } else {
return (JTemplate<Form, ?>) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, return (JTemplate<Form, ?>) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG,
new Object[]{form, tplFile}, classType, BaseJForm.class); new Object[]{asIOFile(tplFile), tplFile}, classType, BaseJForm.class);
} }
} }

Loading…
Cancel
Save