Browse Source

Pull request #6281: REPORT-52578 10.0兼容新自适应插件的同步代码在11.0中需要改成异步的

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

* commit 'f97d4f55bd3378af3080084b63589f2689f02f9f':
  REPORT-52578 10.0兼容新自适应插件的同步代码在11.0中需要改成异步的
bugfix/11.0
Henry.Wang 3 years ago
parent
commit
8e4d396b5b
  1. 47
      designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java

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

@ -58,36 +58,31 @@ class FormApp extends AbstractAppProvider {
* @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);
JForm emptyForm = new JForm(new Form(new WBorderLayout("form")), tplFile);
OpenWorker<OpenResult<Form, Parameter[]>> worker = new OpenWorker<>(
new Callable<OpenResult<Form, Parameter[]>>() {
@Override
public OpenResult<Form, Parameter[]> call() throws Exception {
Form form = getForm(tplFile);
return new OpenResult<>(form, form.getParameters());
}
}, emptyForm);
worker.addCallBack(new Callable<JTemplate<?, ?>>() {
@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);
}
});
worker.start(tplFile.getPath());
OpenResult<Form, Parameter[]> result = worker.getResult();
if (result != null) {
classType.put(Constants.ARG_2, Parameter[].class);
JForm emptyForm = new JForm(new Form(new WBorderLayout("form")), tplFile);
OpenWorker<OpenResult<Form, Parameter[]>> worker = new OpenWorker<>(
new Callable<OpenResult<Form, Parameter[]>>() {
@Override
public OpenResult<Form, Parameter[]> call() throws Exception {
Form form = getForm(tplFile);
return new OpenResult<>(form, form.getParameters());
}
}, emptyForm);
worker.addCallBack(new Callable<JTemplate<?, ?>>() {
@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, new Parameter[0]}, classType, BaseJForm.class);
new Object[]{result.getBaseBook(), tplFile, result.getRef()}, classType, BaseJForm.class);
}
return emptyForm;
} else {
});
worker.start(tplFile.getPath());
OpenResult<Form, Parameter[]> result = worker.getResult();
if (result != null) {
return (JTemplate<Form, ?>) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG,
new Object[]{getForm(tplFile), tplFile}, classType, BaseJForm.class);
new Object[]{result.getBaseBook(), tplFile, new Parameter[0]}, classType, BaseJForm.class);
}
return emptyForm;
}
@Nullable

Loading…
Cancel
Save