XiaXiang 8 years ago
parent
commit
ac5ea82b74
  1. 6
      designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java

6
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<String> 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;
}

Loading…
Cancel
Save