From f97d4f55bd3378af3080084b63589f2689f02f9f Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Wed, 20 Oct 2021 10:55:14 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-52578=2010.0=E5=85=BC=E5=AE=B9=E6=96=B0?= =?UTF-8?q?=E8=87=AA=E9=80=82=E5=BA=94=E6=8F=92=E4=BB=B6=E7=9A=84=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E4=BB=A3=E7=A0=81=E5=9C=A811.0=E4=B8=AD=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E6=94=B9=E6=88=90=E5=BC=82=E6=AD=A5=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/app/FormApp.java | 47 +++++++++---------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java b/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java index 286890303..c048edbd0 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java @@ -58,36 +58,31 @@ class FormApp extends AbstractAppProvider { * @return */ private JTemplate compatibleForm(FILE tplFile, HashMap 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> worker = new OpenWorker<>( - new Callable>() { - @Override - public OpenResult call() throws Exception { - Form form = getForm(tplFile); - return new OpenResult<>(form, form.getParameters()); - } - }, emptyForm); - worker.addCallBack(new Callable>() { - @Override - public JTemplate call() throws Exception { - OpenResult result = worker.getResult(); - return (JTemplate) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, - new Object[]{result.getBaseBook(), tplFile, result.getRef()}, classType, BaseJForm.class); - } - }); - worker.start(tplFile.getPath()); - OpenResult result = worker.getResult(); - if (result != null) { + classType.put(Constants.ARG_2, Parameter[].class); + JForm emptyForm = new JForm(new Form(new WBorderLayout("form")), tplFile); + OpenWorker> worker = new OpenWorker<>( + new Callable>() { + @Override + public OpenResult call() throws Exception { + Form form = getForm(tplFile); + return new OpenResult<>(form, form.getParameters()); + } + }, emptyForm); + worker.addCallBack(new Callable>() { + @Override + public JTemplate call() throws Exception { + OpenResult result = worker.getResult(); return (JTemplate) 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 result = worker.getResult(); + if (result != null) { return (JTemplate) 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