From 74bd09155183f73365bb3a780c0cb4d36506f60e Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 28 Feb 2018 10:38:25 +0800 Subject: [PATCH] =?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/component/AlphaFineDialog.java | 49 ++++++++++++------- 1 file changed, 30 insertions(+), 19 deletions(-) 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 037316f848..d0788ff42f 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -391,25 +391,7 @@ public class AlphaFineDialog extends UIDialog { private void rebuildList(String searchText) { resetContainer(); if (searchText.startsWith(ADVANCED_SEARCH_MARK)) { - if (searchText.startsWith(ACTION_MARK_SHORT) || searchText.startsWith(ACTION_MARK)) { - storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length()); - buildActionList(storeText); - } else if (searchText.startsWith(DOCUMENT_MARK_SHORT) || searchText.startsWith(DOCUMENT_MARK)) { - storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length()); - buildDocumentList(storeText); - } else if (searchText.startsWith(FILE_MARK_SHORT) || searchText.startsWith(FILE_MARK)) { - storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length()); - buildFileList(storeText); - } else if (searchText.startsWith(CPT_MARK) || searchText.startsWith(FRM_MARK)) { - storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length()); - buildFileList(searchText); - } else if (searchText.startsWith(DS_MARK)) { - storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length()); - buildFileList(DS_NAME + storeText); - } else if (searchText.startsWith(PLUGIN_MARK_SHORT) || searchText.startsWith(PLUGIN_MARK)) { - storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length()); - buildPluginList(storeText); - } + dealWithSearchText(searchText); } else { storeText = searchText.trim(); doNormalSearch(storeText); @@ -417,6 +399,35 @@ public class AlphaFineDialog extends UIDialog { } + /** + * 处理搜索字符串 + * @param searchText + */ + private void dealWithSearchText(String searchText) { + if (searchText.startsWith(ACTION_MARK_SHORT) || searchText.startsWith(ACTION_MARK)) { + buildActionList(getStoreText(searchText)); + } else if (searchText.startsWith(DOCUMENT_MARK_SHORT) || searchText.startsWith(DOCUMENT_MARK)) { + buildDocumentList(getStoreText(searchText)); + } else if (searchText.startsWith(FILE_MARK_SHORT) || searchText.startsWith(FILE_MARK)) { + buildFileList(getStoreText(searchText)); + } else if (searchText.startsWith(CPT_MARK) || searchText.startsWith(FRM_MARK)) { + buildFileList(searchText); + } else if (searchText.startsWith(DS_MARK)) { + buildFileList(DS_NAME + getStoreText(searchText)); + } else if (searchText.startsWith(PLUGIN_MARK_SHORT) || searchText.startsWith(PLUGIN_MARK)) { + buildPluginList(getStoreText(searchText)); + } + } + + /** + * 截取字符串中关键词 + * @param searchText + * @return + */ + private String getStoreText(String searchText) { + return searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length()); + } + /** * 重置面板 */