From d1494dc20b29311e840f4cacfdcf9795b125224d Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 24 May 2017 15:08:24 +0800 Subject: [PATCH] bug fix --- .../mainframe/alphafine/images/alphafine0.png | Bin 369 -> 0 bytes .../mainframe/alphafine/images/alphafine1.png | Bin 372 -> 418 bytes .../mainframe/alphafine/images/alphafine2.png | Bin 248 -> 372 bytes .../mainframe/alphafine/images/alphafine3.png | Bin 418 -> 248 bytes .../mainframe/alphafine/images/alphafine4.png | Bin 237 -> 369 bytes .../mainframe/alphafine/images/alphafine5.png | Bin 0 -> 237 bytes .../manager/RecommendSearchManager.java | 54 ++++++++++-------- .../AlphaFine/AlphafineConfigManager.java | 14 ++--- .../help/AlphaFine/AlphafineConfigPane.java | 18 +++--- .../design/locale/designer_zh_CN.properties | 2 +- 10 files changed, 46 insertions(+), 42 deletions(-) delete mode 100644 designer/src/com/fr/design/mainframe/alphafine/images/alphafine0.png create mode 100644 designer/src/com/fr/design/mainframe/alphafine/images/alphafine5.png diff --git a/designer/src/com/fr/design/mainframe/alphafine/images/alphafine0.png b/designer/src/com/fr/design/mainframe/alphafine/images/alphafine0.png deleted file mode 100644 index e23a33ab542ea640bb96bbd86d609624a7fd87e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 369 zcmV-%0gnEOP)_OaZPf)Q->&My_7?6NkeSLuTq(Z= P00000NkvXXu0mjfh`61) diff --git a/designer/src/com/fr/design/mainframe/alphafine/images/alphafine1.png b/designer/src/com/fr/design/mainframe/alphafine/images/alphafine1.png index aae79cb065f47bb3a700dd4941308fc908ed2ba2..8d5464a6d2575cb7d45471e4fda5e9ef09f324d6 100644 GIT binary patch delta 370 zcmV-&0ge9j0-^(uIe%11L_t(I%cYaCQN%D1MW1iTbyUDz2QWCtR{`$eM6BdGz#VV_ zj#L5!BoIe0agVj;ENH)LxPf(wEI`P|F5!f9Qn^WNe_7)R=^&(2HpWHR|Q-F z&w%yL93v)+736hT0v|w75(}IuE+|O_7~s@9GfXQumo275y}%ln}LwhFxQ&NO))3ZPTJk%PiJ z)8}=tz=Q7Fg}^Pa_RchNGy(^mjVeSjYhkvF2uP(#*xxA-NgKI2>JefBtDfU}mE9-p zJx=Du#ssZ`-fPrfd^t=ws06kma|^WDIF3<;PWrCAGs8rMMt4gfs_~^lGKmH71Z=!B zhq<|*ifjx67fDUZuo-vMKZ9@Yb@|ED;8TBYFRC4a+?g+HMl&Ed+;sEdpcyR`JlK1=_Qc8?TDh16TPZtpi zFy?)fhHQ|Stjv5uk#o2 WJ$Fkeu_s^v0000Wyv5QRS&A}68)(}6v6Du51b=bkZ+mAHf} zf#8(iRd99%hFrnX0oQ?40ZtZ=jCIDhGYkUl&)c_ev(3)$ffxR715i7oJV3VD`N!|F$P+ZqP!!mDh>4@}s#ydxGc* zrawuLl7N!0E(or$JF~N6CkX%-@(Xy-7880245m_N@BGOMC$fhjhw2;Oe;m0000!|F$P+ZqP!!mDh>4@}s#ydxGc* zrawuLl7N!0E(or$JF~N6CkX%-@(Xy-7880245m_N@BGOMC$fhjhw2;Oe;m00007JAiwH=iN!Z^h5J?-kIqDH&0;`_mdX?QL z?LAKB#l{4!f^6Q@Uwk=CIH&}+B6AD0**K0-g--geyfec@g+_NvAgb}DLNbX3@C0nU zGl#jkpNp9rq#>D&GGYGPm#)A5!fu9xUw>hdNHa*^9=Mgg05;m+$*v<9;1i6+o{c+@ RquT%g002ovPDHLkV1kW1r_KNX diff --git a/designer/src/com/fr/design/mainframe/alphafine/images/alphafine4.png b/designer/src/com/fr/design/mainframe/alphafine/images/alphafine4.png index 064f0d8e8afba4e54ecfdbabf3e0cb0a278026da..e23a33ab542ea640bb96bbd86d609624a7fd87e4 100644 GIT binary patch delta 322 zcmV-I0loh10r3KmIDY{nNklZ%LHQhk$BVjkMY64(O` zpnwSUz`+|e=GY4YZDTEsuPny^wBD%WnLyh({q2e0#}{z8N3e%?`3d!qc*Z90H0#7J2$Lc<89RiC*Q8>!uA&K8<3gG ULtH7p1poj507*qoM6N<$g4ynuE&u=k delta 189 zcmV;u07C!q0__2iIDY`2Nkl2bgD$m-`GP!0}QBmfP8_06yknkClUGvoaiHOPi58O@M3708%^E z+>@L5Qa=gEKIYTb01GTY@-bgG_=72>{Pz#+0FpXRBV6>ZIW`8VXR2Wuwk}AYsKT}% rkY@Eh4b~fM)zgBcrx2R;2)6J5Z2(4Uity>Z00000NkvXXu0mjf$Z}Pg diff --git a/designer/src/com/fr/design/mainframe/alphafine/images/alphafine5.png b/designer/src/com/fr/design/mainframe/alphafine/images/alphafine5.png new file mode 100644 index 0000000000000000000000000000000000000000..064f0d8e8afba4e54ecfdbabf3e0cb0a278026da GIT binary patch literal 237 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GGLLkg|>2BR0px}H@ z7sn8b(`P3gFJnLPVPkUi%KyJwfL zF>vcRd@_tT|Iw_u^v`$xHw=@k{FGz9tg~cWnZ7DfYMY+N{1u0`$xlf8YR7v`I_K); jrX|Y-W_{(@_JJXn!7Z!n!^^!ur!siD`njxgN@xNAlSy2u literal 0 HcmV?d00001 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 9e23558556..44ce23ed32 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 @@ -1,5 +1,6 @@ package com.fr.design.mainframe.alphafine.search.manager; +import com.fr.design.DesignerEnvManager; import com.fr.design.mainframe.alphafine.cell.CellModelHelper; import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel; import com.fr.design.mainframe.alphafine.cell.model.MoreModel; @@ -19,7 +20,7 @@ public class RecommendSearchManager implements AlphaFineSearchProcessor { private static RecommendSearchManager recommendSearchManager = null; private SearchResult modelList; //todo:for test - private static final String SEARCHAPI = "http://localhost:8080/monitor/alphafine/search/recommend?searchKey="; + private static final String SEARCHAPI = "http://192.168.2.45:8080/monitor/alphafine/search/recommend?searchKey="; public synchronized static RecommendSearchManager getRecommendSearchManager() { if (recommendSearchManager == null) { @@ -29,35 +30,38 @@ public class RecommendSearchManager implements AlphaFineSearchProcessor { } @Override public synchronized SearchResult getLessSearchResult(String searchText) { - String result; - this.modelList = new SearchResult(); - HttpClient httpClient = new HttpClient(SEARCHAPI + CodeUtils.cjkEncode(searchText)); - httpClient.asGet(); - httpClient.setTimeout(5000); - if (!httpClient.isServerAlive()) { - return modelList; - } - result = httpClient.getResponseText(); - try { - JSONObject jsonObject = new JSONObject(result); - if (jsonObject.optString("status").equals("success")) { - JSONArray jsonArray = jsonObject.optJSONArray("result"); - if (jsonArray != null && jsonArray.length() > 0) { - for (int i = 0; i < jsonArray.length(); i++) { - AlphaCellModel alphaCellModel = CellModelHelper.getModelFromJson((JSONObject) jsonArray.get(i)); - if (!RecentSearchManager.getRecentSearchManger().getRecentModelList().contains(alphaCellModel)) { - this.modelList.add(alphaCellModel); + if (DesignerEnvManager.getEnvManager().getAlphafineConfigManager().isContainRecommend()) { + String result; + this.modelList = new SearchResult(); + HttpClient httpClient = new HttpClient(SEARCHAPI + CodeUtils.cjkEncode(searchText)); + httpClient.asGet(); + httpClient.setTimeout(5000); + if (!httpClient.isServerAlive()) { + return modelList; + } + result = httpClient.getResponseText(); + try { + JSONObject jsonObject = new JSONObject(result); + if (jsonObject.optString("status").equals("success")) { + JSONArray jsonArray = jsonObject.optJSONArray("result"); + if (jsonArray != null && jsonArray.length() > 0) { + for (int i = 0; i < jsonArray.length(); i++) { + AlphaCellModel alphaCellModel = CellModelHelper.getModelFromJson((JSONObject) jsonArray.get(i)); + if (!RecentSearchManager.getRecentSearchManger().getRecentModelList().contains(alphaCellModel)) { + this.modelList.add(alphaCellModel); + } } } } - } - } catch (JSONException e) { - FRLogger.getLogger().error(e.getMessage()); - } - if (modelList.size() > 0) { - modelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_AlphaFine_Conclude"), false)); + } catch (JSONException e) { + FRLogger.getLogger().error("cloud server error! :" + e.getMessage()); + } + if (modelList.size() > 0) { + modelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_AlphaFine_Conclude"), false)); + } } + return modelList; } diff --git a/designer_base/src/com/fr/design/actions/help/AlphaFine/AlphafineConfigManager.java b/designer_base/src/com/fr/design/actions/help/AlphaFine/AlphafineConfigManager.java index be1ff3386d..aa73d7afe9 100644 --- a/designer_base/src/com/fr/design/actions/help/AlphaFine/AlphafineConfigManager.java +++ b/designer_base/src/com/fr/design/actions/help/AlphaFine/AlphafineConfigManager.java @@ -35,7 +35,7 @@ public class AlphafineConfigManager implements XMLable { /** * 猜您需要 */ - private boolean isContainConclude; + private boolean isContainRecommend; /** * 设置 @@ -88,7 +88,7 @@ public class AlphafineConfigManager implements XMLable { this.setEnabled(reader.getAttrAsBoolean("isEnabled", true)); this.setContainPlugin(reader.getAttrAsBoolean("isContainDocument", true)); this.setContainDocument(reader.getAttrAsBoolean("isContainDocument", true)); - this.setContainConclude(reader.getAttrAsBoolean("isContainConclude", true)); + this.setContainRecommend(reader.getAttrAsBoolean("isContainRecommend", true)); this.setContainAction(reader.getAttrAsBoolean("isContainAction", true)); this.setContainTemplate(reader.getAttrAsBoolean("isContainTemplate", true)); this.setContainFileContent(reader.getAttrAsBoolean("isContainFileContent", false)); @@ -104,7 +104,7 @@ public class AlphafineConfigManager implements XMLable { writer.attr("isEnabled", this.isEnabled()) .attr("isSearchOnline", this.isSearchOnLine()) .attr("shortcuts", this.getShortcuts()) - .attr("isContainConclude", this.isContainConclude()) + .attr("isContainRecommend", this.isContainRecommend()) .attr("isContainAction", this.isContainAction()) .attr("isContainDocument", this.isContainDocument()) .attr("isContainTemplate", this.isContainTemplate()) @@ -176,12 +176,12 @@ public class AlphafineConfigManager implements XMLable { this.isContainPlugin = containPlugin; } - public boolean isContainConclude() { - return isContainConclude; + public boolean isContainRecommend() { + return isContainRecommend; } - public void setContainConclude(boolean containConclude) { - isContainConclude = containConclude; + public void setContainRecommend(boolean containConclude) { + isContainRecommend = containConclude; } public boolean isEnabled() { diff --git a/designer_base/src/com/fr/design/actions/help/AlphaFine/AlphafineConfigPane.java b/designer_base/src/com/fr/design/actions/help/AlphaFine/AlphafineConfigPane.java index 470d041969..5d4d75275c 100644 --- a/designer_base/src/com/fr/design/actions/help/AlphaFine/AlphafineConfigPane.java +++ b/designer_base/src/com/fr/design/actions/help/AlphaFine/AlphafineConfigPane.java @@ -53,7 +53,7 @@ public class AlphafineConfigPane extends BasicPane { private static final double COLUMN_GAP = 180; private static final double ROW_GAP = 25; private KeyStroke shortCutKeyStore = null; - private UICheckBox isEnabledCheckbox, isSearchOnlineCheckbox, isContainConcludeCheckbox, isContainActionCheckbox, isContainDocumentCheckbox, isContainTemplateCheckbox, isContainPluginCheckbox, isContainFileContentCheckbox; + private UICheckBox isEnabledCheckbox, isSearchOnlineCheckbox, isContainRecommendCheckbox, isContainActionCheckbox, isContainDocumentCheckbox, isContainTemplateCheckbox, isContainPluginCheckbox, isContainFileContentCheckbox; private UITextField shortcutsField; public AlphafineConfigPane() { @@ -73,7 +73,7 @@ public class AlphafineConfigPane extends BasicPane { private Component[][] initsearchRangeComponents() { Component[][] components = new Component[][]{ - new Component[]{isContainConcludeCheckbox, isContainActionCheckbox, isContainDocumentCheckbox}, + new Component[]{isContainRecommendCheckbox, isContainActionCheckbox, isContainDocumentCheckbox}, new Component[]{isContainTemplateCheckbox, isContainPluginCheckbox, isContainFileContentCheckbox} }; return components; @@ -85,7 +85,7 @@ public class AlphafineConfigPane extends BasicPane { double[] columnSize = {COLUMN_GAP, COLUMN_GAP, COLUMN_GAP}; JPanel northPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_AlphaFine_SearchRange")); - isContainConcludeCheckbox = new UICheckBox(Inter.getLocText("FR-Designer_AlphaFine_Conclude")); + isContainRecommendCheckbox = new UICheckBox(Inter.getLocText("FR-Designer_AlphaFine_Conclude")); isContainActionCheckbox = new UICheckBox(Inter.getLocText("FR-Designer_Set")); isContainPluginCheckbox = new UICheckBox(Inter.getLocText("FR-Designer-Plugin_Addon")); isContainDocumentCheckbox = new UICheckBox(Inter.getLocText("FR-Designer_COMMUNITY_HELP")); @@ -125,14 +125,14 @@ public class AlphafineConfigPane extends BasicPane { @Override public void actionPerformed(ActionEvent e) { if (!isSearchOnlineCheckbox.isSelected()) { - isContainConcludeCheckbox.setEnabled(false); + isContainRecommendCheckbox.setEnabled(false); isContainPluginCheckbox.setEnabled(false); isContainDocumentCheckbox.setEnabled(false); - isContainConcludeCheckbox.setSelected(false); + isContainRecommendCheckbox.setSelected(false); isContainPluginCheckbox.setSelected(false); isContainDocumentCheckbox.setSelected(false); } else { - isContainConcludeCheckbox.setEnabled(true); + isContainRecommendCheckbox.setEnabled(true); isContainPluginCheckbox.setEnabled(true); isContainDocumentCheckbox.setEnabled(true); } @@ -163,8 +163,8 @@ public class AlphafineConfigPane extends BasicPane { this.isContainDocumentCheckbox.setEnabled(alphafineConfigManager.isSearchOnLine()); this.isContainPluginCheckbox.setSelected(alphafineConfigManager.isContainPlugin() && alphafineConfigManager.isSearchOnLine()); this.isContainPluginCheckbox.setEnabled(alphafineConfigManager.isSearchOnLine()); - this.isContainConcludeCheckbox.setSelected(alphafineConfigManager.isContainConclude() && alphafineConfigManager.isSearchOnLine()); - this.isContainConcludeCheckbox.setEnabled(alphafineConfigManager.isSearchOnLine()); + this.isContainRecommendCheckbox.setSelected(alphafineConfigManager.isContainRecommend() && alphafineConfigManager.isSearchOnLine()); + this.isContainRecommendCheckbox.setEnabled(alphafineConfigManager.isSearchOnLine()); this.shortcutsField.setText(getDisplayShortCut(alphafineConfigManager.getShortcuts())); shortCutKeyStore = convert2KeyStroke(alphafineConfigManager.getShortcuts()); } @@ -175,7 +175,7 @@ public class AlphafineConfigPane extends BasicPane { alphafineConfigManager.setContainPlugin(this.isContainPluginCheckbox.isSelected()); alphafineConfigManager.setContainAction(this.isContainActionCheckbox.isSelected()); alphafineConfigManager.setContainDocument(this.isContainDocumentCheckbox.isSelected()); - alphafineConfigManager.setContainConclude(this.isContainConcludeCheckbox.isSelected()); + alphafineConfigManager.setContainRecommend(this.isContainRecommendCheckbox.isSelected()); alphafineConfigManager.setEnabled(this.isEnabledCheckbox.isSelected()); alphafineConfigManager.setSearchOnLine(this.isSearchOnlineCheckbox.isSelected()); alphafineConfigManager.setContainTemplate(this.isContainTemplateCheckbox.isSelected()); diff --git a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties index 0da090b680..62caf9aebb 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties @@ -1999,6 +1999,6 @@ FR-Designer_Templates=\u6A21\u677F FR-Designer_Templates_Content=\u6A21\u677F\u5185\u5BB9 FR-Designer_AlphaFine_ShowAll=\u663E\u793A\u5168\u90E8 FR-Designer_AlphaFine_Conclude=\u731C\u60A8\u9700\u8981 -FR-Designer_AlphaFine_Latest=\u6700\u8FD1\u5E38\u7528 +FR-Designer_AlphaFine_Latest=\u672C\u5730\u5E38\u7528 FR-Designer_AlphaFine_ShowLess=\u6536\u8D77 FR-Designer_Alphafine=AlphaFine\u667A\u80FD\u641C\u7D22 \ No newline at end of file