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

Loading…
Cancel
Save