Browse Source

REPORT-9314 【10.0一轮回归】模板目录无法显示excel文件也无法打开,9.0可以

后面有过滤的
master
ju 7 years ago
parent
commit
bf17d9f018
  1. 17
      designer-base/src/com/fr/design/gui/itree/filetree/TemplateFileTree.java

17
designer-base/src/com/fr/design/gui/itree/filetree/TemplateFileTree.java

@ -23,6 +23,7 @@ public class TemplateFileTree extends EnvFileTree {
public TemplateFileTree() {
super(ProjectConstants.REPORTLETS_NAME, null, null);
}
@ -30,6 +31,7 @@ public class TemplateFileTree extends EnvFileTree {
* 选中reportPath
*/
public void setSelectedTemplatePath(String templatePath) {
this.selectPath(templatePath);
}
@ -37,6 +39,7 @@ public class TemplateFileTree extends EnvFileTree {
* 返回选中的Template的路径
*/
public String getSelectedTemplatePath() {
FileNode fn = this.getSelectedFileNode();
if (fn != null && !fn.isDirectory()) {
String envPath = fn.getEnvPath();
@ -50,6 +53,7 @@ public class TemplateFileTree extends EnvFileTree {
}
public String[] getSelectedTemplatePaths() {
TreePath[] selectedTreePaths = this.getSelectionPaths();
if (ArrayUtils.isEmpty(selectedTreePaths)) {
return ArrayUtils.EMPTY_STRING_ARRAY;
@ -89,8 +93,8 @@ public class TemplateFileTree extends EnvFileTree {
do {
TreePath path = getPathForRow(row);
String text = convertValueToText(
path.getLastPathComponent(), isRowSelected(row),
isExpanded(row), true, row, false);
path.getLastPathComponent(), isRowSelected(row),
isExpanded(row), true, row, false);
if (text.toUpperCase().startsWith(prefix)) {
return path;
@ -101,9 +105,8 @@ public class TemplateFileTree extends EnvFileTree {
}
public FileNode[] listFile(String path) throws Exception {
return FRContext.getFileNodes().list(
path,
new FileExtension[]{FileExtension.CPT, FileExtension.FRM, FileExtension.CPTX, FileExtension.FRMX});
return FRContext.getFileNodes().list(path);
}
/*
@ -138,6 +141,7 @@ public class TemplateFileTree extends EnvFileTree {
}
protected ExpandMutableTreeNode[] loadChildTreeNodes(ExpandMutableTreeNode treeNode) {
FileNode[] fn_array = listFileNodes(treeNode);
return fileNodeArray2TreeNodeArray(fn_array);
@ -147,6 +151,7 @@ public class TemplateFileTree extends EnvFileTree {
* 把FileNode[]转成ExpandMutableTreeNode[]
*/
private ExpandMutableTreeNode[] fileNodeArray2TreeNodeArray(FileNode[] fileNodes) {
ExpandMutableTreeNode[] res = new ExpandMutableTreeNode[fileNodes.length];
for (int i = 0; i < res.length; i++) {
FileNode fn = fileNodes[i];
@ -161,6 +166,7 @@ public class TemplateFileTree extends EnvFileTree {
private FileNode[] listFileNodes(String filePath) {
FileNode[] fileNodes = null;
try {
fileNodes = listFile(filePath);
@ -191,6 +197,7 @@ public class TemplateFileTree extends EnvFileTree {
* 求当前TreeNode下所有的FileNode.
*/
private FileNode[] listFileNodes(ExpandMutableTreeNode currentTreeNode) {
if (currentTreeNode == null) {
return new FileNode[0];
}

Loading…
Cancel
Save