From ac5ea82b74dc182bd66aba8bb397d265490d305e Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Tue, 23 May 2017 22:30:40 +0800 Subject: [PATCH 1/6] rt --- .../alphafine/search/manager/RecentSearchManager.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java b/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java index 7971f7f9e..ca7df5417 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java +++ b/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java @@ -35,6 +35,7 @@ import java.util.Map; public class RecentSearchManager extends XMLFileManager implements AlphaFineSearchProcessor { private static final String XML_TAG = "AlphafineRecent"; + private static final int COUNT = 3; private static RecentSearchManager recentSearchManager = null; private static File recentFile = null; private List fileList; @@ -248,8 +249,9 @@ public class RecentSearchManager extends XMLFileManager implements AlphaFineSear for (String key : recentKVModelMap.keySet()) { if (ComparatorUtils.equals(key, searchText)) { recentModelList = recentKVModelMap.get(searchText); - if (recentModelList.size() > 3) { - return recentModelList.subList(0, 2); + int size = recentModelList.size(); + if (size > COUNT) { + return recentModelList.subList(size - COUNT, size); } return recentModelList; } From 9ac8dfe6afda1704a74ae5972a9b08a2eec5475f Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Tue, 23 May 2017 22:51:14 +0800 Subject: [PATCH 2/6] RT --- .../alphafine/search/manager/RecentSearchManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java b/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java index ca7df5417..9f060def6 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java +++ b/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java @@ -35,7 +35,7 @@ import java.util.Map; public class RecentSearchManager extends XMLFileManager implements AlphaFineSearchProcessor { private static final String XML_TAG = "AlphafineRecent"; - private static final int COUNT = 3; + private static final int MAX_SIZE = 3; private static RecentSearchManager recentSearchManager = null; private static File recentFile = null; private List fileList; @@ -250,8 +250,8 @@ public class RecentSearchManager extends XMLFileManager implements AlphaFineSear if (ComparatorUtils.equals(key, searchText)) { recentModelList = recentKVModelMap.get(searchText); int size = recentModelList.size(); - if (size > COUNT) { - return recentModelList.subList(size - COUNT, size); + if (size > MAX_SIZE) { + return recentModelList.subList(size - MAX_SIZE, size); } return recentModelList; } From ce1bccd2ed7510d170af1a7cdac8e48413f42b72 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Tue, 23 May 2017 23:14:02 +0800 Subject: [PATCH 3/6] rt --- .../design/mainframe/alphafine/cell/model/FileModel.java | 6 +++--- .../alphafine/search/manager/FileSearchManager.java | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/alphafine/cell/model/FileModel.java b/designer/src/com/fr/design/mainframe/alphafine/cell/model/FileModel.java index 8b9acea9b..6961962b7 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/cell/model/FileModel.java +++ b/designer/src/com/fr/design/mainframe/alphafine/cell/model/FileModel.java @@ -16,10 +16,10 @@ public class FileModel extends AlphaCellModel{ super(name, content, type); } - public FileModel(String name, String content, String filePath) { - super(name, content, CellType.FILE); + public FileModel(String name, String filePath) { + super(name, null, CellType.FILE); this.filePath = filePath; - setDescription(AlphaFineHelper.findFolderName(content)); + setDescription(AlphaFineHelper.findFolderName(filePath)); } public String getFilePath() { diff --git a/designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java b/designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java index 84c9a502a..7264e7e51 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java +++ b/designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java @@ -95,7 +95,7 @@ public class FileSearchManager implements AlphaFineSearchProcessor { } } if (test && !isAlreadyContain) { - FileModel model = new FileModel(node.getName(), node.getEnvPath().substring(ProjectConstants.REPORTLETS_NAME.length()), node.getEnvPath()); + FileModel model = new FileModel(node.getName(), node.getEnvPath()); this.filterModelList.add(model); } reader.close(); @@ -117,7 +117,7 @@ public class FileSearchManager implements AlphaFineSearchProcessor { private boolean searchFile(String searchText, FileNode node, boolean isAlreadyContain) { if (DesignerEnvManager.getEnvManager().getAlphafineConfigManager().isContainTemplate()) { if (node.getName().toLowerCase().contains(searchText.toLowerCase())) { - FileModel model = new FileModel(node.getName(), node.getEnvPath().substring(node.getName().length(), node.getEnvPath().length()),node.getEnvPath()); + FileModel model = new FileModel(node.getName(), node.getEnvPath()); this.filterModelList.add(model); isAlreadyContain = true; } @@ -178,8 +178,7 @@ public class FileSearchManager implements AlphaFineSearchProcessor { */ public static FileModel getModelFromCloud(String filePath) { String name = AlphaFineHelper.findFileName(filePath); - String content = AlphaFineHelper.findFolderName(filePath); - return new FileModel(name, content, filePath); + return new FileModel(name, filePath); } } From 09fe236ef76343a8c0c50102d403994e5e7bac5e Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Tue, 23 May 2017 23:22:32 +0800 Subject: [PATCH 4/6] rt --- .../src/com/fr/design/mainframe/alphafine/AlphaFineHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer/src/com/fr/design/mainframe/alphafine/AlphaFineHelper.java b/designer/src/com/fr/design/mainframe/alphafine/AlphaFineHelper.java index 60ef8a8ef..a647bf47d 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/AlphaFineHelper.java +++ b/designer/src/com/fr/design/mainframe/alphafine/AlphaFineHelper.java @@ -34,7 +34,7 @@ public class AlphaFineHelper { */ private static String getSplitText(String text, int index) { if (StringUtils.isNotBlank(text)) { - String[] textArray = text.split("/"); + String[] textArray = text.replaceAll("\\\\","/").split("/"); if (textArray != null && textArray.length > 1) { return textArray[textArray.length - index]; } From 7f73b92e0a7027751f172a9ce4d51990be614d3c Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Tue, 23 May 2017 23:59:02 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B4=A8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/search/manager/FileSearchManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java b/designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java index 7264e7e51..712331826 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java +++ b/designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java @@ -87,14 +87,14 @@ public class FileSearchManager implements AlphaFineSearchProcessor { BufferedReader reader = new BufferedReader(new FileReader(filePath)); String line; int columnNumber; - boolean test = false; + boolean isFoundInContent = false; while ((line = reader.readLine()) != null) { columnNumber = line.toLowerCase().indexOf(searchText); if (columnNumber != -1) { - test = true; + isFoundInContent = true; } } - if (test && !isAlreadyContain) { + if (isFoundInContent && !isAlreadyContain) { FileModel model = new FileModel(node.getName(), node.getEnvPath()); this.filterModelList.add(model); } From 016396ce78c6b1765dce56fcdac3f6855cf45b5c Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 24 May 2017 08:26:34 +0800 Subject: [PATCH 6/6] rt --- .../src/com/fr/design/mainframe/alphafine/AlphaFineHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer/src/com/fr/design/mainframe/alphafine/AlphaFineHelper.java b/designer/src/com/fr/design/mainframe/alphafine/AlphaFineHelper.java index a647bf47d..b6c482ff7 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/AlphaFineHelper.java +++ b/designer/src/com/fr/design/mainframe/alphafine/AlphaFineHelper.java @@ -34,7 +34,7 @@ public class AlphaFineHelper { */ private static String getSplitText(String text, int index) { if (StringUtils.isNotBlank(text)) { - String[] textArray = text.replaceAll("\\\\","/").split("/"); + String[] textArray = text.replaceAll("\\\\", "/").split("/"); if (textArray != null && textArray.length > 1) { return textArray[textArray.length - index]; }