@ -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 ) {