From 7ba402254493ab4a0fccb34e69bfa114cbd7185e Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Thu, 8 Jun 2017 17:49:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E4=BA=86=E5=87=A0=E4=B8=AA=E7=B1=BB?= =?UTF-8?q?=E7=9A=84=E7=B1=BB=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/alphafine/AlphaFineHelper.java | 4 +- .../alphafine/component/AlphaFineDialog.java | 2 +- .../alphafine/component/AlphaFinePane.java | 8 +-- .../search/manager/ActionSearchManager.java | 2 +- .../search/manager/DocumentSearchManager.java | 5 +- .../search/manager/FileSearchManager.java | 6 +- .../search/manager/PluginSearchManager.java | 6 +- .../manager/RecommendSearchManager.java | 2 +- .../design/mainframe/bbs/UserInfoLabel.java | 18 +++--- .../aspectj/designerbase/AlphaFineReminder.aj | 4 +- .../src/com/fr/design/DesignerEnvManager.java | 18 +++--- ...hafineAction.java => AlphaFineAction.java} | 15 +++-- ...nager.java => AlphaFineConfigManager.java} | 8 +-- ...nfigPane.java => AlphaFineConfigPane.java} | 61 ++++++++++--------- ...fineContext.java => AlphaFineContext.java} | 8 +-- ...neListener.java => AlphaFineListener.java} | 2 +- .../actions/help/alphafine/RemindDialog.java | 2 +- .../actions/help/alphafine/RemindPane.java | 6 +- .../fr/design/mainframe/DesignerFrame.java | 2 +- .../mainframe/toolbar/ToolBarMenuDock.java | 4 +- 20 files changed, 88 insertions(+), 95 deletions(-) rename designer_base/src/com/fr/design/actions/help/alphafine/{AlphafineAction.java => AlphaFineAction.java} (77%) rename designer_base/src/com/fr/design/actions/help/alphafine/{AlphafineConfigManager.java => AlphaFineConfigManager.java} (96%) rename designer_base/src/com/fr/design/actions/help/alphafine/{AlphafineConfigPane.java => AlphaFineConfigPane.java} (80%) rename designer_base/src/com/fr/design/actions/help/alphafine/{AlphafineContext.java => AlphaFineContext.java} (63%) rename designer_base/src/com/fr/design/actions/help/alphafine/{AlphafineListener.java => AlphaFineListener.java} (75%) diff --git a/designer/src/com/fr/design/mainframe/alphafine/AlphaFineHelper.java b/designer/src/com/fr/design/mainframe/alphafine/AlphaFineHelper.java index 22336aec09..53b60c6b2c 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/AlphaFineHelper.java +++ b/designer/src/com/fr/design/mainframe/alphafine/AlphaFineHelper.java @@ -1,7 +1,7 @@ package com.fr.design.mainframe.alphafine; import com.fr.design.DesignerEnvManager; -import com.fr.design.actions.help.alphafine.AlphafineConfigManager; +import com.fr.design.actions.help.alphafine.AlphaFineConfigManager; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.alphafine.cell.model.NoResultModel; import com.fr.design.mainframe.alphafine.component.AlphaFineDialog; @@ -21,7 +21,7 @@ public class AlphaFineHelper { */ public static void showAlphaFineDialog(boolean forceOpen) { AlphaFineDialog dialog = new AlphaFineDialog(DesignerContext.getDesignerFrame(), forceOpen); - final AlphafineConfigManager manager = DesignerEnvManager.getEnvManager().getAlphafineConfigManager(); + final AlphaFineConfigManager manager = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager(); manager.setNeedRemind(false); dialog.setVisible(true); } 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 f742c5e7ed..81188d9f4e 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -613,7 +613,7 @@ public class AlphaFineDialog extends UIDialog { if (event instanceof KeyEvent) { KeyEvent e = (KeyEvent) event; KeyStroke keyStroke = (KeyStroke) KeyStroke.getAWTKeyStrokeForEvent(e); - KeyStroke storeKeyStroke = DesignerEnvManager.getEnvManager().getAlphafineConfigManager().getShortCutKeyStore(); + KeyStroke storeKeyStroke = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().getShortCutKeyStore(); if (ComparatorUtils.equals(keyStroke.toString(), storeKeyStroke.toString())) { doClickAction(); } diff --git a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java index 6c23ab4039..754ceab1c9 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java @@ -2,8 +2,8 @@ package com.fr.design.mainframe.alphafine.component; import com.fr.base.BaseUtils; import com.fr.design.DesignerEnvManager; -import com.fr.design.actions.help.alphafine.AlphafineContext; -import com.fr.design.actions.help.alphafine.AlphafineListener; +import com.fr.design.actions.help.alphafine.AlphaFineContext; +import com.fr.design.actions.help.alphafine.AlphaFineListener; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.mainframe.alphafine.AlphaFineHelper; @@ -28,7 +28,7 @@ public class AlphaFinePane extends BasicPane { } public AlphaFinePane() { setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 14)); - if (DesignerEnvManager.getEnvManager().getAlphafineConfigManager().isEnabled()) { + if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isEnabled()) { Toolkit.getDefaultToolkit().addAWTEventListener(AlphaFineDialog.listener(), AWTEvent.KEY_EVENT_MASK); } UIButton refreshButton = new UIButton(); @@ -42,7 +42,7 @@ public class AlphaFinePane extends BasicPane { AlphaFineHelper.showAlphaFineDialog(false); } }); - AlphafineContext.addAlphafineContextListener(new AlphafineListener() { + AlphaFineContext.addAlphafineContextListener(new AlphaFineListener() { @Override public void showDialog() { AlphaFineHelper.showAlphaFineDialog(true); 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 4ab43181b4..aefb274321 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 @@ -36,7 +36,7 @@ public class ActionSearchManager implements AlphaFineSearchProcessor { filterModelList = new SearchResult(); lessModelList = new SearchResult(); moreModelList = new SearchResult(); - if (DesignerEnvManager.getEnvManager().getAlphafineConfigManager().isContainAction()) { + if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainAction()) { List updateActions = UpdateActionManager.getUpdateActionManager().getUpdateActions(); for (UpdateActionModel updateActionModel : updateActions) { if (StringUtils.isNotBlank(updateActionModel.getSearchKey())) { 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 45076ae185..1468d36e7b 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 @@ -1,8 +1,6 @@ package com.fr.design.mainframe.alphafine.search.manager; import com.fr.design.DesignerEnvManager; -import com.fr.design.actions.help.alphafine.AlphafineContext; -import com.fr.design.actions.help.alphafine.AlphafineListener; import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.CellType; @@ -11,7 +9,6 @@ import com.fr.design.mainframe.alphafine.cell.model.MoreModel; import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.general.FRLogger; import com.fr.general.Inter; -import com.fr.general.ProcessCanceledException; import com.fr.general.http.HttpClient; import com.fr.json.JSONArray; import com.fr.json.JSONException; @@ -38,7 +35,7 @@ public class DocumentSearchManager implements AlphaFineSearchProcessor { public synchronized SearchResult getLessSearchResult(String searchText) { lessModelList = new SearchResult(); moreModelList = new SearchResult(); - if (DesignerEnvManager.getEnvManager().getAlphafineConfigManager().isContainDocument()) { + if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainDocument()) { String result; String url = AlphaFineConstants.DOCUMENT_SEARCH_URL + searchText + "-1"; HttpClient httpClient = new HttpClient(url); 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 63020b54bd..96bdba265b 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 @@ -44,7 +44,7 @@ public class FileSearchManager implements AlphaFineSearchProcessor { this.filterModelList = new SearchResult(); this.lessModelList = new SearchResult(); this.moreModelList = new SearchResult(); - if (DesignerEnvManager.getEnvManager().getAlphafineConfigManager().isContainTemplate()) { + if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainTemplate()) { Env env = FRContext.getCurrentEnv(); fileNodes = new ArrayList<>(); fileNodes = listTpl(env, ProjectConstants.REPORTLETS_NAME, true); @@ -87,7 +87,7 @@ public class FileSearchManager implements AlphaFineSearchProcessor { * @param filePath */ private void searchFileContent(String searchText, FileNode node, boolean isAlreadyContain, String filePath) { - if (DesignerEnvManager.getEnvManager().getAlphafineConfigManager().isContainFileContent()) { + if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainFileContent()) { try { BufferedReader reader = new BufferedReader(new FileReader(filePath)); @@ -121,7 +121,7 @@ public class FileSearchManager implements AlphaFineSearchProcessor { * @return */ private boolean searchFile(String searchText, FileNode node, boolean isAlreadyContain) { - if (DesignerEnvManager.getEnvManager().getAlphafineConfigManager().isContainTemplate()) { + if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainTemplate()) { if (node.getName().toLowerCase().contains(searchText.toLowerCase())) { FileModel model = new FileModel(node.getName(), node.getEnvPath()); this.filterModelList.add(model); 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 3ce21d9fe9..fe2e0d8cec 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 @@ -1,19 +1,15 @@ package com.fr.design.mainframe.alphafine.search.manager; import com.fr.design.DesignerEnvManager; -import com.fr.design.actions.help.alphafine.AlphafineContext; -import com.fr.design.actions.help.alphafine.AlphafineListener; import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.CellType; -import com.fr.design.mainframe.alphafine.cell.model.NoResultModel; import com.fr.design.mainframe.alphafine.cell.model.PluginModel; import com.fr.design.mainframe.alphafine.cell.model.MoreModel; import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.general.ComparatorUtils; import com.fr.general.FRLogger; import com.fr.general.Inter; -import com.fr.general.ProcessCanceledException; import com.fr.general.http.HttpClient; import com.fr.json.JSONArray; import com.fr.json.JSONObject; @@ -46,7 +42,7 @@ public class PluginSearchManager implements AlphaFineSearchProcessor { public synchronized SearchResult getLessSearchResult(String searchText) { this.lessModelList = new SearchResult(); this.moreModelList = new SearchResult(); - if (DesignerEnvManager.getEnvManager().getAlphafineConfigManager().isContainPlugin()) { + if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainPlugin()) { String result; try { String encodedKey = URLEncoder.encode(searchText, "UTF-8"); 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 bc0f66eaf8..7e887dd3a4 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 @@ -32,7 +32,7 @@ public class RecommendSearchManager implements AlphaFineSearchProcessor { @Override public synchronized SearchResult getLessSearchResult(String searchText) { this.modelList = new SearchResult(); - if (DesignerEnvManager.getEnvManager().getAlphafineConfigManager().isContainRecommend()) { + if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainRecommend()) { String result; HttpClient httpClient = new HttpClient(SEARCHAPI + CodeUtils.cjkEncode(searchText)); httpClient.asGet(); diff --git a/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java b/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java index 90d84059b3..a2c11639ab 100644 --- a/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java +++ b/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java @@ -213,15 +213,15 @@ public class UserInfoLabel extends UILabel { para.put("username", encode(encode(userName))); HttpClient getMessage = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("bbs.message"), para); getMessage.asGet(); - if (getMessage.isServerAlive()) { - try { - String res = getMessage.getResponseText(); - if (StringUtils.isNotEmpty(res)) { - setMessageCount(Integer.parseInt(res)); - } - } catch (Exception e) { - } - } +// if (getMessage.isServerAlive()) { +// try { +// String res = getMessage.getResponseText(); +// if (StringUtils.isNotEmpty(res)) { +// setMessageCount(Integer.parseInt(res)); +// } +// } catch (Exception e) { +// } +// } sleep(CHECK_MESSAGE_TIME); } } diff --git a/designer_base/src/com/fr/aspectj/designerbase/AlphaFineReminder.aj b/designer_base/src/com/fr/aspectj/designerbase/AlphaFineReminder.aj index 48701f7640..aef3d7a404 100644 --- a/designer_base/src/com/fr/aspectj/designerbase/AlphaFineReminder.aj +++ b/designer_base/src/com/fr/aspectj/designerbase/AlphaFineReminder.aj @@ -1,7 +1,7 @@ package com.fr.aspectj.designerbase; import com.fr.design.DesignerEnvManager; -import com.fr.design.actions.help.alphafine.AlphafineConfigManager; +import com.fr.design.actions.help.alphafine.AlphaFineConfigManager; import com.fr.design.actions.help.alphafine.RemindDialog; import com.fr.design.mainframe.DesignerContext; @@ -30,7 +30,7 @@ public aspect AlphaFineReminder { * 判断是否弹出广告框 */ private static void remind() { - AlphafineConfigManager manager = DesignerEnvManager.getEnvManager().getAlphafineConfigManager(); + AlphaFineConfigManager manager = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager(); if (manager.isNeedRemind()) { if (manager.getOperateCount() > 4) { diff --git a/designer_base/src/com/fr/design/DesignerEnvManager.java b/designer_base/src/com/fr/design/DesignerEnvManager.java index 75b4749d83..2dd6bef373 100644 --- a/designer_base/src/com/fr/design/DesignerEnvManager.java +++ b/designer_base/src/com/fr/design/DesignerEnvManager.java @@ -5,7 +5,7 @@ package com.fr.design; import com.fr.base.*; import com.fr.dav.LocalEnv; -import com.fr.design.actions.help.alphafine.AlphafineConfigManager; +import com.fr.design.actions.help.alphafine.AlphaFineConfigManager; import com.fr.design.constants.UIConstants; import com.fr.env.RemoteEnv; import com.fr.env.SignIn; @@ -108,7 +108,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { /** * alphafine */ - private AlphafineConfigManager alphafineConfigManager = new AlphafineConfigManager(); + private AlphaFineConfigManager alphaFineConfigManager = new AlphaFineConfigManager(); public static final String CAS_CERTIFICATE_PATH = "certificatePath"; @@ -1344,7 +1344,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } private void readAlphaFineAttr(XMLableReader reader) { - reader.readXMLObject(this.alphafineConfigManager = new AlphafineConfigManager()); + reader.readXMLObject(this.alphaFineConfigManager = new AlphaFineConfigManager()); } private void readHttpsParas(XMLableReader reader){ @@ -1551,8 +1551,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } private void writeAlphaFineAttr(XMLPrintWriter writer) { - if (this.alphafineConfigManager != null) { - this.alphafineConfigManager.writeXML(writer); + if (this.alphaFineConfigManager != null) { + this.alphaFineConfigManager.writeXML(writer); } } @@ -1830,11 +1830,11 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { return env; } - public AlphafineConfigManager getAlphafineConfigManager() { - return alphafineConfigManager; + public AlphaFineConfigManager getAlphaFineConfigManager() { + return alphaFineConfigManager; } - public void setAlphafineConfigManager(AlphafineConfigManager alphafineConfigManager) { - this.alphafineConfigManager = alphafineConfigManager; + public void setAlphaFineConfigManager(AlphaFineConfigManager alphaFineConfigManager) { + this.alphaFineConfigManager = alphaFineConfigManager; } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/actions/help/alphafine/AlphafineAction.java b/designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineAction.java similarity index 77% rename from designer_base/src/com/fr/design/actions/help/alphafine/AlphafineAction.java rename to designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineAction.java index 23cf7de758..ea10361b1d 100644 --- a/designer_base/src/com/fr/design/actions/help/alphafine/AlphafineAction.java +++ b/designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineAction.java @@ -1,6 +1,5 @@ package com.fr.design.actions.help.alphafine; -import com.fr.base.BaseUtils; import com.fr.design.DesignerEnvManager; import com.fr.design.actions.UpdateAction; import com.fr.design.dialog.BasicDialog; @@ -17,13 +16,13 @@ import java.awt.event.ActionEvent; /** * Created by XiaXiang on 2017/4/1. */ -public class AlphafineAction extends UpdateAction { - public AlphafineAction() { +public class AlphaFineAction extends UpdateAction { + public AlphaFineAction() { this.setMenuKeySet(ALPHAFINE); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/smallsearch.png")); - this.setSearchText(new AlphafineConfigPane()); + this.setSearchText(new AlphaFineConfigPane()); } public static final MenuKeySet ALPHAFINE = new MenuKeySet() { @@ -49,15 +48,15 @@ public class AlphafineAction extends UpdateAction { public void actionPerformed(ActionEvent e) { final DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); - final AlphafineConfigPane alphafineConfigPane = new AlphafineConfigPane(); - alphafineConfigPane.populate(DesignerEnvManager.getEnvManager().getAlphafineConfigManager()); + final AlphaFineConfigPane alphaFineConfigPane = new AlphaFineConfigPane(); + alphaFineConfigPane.populate(DesignerEnvManager.getEnvManager().getAlphaFineConfigManager()); DialogActionListener dialogActionListener = new DialogActionAdapter() { public void doOk() { - alphafineConfigPane.update(); + alphaFineConfigPane.update(); designerFrame.refreshToolbar(); } }; - BasicDialog basicDialog = alphafineConfigPane.showMediumWindow(designerFrame, dialogActionListener); + BasicDialog basicDialog = alphaFineConfigPane.showMediumWindow(designerFrame, dialogActionListener); basicDialog.setVisible(true); } } 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 similarity index 96% rename from designer_base/src/com/fr/design/actions/help/alphafine/AlphafineConfigManager.java rename to designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java index c119e09b99..5df9691adb 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 @@ -11,7 +11,7 @@ import javax.swing.*; /** * Created by XiaXiang on 2017/4/5. */ -public class AlphafineConfigManager implements XMLable { +public class AlphaFineConfigManager implements XMLable { /** * 是否开启alphafine @@ -80,10 +80,10 @@ public class AlphafineConfigManager implements XMLable { - private static AlphafineConfigManager alphafineConfigManager = new AlphafineConfigManager(); + private static AlphaFineConfigManager alphaFineConfigManager = new AlphaFineConfigManager(); - public static AlphafineConfigManager getInstance() { - return alphafineConfigManager; + public static AlphaFineConfigManager getInstance() { + return alphaFineConfigManager; } @Override 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 similarity index 80% rename from designer_base/src/com/fr/design/actions/help/alphafine/AlphafineConfigPane.java rename to designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigPane.java index d982cbeece..79d887dc6b 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 @@ -20,7 +20,7 @@ import java.awt.event.KeyEvent; /** * Created by XiaXiang on 2017/4/6. */ -public class AlphafineConfigPane extends BasicPane { +public class AlphaFineConfigPane extends BasicPane { private static final String TYPE = "pressed"; private static final String DISPLAY_TYPE = "+"; private static final String BACK_SLASH = "BACK_SLASH"; @@ -56,7 +56,7 @@ public class AlphafineConfigPane extends BasicPane { private UICheckBox isEnabledCheckbox, isSearchOnlineCheckbox, isContainRecommendCheckbox, isContainActionCheckbox, isContainDocumentCheckbox, isContainTemplateCheckbox, isContainPluginCheckbox, isContainFileContentCheckbox; private UITextField shortcutsField; - public AlphafineConfigPane() { + public AlphaFineConfigPane() { this.initComponents(); } @@ -71,7 +71,7 @@ public class AlphafineConfigPane extends BasicPane { } - private Component[][] initsearchRangeComponents() { + private Component[][] initSearchRangeComponents() { Component[][] components = new Component[][]{ new Component[]{isContainRecommendCheckbox, isContainActionCheckbox, isContainDocumentCheckbox}, new Component[]{isContainTemplateCheckbox, isContainPluginCheckbox, isContainFileContentCheckbox} @@ -91,7 +91,7 @@ public class AlphafineConfigPane extends BasicPane { isContainDocumentCheckbox = new UICheckBox(Inter.getLocText("FR-Designer_COMMUNITY_HELP")); isContainTemplateCheckbox = new UICheckBox(Inter.getLocText("FR-Designer_Templates")); isContainFileContentCheckbox = new UICheckBox(Inter.getLocText("FR-Designer_Templates_Content")); - JPanel searchConfigPane = TableLayoutHelper.createTableLayoutPane(initsearchRangeComponents(), rowSize, columnSize); + JPanel searchConfigPane = TableLayoutHelper.createTableLayoutPane(initSearchRangeComponents(), rowSize, columnSize); northPane.add(searchConfigPane); contentPane.add(northPane); } @@ -154,34 +154,35 @@ public class AlphafineConfigPane extends BasicPane { return "AlphaFine"; } - public void populate(AlphafineConfigManager alphafineConfigManager) { - this.isEnabledCheckbox.setSelected(alphafineConfigManager.isEnabled()); - this.isSearchOnlineCheckbox.setSelected(alphafineConfigManager.isSearchOnLine()); - this.isContainActionCheckbox.setSelected(alphafineConfigManager.isContainAction()); - this.isContainTemplateCheckbox.setSelected(alphafineConfigManager.isContainTemplate()); - this.isContainDocumentCheckbox.setSelected(alphafineConfigManager.isContainDocument() && alphafineConfigManager.isSearchOnLine()); - this.isContainDocumentCheckbox.setEnabled(alphafineConfigManager.isSearchOnLine()); - this.isContainPluginCheckbox.setSelected(alphafineConfigManager.isContainPlugin() && alphafineConfigManager.isSearchOnLine()); - this.isContainPluginCheckbox.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()); + public void populate(AlphaFineConfigManager alphaFineConfigManager) { + this.isEnabledCheckbox.setSelected(alphaFineConfigManager.isEnabled()); + this.isSearchOnlineCheckbox.setSelected(alphaFineConfigManager.isSearchOnLine()); + this.isContainActionCheckbox.setSelected(alphaFineConfigManager.isContainAction()); + this.isContainTemplateCheckbox.setSelected(alphaFineConfigManager.isContainTemplate()); + this.isContainFileContentCheckbox.setSelected(alphaFineConfigManager.isContainFileContent()); + this.isContainDocumentCheckbox.setSelected(alphaFineConfigManager.isContainDocument() && alphaFineConfigManager.isSearchOnLine()); + this.isContainDocumentCheckbox.setEnabled(alphaFineConfigManager.isSearchOnLine()); + this.isContainPluginCheckbox.setSelected(alphaFineConfigManager.isContainPlugin() && alphaFineConfigManager.isSearchOnLine()); + this.isContainPluginCheckbox.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()); } public void update() { DesignerEnvManager designerEnvManager = DesignerEnvManager.getEnvManager(); - AlphafineConfigManager alphafineConfigManager = designerEnvManager.getAlphafineConfigManager(); - alphafineConfigManager.setContainPlugin(this.isContainPluginCheckbox.isSelected()); - alphafineConfigManager.setContainAction(this.isContainActionCheckbox.isSelected()); - alphafineConfigManager.setContainDocument(this.isContainDocumentCheckbox.isSelected()); - alphafineConfigManager.setContainRecommend(this.isContainRecommendCheckbox.isSelected()); - alphafineConfigManager.setEnabled(this.isEnabledCheckbox.isSelected()); - alphafineConfigManager.setSearchOnLine(this.isSearchOnlineCheckbox.isSelected()); - alphafineConfigManager.setContainTemplate(this.isContainTemplateCheckbox.isSelected()); - alphafineConfigManager.setContainFileContent(this.isContainFileContentCheckbox.isSelected()); - alphafineConfigManager.setShortcuts(shortCutKeyStore != null ? shortCutKeyStore.toString().replace(TYPE, DISPLAY_TYPE) : this.shortcutsField.getText()); - designerEnvManager.setAlphafineConfigManager(alphafineConfigManager); + AlphaFineConfigManager alphaFineConfigManager = designerEnvManager.getAlphaFineConfigManager(); + alphaFineConfigManager.setContainPlugin(this.isContainPluginCheckbox.isSelected()); + alphaFineConfigManager.setContainAction(this.isContainActionCheckbox.isSelected()); + alphaFineConfigManager.setContainDocument(this.isContainDocumentCheckbox.isSelected()); + alphaFineConfigManager.setContainRecommend(this.isContainRecommendCheckbox.isSelected()); + alphaFineConfigManager.setEnabled(this.isEnabledCheckbox.isSelected()); + alphaFineConfigManager.setSearchOnLine(this.isSearchOnlineCheckbox.isSelected()); + alphaFineConfigManager.setContainTemplate(this.isContainTemplateCheckbox.isSelected()); + alphaFineConfigManager.setContainFileContent(this.isContainFileContentCheckbox.isSelected()); + alphaFineConfigManager.setShortcuts(shortCutKeyStore != null ? shortCutKeyStore.toString().replace(TYPE, DISPLAY_TYPE) : this.shortcutsField.getText()); + designerEnvManager.setAlphaFineConfigManager(alphaFineConfigManager); try { DesignerEnvManager.loadLogSetting(); DesignerEnvManager.getEnvManager().saveXMLFile(); @@ -192,8 +193,8 @@ public class AlphafineConfigPane extends BasicPane { } - private String getDisplayShortCut(String shotrCut) { - return shotrCut.replace(TYPE, DISPLAY_TYPE).replace(BACK_SLASH, DISPLAY_BACK_SLASH).replace(SLASH, DISPLAY_SLASH) + private String getDisplayShortCut(String shortCut) { + return shortCut.replace(TYPE, DISPLAY_TYPE).replace(BACK_SLASH, DISPLAY_BACK_SLASH).replace(SLASH, DISPLAY_SLASH) .replace(CONTROL, DISPLAY_CONTROL).replace(OPEN_BRACKET, DISPLAY_OPEN_BRACKET).replace(CLOSE_BRACKET, DISPLAY_CLOSE_BRACKET) .replace(COMMA, DISPLAY_COMMA).replace(PERIOD, DISPLAY_PERIOD).replace(SEMICOLON, DISPLAY_SEMICOLON).replace(QUOTE, DISPLAY_QUOTE) .replace(EQUALS, DISPLAY_EQUALS).replace(MINUS, DISPLAY_MINUS).replace(COMMAND, DISPLAY_COMMAND).replace(SMALL_COMMAND, DISPLAY_COMMAND); diff --git a/designer_base/src/com/fr/design/actions/help/alphafine/AlphafineContext.java b/designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineContext.java similarity index 63% rename from designer_base/src/com/fr/design/actions/help/alphafine/AlphafineContext.java rename to designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineContext.java index 429f299d6c..ef14b0753e 100644 --- a/designer_base/src/com/fr/design/actions/help/alphafine/AlphafineContext.java +++ b/designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineContext.java @@ -6,14 +6,14 @@ import java.util.List; /** * Created by XiaXiang on 2017/5/27. */ -public class AlphafineContext { - private static List fireLoginContextListener = new ArrayList(); +public class AlphaFineContext { + private static List fireLoginContextListener = new ArrayList(); /** * 触发AlphaFine弹窗 */ public static void fireAlphaFineContextListener() { - for (AlphafineListener l : fireLoginContextListener) { + for (AlphaFineListener l : fireLoginContextListener) { l.showDialog(); } } @@ -23,7 +23,7 @@ public class AlphafineContext { * * @param l AlphaFine框弹出监听事件 */ - public static void addAlphafineContextListener(AlphafineListener l) { + public static void addAlphafineContextListener(AlphaFineListener l) { fireLoginContextListener.add(l); } } diff --git a/designer_base/src/com/fr/design/actions/help/alphafine/AlphafineListener.java b/designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineListener.java similarity index 75% rename from designer_base/src/com/fr/design/actions/help/alphafine/AlphafineListener.java rename to designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineListener.java index 01c7905d61..c7c5931266 100644 --- a/designer_base/src/com/fr/design/actions/help/alphafine/AlphafineListener.java +++ b/designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineListener.java @@ -3,6 +3,6 @@ package com.fr.design.actions.help.alphafine; /** * Created by XiaXiang on 2017/5/27. */ -public interface AlphafineListener { +public interface AlphaFineListener { void showDialog(); } diff --git a/designer_base/src/com/fr/design/actions/help/alphafine/RemindDialog.java b/designer_base/src/com/fr/design/actions/help/alphafine/RemindDialog.java index 9ae6f864a4..eca6eab55f 100644 --- a/designer_base/src/com/fr/design/actions/help/alphafine/RemindDialog.java +++ b/designer_base/src/com/fr/design/actions/help/alphafine/RemindDialog.java @@ -22,7 +22,7 @@ public class RemindDialog extends UIDialog { } private void initComponent() { - final AlphafineConfigManager manager = DesignerEnvManager.getEnvManager().getAlphafineConfigManager(); + final AlphaFineConfigManager manager = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager(); remindPane = new RemindPane(manager, this); this.add(remindPane); diff --git a/designer_base/src/com/fr/design/actions/help/alphafine/RemindPane.java b/designer_base/src/com/fr/design/actions/help/alphafine/RemindPane.java index 1e8261965c..acecfb08be 100644 --- a/designer_base/src/com/fr/design/actions/help/alphafine/RemindPane.java +++ b/designer_base/src/com/fr/design/actions/help/alphafine/RemindPane.java @@ -42,7 +42,7 @@ public class RemindPane extends JPanel { } }; - public RemindPane(AlphafineConfigManager manager, UIDialog remindDialog) { + public RemindPane(AlphaFineConfigManager manager, UIDialog remindDialog) { this.setPreferredSize(new Dimension(WIDTH, HEIGHT)); initUI(manager, remindDialog); this.setLayout(getAbsoluteLayout()); @@ -53,7 +53,7 @@ public class RemindPane extends JPanel { * @param manager * @param dialog */ - private void initUI(final AlphafineConfigManager manager, final UIDialog dialog) { + private void initUI(final AlphaFineConfigManager manager, final UIDialog dialog) { openButton = new UIButton(); openButton.setIcon(openIcon); @@ -63,7 +63,7 @@ public class RemindPane extends JPanel { public void mousePressed(MouseEvent e) { manager.setOperateCount(0); dialog.dispose(); - AlphafineContext.fireAlphaFineContextListener(); + AlphaFineContext.fireAlphaFineContextListener(); } }); diff --git a/designer_base/src/com/fr/design/mainframe/DesignerFrame.java b/designer_base/src/com/fr/design/mainframe/DesignerFrame.java index f67608aca0..c3b6abee24 100644 --- a/designer_base/src/com/fr/design/mainframe/DesignerFrame.java +++ b/designer_base/src/com/fr/design/mainframe/DesignerFrame.java @@ -197,7 +197,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } }); - if (DesignerEnvManager.getEnvManager().getAlphafineConfigManager().isEnabled()) { + if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isEnabled()) { northEastPane.add(ad.createAlphafinePane(), BorderLayout.CENTER); } return northEastPane; diff --git a/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index 9c9a356310..d71bd9b5f1 100644 --- a/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -11,7 +11,7 @@ import com.fr.design.actions.UpdateAction; import com.fr.design.actions.community.*; import com.fr.design.actions.file.*; import com.fr.design.actions.help.AboutAction; -import com.fr.design.actions.help.alphafine.AlphafineAction; +import com.fr.design.actions.help.alphafine.AlphaFineAction; import com.fr.design.actions.help.TutorialAction; import com.fr.design.actions.help.WebDemoAction; import com.fr.design.actions.server.*; @@ -374,7 +374,7 @@ public abstract class ToolBarMenuDock { shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(new AboutAction()); shortCuts.add(SeparatorDef.DEFAULT); - shortCuts.add(new AlphafineAction()); + shortCuts.add(new AlphaFineAction()); return shortCuts.toArray(new ShortCut[shortCuts.size()]); }