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 e23a33ab54..0000000000 Binary files a/designer/src/com/fr/design/mainframe/alphafine/images/alphafine0.png and /dev/null differ 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 aae79cb065..8d5464a6d2 100644 Binary files a/designer/src/com/fr/design/mainframe/alphafine/images/alphafine1.png and b/designer/src/com/fr/design/mainframe/alphafine/images/alphafine1.png differ diff --git a/designer/src/com/fr/design/mainframe/alphafine/images/alphafine2.png b/designer/src/com/fr/design/mainframe/alphafine/images/alphafine2.png index 2657e4d06d..aae79cb065 100644 Binary files a/designer/src/com/fr/design/mainframe/alphafine/images/alphafine2.png and b/designer/src/com/fr/design/mainframe/alphafine/images/alphafine2.png differ diff --git a/designer/src/com/fr/design/mainframe/alphafine/images/alphafine3.png b/designer/src/com/fr/design/mainframe/alphafine/images/alphafine3.png index 8d5464a6d2..2657e4d06d 100644 Binary files a/designer/src/com/fr/design/mainframe/alphafine/images/alphafine3.png and b/designer/src/com/fr/design/mainframe/alphafine/images/alphafine3.png differ 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 064f0d8e8a..e23a33ab54 100644 Binary files a/designer/src/com/fr/design/mainframe/alphafine/images/alphafine4.png and b/designer/src/com/fr/design/mainframe/alphafine/images/alphafine4.png differ 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 0000000000..064f0d8e8a Binary files /dev/null and b/designer/src/com/fr/design/mainframe/alphafine/images/alphafine5.png differ 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