@ -3,6 +3,7 @@
* /
* /
package com.fr.start ;
package com.fr.start ;
import com.fr.base.extension.FileExtension ;
import com.fr.common.report.ReportState ;
import com.fr.common.report.ReportState ;
import com.fr.design.DesignerEnvManager ;
import com.fr.design.DesignerEnvManager ;
import com.fr.design.ExtraDesignClassManager ;
import com.fr.design.ExtraDesignClassManager ;
@ -34,6 +35,7 @@ import com.fr.stable.OperatingSystem;
import com.fr.start.event.LazyStartupEvent ;
import com.fr.start.event.LazyStartupEvent ;
import com.fr.workspace.base.WorkspaceStatus ;
import com.fr.workspace.base.WorkspaceStatus ;
import java.awt.Window ;
import java.awt.Window ;
import java.io.File ;
import java.io.File ;
import java.lang.reflect.Method ;
import java.lang.reflect.Method ;
@ -121,14 +123,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
}
}
File f = new File ( arg ) ;
File f = new File ( arg ) ;
String path = f . getAbsolutePath ( ) ;
String path = f . getAbsolutePath ( ) ;
boolean pathends1 = path . endsWith ( ".cpt" )
if ( isAcceptFilePathEnd ( path ) ) {
| | path . endsWith ( ".xls" ) ;
boolean pathends2 = path . endsWith ( ".xlsx" )
| | path . endsWith ( ".frm" ) ;
boolean pathends3 = path . endsWith ( ".form" )
| | path . endsWith ( ".cht" ) ;
boolean pathends4 = pathends1 | | pathends2 | | pathends3 ;
if ( pathends4 | | path . endsWith ( ".chart" ) ) {
file = new FileFILE ( f ) ;
file = new FileFILE ( f ) ;
}
}
}
}
@ -148,6 +143,21 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
}
}
}
}
private boolean isAcceptFilePathEnd ( String path ) {
FileExtension [ ] acceptFileExtensions = new FileExtension [ ] {
FileExtension . CPT , FileExtension . XLS , FileExtension . XLSX , FileExtension . FRM , FileExtension . CHT , FileExtension . VIS
} ;
for ( FileExtension acceptFileExtension : acceptFileExtensions ) {
String [ ] extensions = acceptFileExtension . getExtensions ( ) ;
for ( String extension : extensions ) {
if ( path . endsWith ( "." + extension ) ) {
return true ;
}
}
}
return false ;
}
private boolean openFile ( final DesignerFrame df , boolean isException , FILE file ) {
private boolean openFile ( final DesignerFrame df , boolean isException , FILE file ) {
//启动时打开指定文件的接口
//启动时打开指定文件的接口