@ -54,28 +54,33 @@ public class StartUseAction implements ActionListener {
} . execute ( ) ;
} . execute ( ) ;
}
}
/ * *
* 打开模板并打开文件目录
* * /
void open ( String fileName ) throws IOException {
void open ( String fileName ) throws IOException {
if ( Strings . isEmpty ( fileName ) ) {
if ( Strings . isEmpty ( fileName ) ) {
return ;
return ;
}
}
// 打开模板
openInDesigner ( fileName ) ;
// 打开系统文件夹
File parentDir = new File ( fileName ) . getParentFile ( ) ;
Desktop . getDesktop ( ) . open ( parentDir ) ;
}
void openInDesigner ( String fileName ) {
File fileNeedOpen = new File ( fileName ) ;
File fileNeedOpen = new File ( fileName ) ;
if ( fileName . endsWith ( FineMarketConstants . ZIP ) ) {
if ( fileName . endsWith ( FineMarketConstants . ZIP ) ) {
File [ ] files = fileNeedOpen . getParentFile ( ) . listFiles ( ) ;
File [ ] files = fileNeedOpen . getParentFile ( ) . listFiles ( ) ;
fileNeedOpen = getFirstCptOrFrm ( files ) ;
fileNeedOpen = getFirstCptOrFrm ( files ) ;
} else if ( fileName . endsWith ( FineMarketConstants . RAR ) ) {
} else if ( fileName . endsWith ( FineMarketConstants . RAR ) ) {
// rar直接打开系统文件夹
// rar资源没有解压,所以不用打开模板
File parentDir = new File ( fileName ) . getParentFile ( ) ;
Desktop . getDesktop ( ) . open ( parentDir ) ;
return ;
return ;
}
}
openInDesigner ( fileNeedOpen ) ;
}
void openInDesigner ( File file ) {
// 刷新目录
DesignerFrameFileDealerPane . getInstance ( ) . refresh ( ) ;
// 打开模板
// 打开模板
DesignerContext . getDesignerFrame ( ) . openTemplate ( new FileFILE ( file ) ) ;
DesignerContext . getDesignerFrame ( ) . openTemplate ( new FileFILE ( fileNeedOpen ) ) ;
}
}