diff --git a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index ef5f1aa58..5a1c89220 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -14,7 +14,6 @@ import com.fr.design.mainframe.alphafine.cell.model.FileModel; import com.fr.design.mainframe.alphafine.cell.model.MoreModel; import com.fr.design.mainframe.alphafine.cell.model.PluginModel; import com.fr.design.mainframe.alphafine.cell.render.ContentCellRender; -import com.fr.design.mainframe.alphafine.listener.ComponentHandler; import com.fr.design.mainframe.alphafine.listener.DocumentAdapter; import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.design.mainframe.alphafine.preview.ActionPreviewPane; @@ -325,10 +324,24 @@ public class AlphaFineDialog extends UIDialog { rebuildList(searchTextField.getText().toLowerCase()); return null; } + + @Override + protected void done() { + if (!isCancelled()) { + fireStopLoading(); + } + } }; this.searchWorker.execute(); } + /** + * 停止加载状态 + */ + private void fireStopLoading() { + searchListModel.resetState(); + } + /** * 重新构建搜索结果列表 * 先根据输入判断是不是隐藏的搜索功能 @@ -979,7 +992,7 @@ public class AlphaFineDialog extends UIDialog { public AlphaCellModel remove(int index) { AlphaCellModel object = myDelegate.get(index); myDelegate.remove(object); - fireIntervalRemoved(this, index, index); + fireContentsChanged(this, index, index); return object; } @@ -1007,6 +1020,12 @@ public class AlphaFineDialog extends UIDialog { private void setValidSelected(boolean selected) { isValidSelected = selected; } + + public void resetState() { + for (int i = 0; i< getSize(); i++) { + getElementAt(i).resetState(); + } + } } } \ No newline at end of file diff --git a/designer/src/com/fr/design/mainframe/alphafine/images/loading.gif b/designer/src/com/fr/design/mainframe/alphafine/images/loading.gif index 497dcbf96..35485e7ad 100644 Binary files a/designer/src/com/fr/design/mainframe/alphafine/images/loading.gif and b/designer/src/com/fr/design/mainframe/alphafine/images/loading.gif differ 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 a05021503..3756b03ae 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 @@ -21,7 +21,6 @@ import java.util.List; * Created by XiaXiang on 2017/3/27. */ public class ActionSearchManager implements AlphaFineSearchProcessor { - private static final MoreModel TITLE_MODEL = new MoreModel(Inter.getLocText("FR-Designer_Set")); private static ActionSearchManager actionSearchManager = null; private SearchResult filterModelList; private SearchResult lessModelList; @@ -58,7 +57,7 @@ public class ActionSearchManager implements AlphaFineSearchProcessor { lessModelList = new SearchResult(); moreModelList = new SearchResult(); if (StringUtils.isBlank(searchText)) { - lessModelList.add(TITLE_MODEL); + lessModelList.add(new MoreModel(Inter.getLocText("FR-Designer_Set"))); return lessModelList; } if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainAction()) { @@ -78,7 +77,7 @@ public class ActionSearchManager implements AlphaFineSearchProcessor { } if (result.size() < AlphaFineConstants.SHOW_SIZE + 1) { - lessModelList.add(0, TITLE_MODEL); + lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Set"))); if (result.size() == 0) { lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL); } else { 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 40eaea686..ebabc9aa2 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 @@ -19,7 +19,6 @@ import com.fr.stable.StringUtils; * Created by XiaXiang on 2017/3/27. */ public class DocumentSearchManager implements AlphaFineSearchProcessor { - private static final MoreModel TITLE_MODEL = new MoreModel(Inter.getLocText("FR-Designer_COMMUNITY_HELP")); private static DocumentSearchManager documentSearchManager = null; private SearchResult lessModelList; private SearchResult moreModelList; @@ -51,7 +50,7 @@ public class DocumentSearchManager implements AlphaFineSearchProcessor { lessModelList = new SearchResult(); moreModelList = new SearchResult(); if (StringUtils.isBlank(searchText)) { - lessModelList.add(TITLE_MODEL); + lessModelList.add(new MoreModel(Inter.getLocText("FR-Designer_COMMUNITY_HELP"))); return lessModelList; } if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainDocument()) { @@ -78,7 +77,7 @@ public class DocumentSearchManager implements AlphaFineSearchProcessor { } } if (searchResult.size() < AlphaFineConstants.SHOW_SIZE + 1) { - lessModelList.add(0, TITLE_MODEL); + lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_COMMUNITY_HELP"))); if (searchResult.size() == 0) { lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL); } else { @@ -105,7 +104,7 @@ public class DocumentSearchManager implements AlphaFineSearchProcessor { */ private SearchResult getNoConnectList() { SearchResult result = new SearchResult(); - result.add(0, TITLE_MODEL); + result.add(0, new MoreModel(Inter.getLocText("FR-Designer_COMMUNITY_HELP"))); result.add(AlphaFineHelper.NO_CONNECTION_MODEL); return result; } 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 843145f7d..21f2b5fc4 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 @@ -31,7 +31,6 @@ public class FileSearchManager implements AlphaFineSearchProcessor { private static final String DS_NAME = "dsname=\""; private static final String FRM_PREFIX = "k:frm "; private static final String CPT_PREFIX = "k:cpt "; - private static final MoreModel TITLE_MODEL = new MoreModel(Inter.getLocText("FR-Designer_Templates")); private static FileSearchManager fileSearchManager = null; private SearchResult filterModelList; private SearchResult lessModelList; @@ -77,7 +76,7 @@ public class FileSearchManager implements AlphaFineSearchProcessor { searchText = searchText.substring(MARK_LENGTH, searchText.length()); } if (StringUtils.isBlank(searchText) || ComparatorUtils.equals(searchText, DS_NAME)) { - lessModelList.add(TITLE_MODEL); + lessModelList.add(new MoreModel(Inter.getLocText("FR-Designer_Templates"))); return lessModelList; } @@ -102,7 +101,7 @@ public class FileSearchManager implements AlphaFineSearchProcessor { } if (result.size() < AlphaFineConstants.SHOW_SIZE + 1) { - lessModelList.add(0, TITLE_MODEL); + lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Templates"))); if (result.size() == 0) { lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL); } else { 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 e3be0c964..5855168d7 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 @@ -23,7 +23,6 @@ import java.net.URLEncoder; * Created by XiaXiang on 2017/3/27. */ public class PluginSearchManager implements AlphaFineSearchProcessor { - private static final MoreModel TITLE_MODEL = new MoreModel(Inter.getLocText("FR-Designer-Plugin_Addon")); private static PluginSearchManager pluginSearchManager = null; private SearchResult lessModelList; private SearchResult moreModelList; @@ -84,7 +83,7 @@ public class PluginSearchManager implements AlphaFineSearchProcessor { this.lessModelList = new SearchResult(); this.moreModelList = new SearchResult(); if (StringUtils.isBlank(searchText)) { - lessModelList.add(TITLE_MODEL); + lessModelList.add(new MoreModel(Inter.getLocText("FR-Designer-Plugin_Addon"))); return lessModelList; } if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainPlugin()) { @@ -111,7 +110,7 @@ public class PluginSearchManager implements AlphaFineSearchProcessor { } } if (searchResult.size() < AlphaFineConstants.SHOW_SIZE + 1) { - lessModelList.add(0, TITLE_MODEL); + lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer-Plugin_Addon"))); if (searchResult.size() == 0) { lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL); } else { @@ -134,7 +133,7 @@ public class PluginSearchManager implements AlphaFineSearchProcessor { private SearchResult getNoConnectList() { SearchResult result = new SearchResult(); - result.add(0, TITLE_MODEL); + result.add(0, new MoreModel(Inter.getLocText("FR-Designer-Plugin_Addon"))); result.add(AlphaFineHelper.NO_CONNECTION_MODEL); return result; } 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 1b6b2b658..69959830c 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 @@ -272,11 +272,11 @@ public class RecentSearchManager extends XMLFileManager implements AlphaFineSear @Override - public SearchResult getLessSearchResult(String searchText) { + public synchronized SearchResult getLessSearchResult(String searchText) { this.modelList = new SearchResult(); recentModelList = getRecentModelList(searchText); if (recentModelList != null && recentModelList.size() > 0) { - modelList.add(new MoreModel(Inter.getLocText("FR-Designer_AlphaFine_Latest"), false)); + modelList.add(new MoreModel(Inter.getLocText("FR-Designer_AlphaFine_Latest"))); } modelList.addAll(recentModelList); return modelList; diff --git a/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java b/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java index e9ec20295..176a24b24 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java +++ b/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java @@ -93,7 +93,7 @@ public class RecommendSearchManager implements AlphaFineSearchProcessor { private SearchResult getNoConnectList() { SearchResult result = new SearchResult(); - result.add(0, new MoreModel(Inter.getLocText("FR-Designer_AlphaFine_Recommend"), false)); + result.add(0, new MoreModel(Inter.getLocText("FR-Designer_AlphaFine_Recommend"))); result.add(AlphaFineHelper.NO_CONNECTION_MODEL); return result; }