From 369bd13951c1f51916cb62fed336c8b2d60d42a4 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Mon, 14 Aug 2017 15:53:46 +0800 Subject: [PATCH] =?UTF-8?q?alphafine=E9=81=97=E7=95=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../search/manager/ActionSearchManager.java | 11 +++-------- .../search/manager/DocumentSearchManager.java | 10 +++------- .../alphafine/search/manager/FileSearchManager.java | 10 +++------- .../search/manager/PluginSearchManager.java | 12 ++++-------- 4 files changed, 13 insertions(+), 30 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/alphafine/search/manager/ActionSearchManager.java b/designer/src/com/fr/design/mainframe/alphafine/search/manager/ActionSearchManager.java index 3756b03aec..33387ffbcf 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/search/manager/ActionSearchManager.java +++ b/designer/src/com/fr/design/mainframe/alphafine/search/manager/ActionSearchManager.java @@ -74,15 +74,10 @@ public class ActionSearchManager implements AlphaFineSearchProcessor { if (!AlphaFineHelper.getFilterResult().contains(object)) { result.add(object); } - } - if (result.size() < AlphaFineConstants.SHOW_SIZE + 1) { + if (result.size() > 0 && result.size() < AlphaFineConstants.SHOW_SIZE + 1) { lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Set"))); - if (result.size() == 0) { - lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL); - } else { - lessModelList.addAll(result); - } + lessModelList.addAll(result); } else { lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Set"), Inter.getLocText("FR-Designer_AlphaFine_ShowAll"), true, CellType.ACTION)); lessModelList.addAll(result.subList(0, AlphaFineConstants.SHOW_SIZE)); @@ -97,4 +92,4 @@ public class ActionSearchManager implements AlphaFineSearchProcessor { public SearchResult getMoreSearchResult() { return moreModelList; } -} +} \ No newline at end of file diff --git a/designer/src/com/fr/design/mainframe/alphafine/search/manager/DocumentSearchManager.java b/designer/src/com/fr/design/mainframe/alphafine/search/manager/DocumentSearchManager.java index ebabc9aa23..cbd1d49884 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/search/manager/DocumentSearchManager.java +++ b/designer/src/com/fr/design/mainframe/alphafine/search/manager/DocumentSearchManager.java @@ -76,13 +76,9 @@ public class DocumentSearchManager implements AlphaFineSearchProcessor { searchResult.add(cellModel); } } - if (searchResult.size() < AlphaFineConstants.SHOW_SIZE + 1) { + if (searchResult.size() > 0 && searchResult.size() < AlphaFineConstants.SHOW_SIZE + 1) { lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_COMMUNITY_HELP"))); - if (searchResult.size() == 0) { - lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL); - } else { - lessModelList.addAll(searchResult); - } + lessModelList.addAll(searchResult); } else { lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_COMMUNITY_HELP"), Inter.getLocText("FR-Designer_AlphaFine_ShowAll"), true, CellType.DOCUMENT)); lessModelList.addAll(searchResult.subList(0, AlphaFineConstants.SHOW_SIZE)); @@ -114,4 +110,4 @@ public class DocumentSearchManager implements AlphaFineSearchProcessor { return moreModelList; } -} +} \ No newline at end of file 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 21f2b5fc40..ac7d4fbdcb 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 @@ -100,13 +100,9 @@ public class FileSearchManager implements AlphaFineSearchProcessor { } } - if (result.size() < AlphaFineConstants.SHOW_SIZE + 1) { + if (result.size() > 0 && result.size() < AlphaFineConstants.SHOW_SIZE + 1) { lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Templates"))); - if (result.size() == 0) { - lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL); - } else { - lessModelList.addAll(result); - } + lessModelList.addAll(result); } else { lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Templates"), Inter.getLocText("FR-Designer_AlphaFine_ShowAll"), true, CellType.FILE)); lessModelList.addAll(result.subList(0, AlphaFineConstants.SHOW_SIZE)); @@ -248,4 +244,4 @@ public class FileSearchManager implements AlphaFineSearchProcessor { public void setContainFrm(boolean containFrm) { isContainFrm = containFrm; } -} +} \ No newline at end of file diff --git a/designer/src/com/fr/design/mainframe/alphafine/search/manager/PluginSearchManager.java b/designer/src/com/fr/design/mainframe/alphafine/search/manager/PluginSearchManager.java index 5855168d7b..efcb02c4a3 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/search/manager/PluginSearchManager.java +++ b/designer/src/com/fr/design/mainframe/alphafine/search/manager/PluginSearchManager.java @@ -109,13 +109,9 @@ public class PluginSearchManager implements AlphaFineSearchProcessor { searchResult.add(cellModel); } } - if (searchResult.size() < AlphaFineConstants.SHOW_SIZE + 1) { - lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer-Plugin_Addon"))); - if (searchResult.size() == 0) { - lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL); - } else { - lessModelList.addAll(searchResult); - } + if (searchResult.size() > 0 && searchResult.size() < AlphaFineConstants.SHOW_SIZE + 1) { + lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Templates"))); + lessModelList.addAll(searchResult); } else { lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer-Plugin_Addon"), Inter.getLocText("FR-Designer_AlphaFine_ShowAll"), true, CellType.PLUGIN)); lessModelList.addAll(searchResult.subList(0, AlphaFineConstants.SHOW_SIZE)); @@ -142,4 +138,4 @@ public class PluginSearchManager implements AlphaFineSearchProcessor { public SearchResult getMoreSearchResult() { return this.moreModelList; } -} +} \ No newline at end of file