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