From b2b2b66e51f80104a2cdb1b2d9ee174762d252ad Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Thu, 14 Feb 2019 15:47:16 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-14569=2010.0release=E7=9A=84alphafine?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98=20=E5=AE=9A=E4=BD=8D?= =?UTF-8?q?=E5=88=B0=E6=98=AF=E5=A4=9A=E7=BA=BF=E7=A8=8B=E7=9A=84bug?= =?UTF-8?q?=EF=BC=8C=E6=9F=90=E4=BA=9B=E6=83=85=E5=86=B5=E4=B8=8Blist?= =?UTF-8?q?=E9=87=8C=E6=94=BE=E5=85=A5=E4=BA=86=E4=B9=8B=E5=89=8D=E7=9A=84?= =?UTF-8?q?=E7=BA=BF=E7=A8=8B=E6=90=9C=E7=B4=A2=E7=9A=84=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E3=80=82=E7=9B=AE=E5=89=8D=E7=AD=96=E7=95=A5=E6=98=AF=E5=90=84?= =?UTF-8?q?=E7=BA=BF=E7=A8=8B=E5=90=84=E8=87=AA=E7=BB=B4=E6=8A=A4=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E5=88=97=E8=A1=A8=EF=BC=8C=E8=8E=B7=E5=8F=96=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E5=90=8E=E5=86=8D=E8=B5=8B=E7=BB=99=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/alphafine/AlphaFineHelper.java | 6 +- .../alphafine/component/AlphaFineDialog.java | 68 ++++++++++--------- .../manager/impl/RecommendSearchManager.java | 8 ++- 3 files changed, 46 insertions(+), 36 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java index 1057d9286..a1c901d9f 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java @@ -104,8 +104,10 @@ public class AlphaFineHelper { List recentList = RecentSearchManager.getInstance().getRecentModelList(); List recommendList = RecommendSearchManager.getInstance().getRecommendModelList(); SearchResult filterResult = new SearchResult(); - filterResult.addAll(recentList); - filterResult.addAll(recommendList); + if(recentList != null && recommendList != null){ + filterResult.addAll(recentList); + filterResult.addAll(recommendList); + } return filterResult; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index 49f857014..c8ecd9303 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -489,21 +489,24 @@ public class AlphaFineDialog extends UIDialog { * @param searchText */ private void dealWithSearchText(String searchText) { + SearchListModel searchListModelTemp = new SearchListModel(new SearchResult()); + searchResultList.setModel(searchListModelTemp); if (searchText.startsWith(ACTION_MARK_SHORT) || searchText.startsWith(ACTION_MARK)) { - buildActionList(new String[]{getStoreText(searchText)}); + buildActionList(new String[]{getStoreText(searchText)}, searchListModelTemp); } else if (searchText.startsWith(DOCUMENT_MARK_SHORT) || searchText.startsWith(DOCUMENT_MARK)) { - buildDocumentList(new String[]{getStoreText(searchText)}); + buildDocumentList(new String[]{getStoreText(searchText)}, searchListModelTemp); } else if (searchText.startsWith(FILE_MARK_SHORT) || searchText.startsWith(FILE_MARK)) { - buildFileList(getStoreText(searchText), new String[]{getStoreText(searchText)}); + buildFileList(getStoreText(searchText), new String[]{getStoreText(searchText)}, searchListModelTemp); } else if (searchText.startsWith(CPT_MARK) || searchText.startsWith(FRM_MARK)) { - buildFileList(getStoreText(searchText), new String[]{searchText}); + buildFileList(getStoreText(searchText), new String[]{searchText}, searchListModelTemp); } else if (searchText.startsWith(DS_MARK)) { - buildFileList(getStoreText(searchText), new String[]{DS_NAME + getStoreText(searchText)}); + buildFileList(getStoreText(searchText), new String[]{DS_NAME + getStoreText(searchText)}, searchListModelTemp); } else if (searchText.startsWith(PLUGIN_MARK_SHORT) || searchText.startsWith(PLUGIN_MARK)) { - buildPluginList(new String[]{getStoreText(searchText)}); + buildPluginList(new String[]{getStoreText(searchText)}, searchListModelTemp); } else if (searchText.startsWith(SIMILAR_MARK)) { - buildSimilarList(new String[]{getStoreText(searchText)}); + buildSimilarList(new String[]{getStoreText(searchText)}, searchListModelTemp); } + searchListModel = searchListModelTemp; } /** @@ -535,51 +538,54 @@ public class AlphaFineDialog extends UIDialog { * @param searchText */ private void doNormalSearch(String searchText) { + SearchListModel searchListModelTemp = new SearchListModel(new SearchResult()); + searchResultList.setModel(searchListModelTemp); if (segmentationResult != null) { - buildRecentList(segmentationResult); - buildRecommendList(segmentationResult); - buildActionList(segmentationResult); - buildFileList(searchText, segmentationResult); - buildDocumentList(segmentationResult); - buildPluginList(segmentationResult); - buildSimilarList(segmentationResult); + buildRecentList(segmentationResult, searchListModelTemp); + buildRecommendList(segmentationResult, searchListModelTemp); + buildActionList(segmentationResult, searchListModelTemp); + buildFileList(searchText, segmentationResult, searchListModelTemp); + buildDocumentList(segmentationResult, searchListModelTemp); + buildPluginList(segmentationResult, searchListModelTemp); + buildSimilarList(segmentationResult, searchListModelTemp); } - searchListModel.addElement(new BottomModel()); + searchListModelTemp.addElement(new BottomModel()); + searchListModel = searchListModelTemp; } - private void buildDocumentList(final String[] searchText) { - addSearchResult(DocumentSearchManager.getInstance().getLessSearchResult(searchText)); + private void buildDocumentList(final String[] searchText, SearchListModel searchListModelTemp) { + addSearchResult(DocumentSearchManager.getInstance().getLessSearchResult(searchText), searchListModelTemp); } - private void buildFileList(String searchStr, final String[] searchText) { - addSearchResult(FileSearchManager.getInstance().getLessSearchResult(searchStr, searchText)); + private void buildFileList(String searchStr, final String[] searchText, SearchListModel searchListModelTemp) { + addSearchResult(FileSearchManager.getInstance().getLessSearchResult(searchStr, searchText), searchListModelTemp); } - private void buildActionList(final String[] searchText) { - addSearchResult(ActionSearchManager.getInstance().getLessSearchResult(searchText)); + private void buildActionList(final String[] searchText, SearchListModel searchListModelTemp) { + addSearchResult(ActionSearchManager.getInstance().getLessSearchResult(searchText), searchListModelTemp); } - private void buildPluginList(final String[] searchText) { - addSearchResult(PluginSearchManager.getInstance().getLessSearchResult(searchText)); + private void buildPluginList(final String[] searchText, SearchListModel searchListModelTemp) { + addSearchResult(PluginSearchManager.getInstance().getLessSearchResult(searchText), searchListModelTemp); } - private void buildRecommendList(final String[] searchText) { - addSearchResult(RecommendSearchManager.getInstance().getLessSearchResult(searchText)); + private void buildRecommendList(final String[] searchText, SearchListModel searchListModelTemp) { + addSearchResult(RecommendSearchManager.getInstance().getLessSearchResult(searchText), searchListModelTemp); } - private void buildRecentList(final String[] searchText) { - addSearchResult(RecentSearchManager.getInstance().getLessSearchResult(searchText)); + private void buildRecentList(final String[] searchText, SearchListModel searchListModelTemp) { + addSearchResult(RecentSearchManager.getInstance().getLessSearchResult(searchText), searchListModelTemp); } - private void buildSimilarList(final String[] searchText) { - addSearchResult(SimilarSearchManager.getInstance().getLessSearchResult(searchText)); + private void buildSimilarList(final String[] searchText, SearchListModel searchListModelTemp) { + addSearchResult(SimilarSearchManager.getInstance().getLessSearchResult(searchText), searchListModelTemp); } - private synchronized void addSearchResult(SearchResult searchResult) { + private synchronized void addSearchResult(SearchResult searchResult, SearchListModel searchListModelTemp) { for (AlphaCellModel object : searchResult) { AlphaFineHelper.checkCancel(); - searchListModel.addElement(object); + searchListModelTemp.addElement(object); } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java index b5f01f0b0..467eee07f 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java @@ -187,9 +187,11 @@ public class RecommendSearchManager implements AlphaFineSearchProvider { public List getRecommendModelList() { SearchResult result = new SearchResult(); - result.addAll(recommendModelList); - result.addAll(modelList); - result.addAll(moreModelList); + if(recommendModelList != null){ + result.addAll(recommendModelList); + result.addAll(modelList); + result.addAll(moreModelList); + } return result; }