Browse Source

改了几个类的类名

master
XiaXiang 8 years ago
parent
commit
7ba4022544
  1. 4
      designer/src/com/fr/design/mainframe/alphafine/AlphaFineHelper.java
  2. 2
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  3. 8
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java
  4. 2
      designer/src/com/fr/design/mainframe/alphafine/search/manager/ActionSearchManager.java
  5. 5
      designer/src/com/fr/design/mainframe/alphafine/search/manager/DocumentSearchManager.java
  6. 6
      designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java
  7. 6
      designer/src/com/fr/design/mainframe/alphafine/search/manager/PluginSearchManager.java
  8. 2
      designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java
  9. 18
      designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java
  10. 4
      designer_base/src/com/fr/aspectj/designerbase/AlphaFineReminder.aj
  11. 18
      designer_base/src/com/fr/design/DesignerEnvManager.java
  12. 15
      designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineAction.java
  13. 8
      designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java
  14. 61
      designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigPane.java
  15. 8
      designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineContext.java
  16. 2
      designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineListener.java
  17. 2
      designer_base/src/com/fr/design/actions/help/alphafine/RemindDialog.java
  18. 6
      designer_base/src/com/fr/design/actions/help/alphafine/RemindPane.java
  19. 2
      designer_base/src/com/fr/design/mainframe/DesignerFrame.java
  20. 4
      designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

4
designer/src/com/fr/design/mainframe/alphafine/AlphaFineHelper.java

@ -1,7 +1,7 @@
package com.fr.design.mainframe.alphafine; package com.fr.design.mainframe.alphafine;
import com.fr.design.DesignerEnvManager; 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.DesignerContext;
import com.fr.design.mainframe.alphafine.cell.model.NoResultModel; import com.fr.design.mainframe.alphafine.cell.model.NoResultModel;
import com.fr.design.mainframe.alphafine.component.AlphaFineDialog; import com.fr.design.mainframe.alphafine.component.AlphaFineDialog;
@ -21,7 +21,7 @@ public class AlphaFineHelper {
*/ */
public static void showAlphaFineDialog(boolean forceOpen) { public static void showAlphaFineDialog(boolean forceOpen) {
AlphaFineDialog dialog = new AlphaFineDialog(DesignerContext.getDesignerFrame(), forceOpen); AlphaFineDialog dialog = new AlphaFineDialog(DesignerContext.getDesignerFrame(), forceOpen);
final AlphafineConfigManager manager = DesignerEnvManager.getEnvManager().getAlphafineConfigManager(); final AlphaFineConfigManager manager = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager();
manager.setNeedRemind(false); manager.setNeedRemind(false);
dialog.setVisible(true); dialog.setVisible(true);
} }

2
designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java

@ -613,7 +613,7 @@ public class AlphaFineDialog extends UIDialog {
if (event instanceof KeyEvent) { if (event instanceof KeyEvent) {
KeyEvent e = (KeyEvent) event; KeyEvent e = (KeyEvent) event;
KeyStroke keyStroke = (KeyStroke) KeyStroke.getAWTKeyStrokeForEvent(e); 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())) { if (ComparatorUtils.equals(keyStroke.toString(), storeKeyStroke.toString())) {
doClickAction(); doClickAction();
} }

8
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.base.BaseUtils;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.help.alphafine.AlphafineContext; import com.fr.design.actions.help.alphafine.AlphaFineContext;
import com.fr.design.actions.help.alphafine.AlphafineListener; import com.fr.design.actions.help.alphafine.AlphaFineListener;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.AlphaFineHelper;
@ -28,7 +28,7 @@ public class AlphaFinePane extends BasicPane {
} }
public AlphaFinePane() { public AlphaFinePane() {
setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 14)); 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); Toolkit.getDefaultToolkit().addAWTEventListener(AlphaFineDialog.listener(), AWTEvent.KEY_EVENT_MASK);
} }
UIButton refreshButton = new UIButton(); UIButton refreshButton = new UIButton();
@ -42,7 +42,7 @@ public class AlphaFinePane extends BasicPane {
AlphaFineHelper.showAlphaFineDialog(false); AlphaFineHelper.showAlphaFineDialog(false);
} }
}); });
AlphafineContext.addAlphafineContextListener(new AlphafineListener() { AlphaFineContext.addAlphafineContextListener(new AlphaFineListener() {
@Override @Override
public void showDialog() { public void showDialog() {
AlphaFineHelper.showAlphaFineDialog(true); AlphaFineHelper.showAlphaFineDialog(true);

2
designer/src/com/fr/design/mainframe/alphafine/search/manager/ActionSearchManager.java

@ -36,7 +36,7 @@ public class ActionSearchManager implements AlphaFineSearchProcessor {
filterModelList = new SearchResult(); filterModelList = new SearchResult();
lessModelList = new SearchResult(); lessModelList = new SearchResult();
moreModelList = new SearchResult(); moreModelList = new SearchResult();
if (DesignerEnvManager.getEnvManager().getAlphafineConfigManager().isContainAction()) { if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainAction()) {
List<UpdateActionModel> updateActions = UpdateActionManager.getUpdateActionManager().getUpdateActions(); List<UpdateActionModel> updateActions = UpdateActionManager.getUpdateActionManager().getUpdateActions();
for (UpdateActionModel updateActionModel : updateActions) { for (UpdateActionModel updateActionModel : updateActions) {
if (StringUtils.isNotBlank(updateActionModel.getSearchKey())) { if (StringUtils.isNotBlank(updateActionModel.getSearchKey())) {

5
designer/src/com/fr/design/mainframe/alphafine/search/manager/DocumentSearchManager.java

@ -1,8 +1,6 @@
package com.fr.design.mainframe.alphafine.search.manager; package com.fr.design.mainframe.alphafine.search.manager;
import com.fr.design.DesignerEnvManager; 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.AlphaFineConstants;
import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.AlphaFineHelper;
import com.fr.design.mainframe.alphafine.CellType; 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.design.mainframe.alphafine.model.SearchResult;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.ProcessCanceledException;
import com.fr.general.http.HttpClient; import com.fr.general.http.HttpClient;
import com.fr.json.JSONArray; import com.fr.json.JSONArray;
import com.fr.json.JSONException; import com.fr.json.JSONException;
@ -38,7 +35,7 @@ public class DocumentSearchManager implements AlphaFineSearchProcessor {
public synchronized SearchResult getLessSearchResult(String searchText) { public synchronized SearchResult getLessSearchResult(String searchText) {
lessModelList = new SearchResult(); lessModelList = new SearchResult();
moreModelList = new SearchResult(); moreModelList = new SearchResult();
if (DesignerEnvManager.getEnvManager().getAlphafineConfigManager().isContainDocument()) { if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainDocument()) {
String result; String result;
String url = AlphaFineConstants.DOCUMENT_SEARCH_URL + searchText + "-1"; String url = AlphaFineConstants.DOCUMENT_SEARCH_URL + searchText + "-1";
HttpClient httpClient = new HttpClient(url); HttpClient httpClient = new HttpClient(url);

6
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.filterModelList = new SearchResult();
this.lessModelList = new SearchResult(); this.lessModelList = new SearchResult();
this.moreModelList = new SearchResult(); this.moreModelList = new SearchResult();
if (DesignerEnvManager.getEnvManager().getAlphafineConfigManager().isContainTemplate()) { if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainTemplate()) {
Env env = FRContext.getCurrentEnv(); Env env = FRContext.getCurrentEnv();
fileNodes = new ArrayList<>(); fileNodes = new ArrayList<>();
fileNodes = listTpl(env, ProjectConstants.REPORTLETS_NAME, true); fileNodes = listTpl(env, ProjectConstants.REPORTLETS_NAME, true);
@ -87,7 +87,7 @@ public class FileSearchManager implements AlphaFineSearchProcessor {
* @param filePath * @param filePath
*/ */
private void searchFileContent(String searchText, FileNode node, boolean isAlreadyContain, String filePath) { private void searchFileContent(String searchText, FileNode node, boolean isAlreadyContain, String filePath) {
if (DesignerEnvManager.getEnvManager().getAlphafineConfigManager().isContainFileContent()) { if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainFileContent()) {
try { try {
BufferedReader reader = new BufferedReader(new FileReader(filePath)); BufferedReader reader = new BufferedReader(new FileReader(filePath));
@ -121,7 +121,7 @@ public class FileSearchManager implements AlphaFineSearchProcessor {
* @return * @return
*/ */
private boolean searchFile(String searchText, FileNode node, boolean isAlreadyContain) { 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())) { if (node.getName().toLowerCase().contains(searchText.toLowerCase())) {
FileModel model = new FileModel(node.getName(), node.getEnvPath()); FileModel model = new FileModel(node.getName(), node.getEnvPath());
this.filterModelList.add(model); this.filterModelList.add(model);

6
designer/src/com/fr/design/mainframe/alphafine/search/manager/PluginSearchManager.java

@ -1,19 +1,15 @@
package com.fr.design.mainframe.alphafine.search.manager; package com.fr.design.mainframe.alphafine.search.manager;
import com.fr.design.DesignerEnvManager; 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.AlphaFineConstants;
import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.AlphaFineHelper;
import com.fr.design.mainframe.alphafine.CellType; 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.PluginModel;
import com.fr.design.mainframe.alphafine.cell.model.MoreModel; import com.fr.design.mainframe.alphafine.cell.model.MoreModel;
import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.design.mainframe.alphafine.model.SearchResult;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.ProcessCanceledException;
import com.fr.general.http.HttpClient; import com.fr.general.http.HttpClient;
import com.fr.json.JSONArray; import com.fr.json.JSONArray;
import com.fr.json.JSONObject; import com.fr.json.JSONObject;
@ -46,7 +42,7 @@ public class PluginSearchManager implements AlphaFineSearchProcessor {
public synchronized SearchResult getLessSearchResult(String searchText) { public synchronized SearchResult getLessSearchResult(String searchText) {
this.lessModelList = new SearchResult(); this.lessModelList = new SearchResult();
this.moreModelList = new SearchResult(); this.moreModelList = new SearchResult();
if (DesignerEnvManager.getEnvManager().getAlphafineConfigManager().isContainPlugin()) { if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainPlugin()) {
String result; String result;
try { try {
String encodedKey = URLEncoder.encode(searchText, "UTF-8"); String encodedKey = URLEncoder.encode(searchText, "UTF-8");

2
designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java

@ -32,7 +32,7 @@ public class RecommendSearchManager implements AlphaFineSearchProcessor {
@Override @Override
public synchronized SearchResult getLessSearchResult(String searchText) { public synchronized SearchResult getLessSearchResult(String searchText) {
this.modelList = new SearchResult(); this.modelList = new SearchResult();
if (DesignerEnvManager.getEnvManager().getAlphafineConfigManager().isContainRecommend()) { if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainRecommend()) {
String result; String result;
HttpClient httpClient = new HttpClient(SEARCHAPI + CodeUtils.cjkEncode(searchText)); HttpClient httpClient = new HttpClient(SEARCHAPI + CodeUtils.cjkEncode(searchText));
httpClient.asGet(); httpClient.asGet();

18
designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java

@ -213,15 +213,15 @@ public class UserInfoLabel extends UILabel {
para.put("username", encode(encode(userName))); para.put("username", encode(encode(userName)));
HttpClient getMessage = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("bbs.message"), para); HttpClient getMessage = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("bbs.message"), para);
getMessage.asGet(); getMessage.asGet();
if (getMessage.isServerAlive()) { // if (getMessage.isServerAlive()) {
try { // try {
String res = getMessage.getResponseText(); // String res = getMessage.getResponseText();
if (StringUtils.isNotEmpty(res)) { // if (StringUtils.isNotEmpty(res)) {
setMessageCount(Integer.parseInt(res)); // setMessageCount(Integer.parseInt(res));
} // }
} catch (Exception e) { // } catch (Exception e) {
} // }
} // }
sleep(CHECK_MESSAGE_TIME); sleep(CHECK_MESSAGE_TIME);
} }
} }

4
designer_base/src/com/fr/aspectj/designerbase/AlphaFineReminder.aj

@ -1,7 +1,7 @@
package com.fr.aspectj.designerbase; package com.fr.aspectj.designerbase;
import com.fr.design.DesignerEnvManager; 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.actions.help.alphafine.RemindDialog;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
@ -30,7 +30,7 @@ public aspect AlphaFineReminder {
* 判断是否弹出广告框 * 判断是否弹出广告框
*/ */
private static void remind() { private static void remind() {
AlphafineConfigManager manager = DesignerEnvManager.getEnvManager().getAlphafineConfigManager(); AlphaFineConfigManager manager = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager();
if (manager.isNeedRemind()) { if (manager.isNeedRemind()) {
if (manager.getOperateCount() > 4) { if (manager.getOperateCount() > 4) {

18
designer_base/src/com/fr/design/DesignerEnvManager.java

@ -5,7 +5,7 @@ package com.fr.design;
import com.fr.base.*; import com.fr.base.*;
import com.fr.dav.LocalEnv; 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.design.constants.UIConstants;
import com.fr.env.RemoteEnv; import com.fr.env.RemoteEnv;
import com.fr.env.SignIn; import com.fr.env.SignIn;
@ -108,7 +108,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
/** /**
* alphafine * alphafine
*/ */
private AlphafineConfigManager alphafineConfigManager = new AlphafineConfigManager(); private AlphaFineConfigManager alphaFineConfigManager = new AlphaFineConfigManager();
public static final String CAS_CERTIFICATE_PATH = "certificatePath"; public static final String CAS_CERTIFICATE_PATH = "certificatePath";
@ -1344,7 +1344,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
} }
private void readAlphaFineAttr(XMLableReader reader) { private void readAlphaFineAttr(XMLableReader reader) {
reader.readXMLObject(this.alphafineConfigManager = new AlphafineConfigManager()); reader.readXMLObject(this.alphaFineConfigManager = new AlphaFineConfigManager());
} }
private void readHttpsParas(XMLableReader reader){ private void readHttpsParas(XMLableReader reader){
@ -1551,8 +1551,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
} }
private void writeAlphaFineAttr(XMLPrintWriter writer) { private void writeAlphaFineAttr(XMLPrintWriter writer) {
if (this.alphafineConfigManager != null) { if (this.alphaFineConfigManager != null) {
this.alphafineConfigManager.writeXML(writer); this.alphaFineConfigManager.writeXML(writer);
} }
} }
@ -1830,11 +1830,11 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
return env; return env;
} }
public AlphafineConfigManager getAlphafineConfigManager() { public AlphaFineConfigManager getAlphaFineConfigManager() {
return alphafineConfigManager; return alphaFineConfigManager;
} }
public void setAlphafineConfigManager(AlphafineConfigManager alphafineConfigManager) { public void setAlphaFineConfigManager(AlphaFineConfigManager alphaFineConfigManager) {
this.alphafineConfigManager = alphafineConfigManager; this.alphaFineConfigManager = alphaFineConfigManager;
} }
} }

15
designer_base/src/com/fr/design/actions/help/alphafine/AlphafineAction.java → designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineAction.java

@ -1,6 +1,5 @@
package com.fr.design.actions.help.alphafine; package com.fr.design.actions.help.alphafine;
import com.fr.base.BaseUtils;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
@ -17,13 +16,13 @@ import java.awt.event.ActionEvent;
/** /**
* Created by XiaXiang on 2017/4/1. * Created by XiaXiang on 2017/4/1.
*/ */
public class AlphafineAction extends UpdateAction { public class AlphaFineAction extends UpdateAction {
public AlphafineAction() { public AlphaFineAction() {
this.setMenuKeySet(ALPHAFINE); this.setMenuKeySet(ALPHAFINE);
this.setName(getMenuKeySet().getMenuName()); this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic()); this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/smallsearch.png")); 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() { public static final MenuKeySet ALPHAFINE = new MenuKeySet() {
@ -49,15 +48,15 @@ public class AlphafineAction extends UpdateAction {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
final DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); final DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
final AlphafineConfigPane alphafineConfigPane = new AlphafineConfigPane(); final AlphaFineConfigPane alphaFineConfigPane = new AlphaFineConfigPane();
alphafineConfigPane.populate(DesignerEnvManager.getEnvManager().getAlphafineConfigManager()); alphaFineConfigPane.populate(DesignerEnvManager.getEnvManager().getAlphaFineConfigManager());
DialogActionListener dialogActionListener = new DialogActionAdapter() { DialogActionListener dialogActionListener = new DialogActionAdapter() {
public void doOk() { public void doOk() {
alphafineConfigPane.update(); alphaFineConfigPane.update();
designerFrame.refreshToolbar(); designerFrame.refreshToolbar();
} }
}; };
BasicDialog basicDialog = alphafineConfigPane.showMediumWindow(designerFrame, dialogActionListener); BasicDialog basicDialog = alphaFineConfigPane.showMediumWindow(designerFrame, dialogActionListener);
basicDialog.setVisible(true); basicDialog.setVisible(true);
} }
} }

8
designer_base/src/com/fr/design/actions/help/alphafine/AlphafineConfigManager.java → 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. * Created by XiaXiang on 2017/4/5.
*/ */
public class AlphafineConfigManager implements XMLable { public class AlphaFineConfigManager implements XMLable {
/** /**
* 是否开启alphafine * 是否开启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() { public static AlphaFineConfigManager getInstance() {
return alphafineConfigManager; return alphaFineConfigManager;
} }
@Override @Override

61
designer_base/src/com/fr/design/actions/help/alphafine/AlphafineConfigPane.java → 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. * 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 TYPE = "pressed";
private static final String DISPLAY_TYPE = "+"; private static final String DISPLAY_TYPE = "+";
private static final String BACK_SLASH = "BACK_SLASH"; 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 UICheckBox isEnabledCheckbox, isSearchOnlineCheckbox, isContainRecommendCheckbox, isContainActionCheckbox, isContainDocumentCheckbox, isContainTemplateCheckbox, isContainPluginCheckbox, isContainFileContentCheckbox;
private UITextField shortcutsField; private UITextField shortcutsField;
public AlphafineConfigPane() { public AlphaFineConfigPane() {
this.initComponents(); this.initComponents();
} }
@ -71,7 +71,7 @@ public class AlphafineConfigPane extends BasicPane {
} }
private Component[][] initsearchRangeComponents() { private Component[][] initSearchRangeComponents() {
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{isContainRecommendCheckbox, isContainActionCheckbox, isContainDocumentCheckbox}, new Component[]{isContainRecommendCheckbox, isContainActionCheckbox, isContainDocumentCheckbox},
new Component[]{isContainTemplateCheckbox, isContainPluginCheckbox, isContainFileContentCheckbox} new Component[]{isContainTemplateCheckbox, isContainPluginCheckbox, isContainFileContentCheckbox}
@ -91,7 +91,7 @@ public class AlphafineConfigPane extends BasicPane {
isContainDocumentCheckbox = new UICheckBox(Inter.getLocText("FR-Designer_COMMUNITY_HELP")); isContainDocumentCheckbox = new UICheckBox(Inter.getLocText("FR-Designer_COMMUNITY_HELP"));
isContainTemplateCheckbox = new UICheckBox(Inter.getLocText("FR-Designer_Templates")); isContainTemplateCheckbox = new UICheckBox(Inter.getLocText("FR-Designer_Templates"));
isContainFileContentCheckbox = new UICheckBox(Inter.getLocText("FR-Designer_Templates_Content")); 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); northPane.add(searchConfigPane);
contentPane.add(northPane); contentPane.add(northPane);
} }
@ -154,34 +154,35 @@ public class AlphafineConfigPane extends BasicPane {
return "AlphaFine"; return "AlphaFine";
} }
public void populate(AlphafineConfigManager alphafineConfigManager) { public void populate(AlphaFineConfigManager alphaFineConfigManager) {
this.isEnabledCheckbox.setSelected(alphafineConfigManager.isEnabled()); this.isEnabledCheckbox.setSelected(alphaFineConfigManager.isEnabled());
this.isSearchOnlineCheckbox.setSelected(alphafineConfigManager.isSearchOnLine()); this.isSearchOnlineCheckbox.setSelected(alphaFineConfigManager.isSearchOnLine());
this.isContainActionCheckbox.setSelected(alphafineConfigManager.isContainAction()); this.isContainActionCheckbox.setSelected(alphaFineConfigManager.isContainAction());
this.isContainTemplateCheckbox.setSelected(alphafineConfigManager.isContainTemplate()); this.isContainTemplateCheckbox.setSelected(alphaFineConfigManager.isContainTemplate());
this.isContainDocumentCheckbox.setSelected(alphafineConfigManager.isContainDocument() && alphafineConfigManager.isSearchOnLine()); this.isContainFileContentCheckbox.setSelected(alphaFineConfigManager.isContainFileContent());
this.isContainDocumentCheckbox.setEnabled(alphafineConfigManager.isSearchOnLine()); this.isContainDocumentCheckbox.setSelected(alphaFineConfigManager.isContainDocument() && alphaFineConfigManager.isSearchOnLine());
this.isContainPluginCheckbox.setSelected(alphafineConfigManager.isContainPlugin() && alphafineConfigManager.isSearchOnLine()); this.isContainDocumentCheckbox.setEnabled(alphaFineConfigManager.isSearchOnLine());
this.isContainPluginCheckbox.setEnabled(alphafineConfigManager.isSearchOnLine()); this.isContainPluginCheckbox.setSelected(alphaFineConfigManager.isContainPlugin() && alphaFineConfigManager.isSearchOnLine());
this.isContainRecommendCheckbox.setSelected(alphafineConfigManager.isContainRecommend() && alphafineConfigManager.isSearchOnLine()); this.isContainPluginCheckbox.setEnabled(alphaFineConfigManager.isSearchOnLine());
this.isContainRecommendCheckbox.setEnabled(alphafineConfigManager.isSearchOnLine()); this.isContainRecommendCheckbox.setSelected(alphaFineConfigManager.isContainRecommend() && alphaFineConfigManager.isSearchOnLine());
this.shortcutsField.setText(getDisplayShortCut(alphafineConfigManager.getShortcuts())); this.isContainRecommendCheckbox.setEnabled(alphaFineConfigManager.isSearchOnLine());
shortCutKeyStore = convert2KeyStroke(alphafineConfigManager.getShortcuts()); this.shortcutsField.setText(getDisplayShortCut(alphaFineConfigManager.getShortcuts()));
shortCutKeyStore = convert2KeyStroke(alphaFineConfigManager.getShortcuts());
} }
public void update() { public void update() {
DesignerEnvManager designerEnvManager = DesignerEnvManager.getEnvManager(); DesignerEnvManager designerEnvManager = DesignerEnvManager.getEnvManager();
AlphafineConfigManager alphafineConfigManager = designerEnvManager.getAlphafineConfigManager(); AlphaFineConfigManager alphaFineConfigManager = designerEnvManager.getAlphaFineConfigManager();
alphafineConfigManager.setContainPlugin(this.isContainPluginCheckbox.isSelected()); alphaFineConfigManager.setContainPlugin(this.isContainPluginCheckbox.isSelected());
alphafineConfigManager.setContainAction(this.isContainActionCheckbox.isSelected()); alphaFineConfigManager.setContainAction(this.isContainActionCheckbox.isSelected());
alphafineConfigManager.setContainDocument(this.isContainDocumentCheckbox.isSelected()); alphaFineConfigManager.setContainDocument(this.isContainDocumentCheckbox.isSelected());
alphafineConfigManager.setContainRecommend(this.isContainRecommendCheckbox.isSelected()); alphaFineConfigManager.setContainRecommend(this.isContainRecommendCheckbox.isSelected());
alphafineConfigManager.setEnabled(this.isEnabledCheckbox.isSelected()); alphaFineConfigManager.setEnabled(this.isEnabledCheckbox.isSelected());
alphafineConfigManager.setSearchOnLine(this.isSearchOnlineCheckbox.isSelected()); alphaFineConfigManager.setSearchOnLine(this.isSearchOnlineCheckbox.isSelected());
alphafineConfigManager.setContainTemplate(this.isContainTemplateCheckbox.isSelected()); alphaFineConfigManager.setContainTemplate(this.isContainTemplateCheckbox.isSelected());
alphafineConfigManager.setContainFileContent(this.isContainFileContentCheckbox.isSelected()); alphaFineConfigManager.setContainFileContent(this.isContainFileContentCheckbox.isSelected());
alphafineConfigManager.setShortcuts(shortCutKeyStore != null ? shortCutKeyStore.toString().replace(TYPE, DISPLAY_TYPE) : this.shortcutsField.getText()); alphaFineConfigManager.setShortcuts(shortCutKeyStore != null ? shortCutKeyStore.toString().replace(TYPE, DISPLAY_TYPE) : this.shortcutsField.getText());
designerEnvManager.setAlphafineConfigManager(alphafineConfigManager); designerEnvManager.setAlphaFineConfigManager(alphaFineConfigManager);
try { try {
DesignerEnvManager.loadLogSetting(); DesignerEnvManager.loadLogSetting();
DesignerEnvManager.getEnvManager().saveXMLFile(); DesignerEnvManager.getEnvManager().saveXMLFile();
@ -192,8 +193,8 @@ public class AlphafineConfigPane extends BasicPane {
} }
private String getDisplayShortCut(String shotrCut) { private String getDisplayShortCut(String shortCut) {
return shotrCut.replace(TYPE, DISPLAY_TYPE).replace(BACK_SLASH, DISPLAY_BACK_SLASH).replace(SLASH, DISPLAY_SLASH) 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(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(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); .replace(EQUALS, DISPLAY_EQUALS).replace(MINUS, DISPLAY_MINUS).replace(COMMAND, DISPLAY_COMMAND).replace(SMALL_COMMAND, DISPLAY_COMMAND);

8
designer_base/src/com/fr/design/actions/help/alphafine/AlphafineContext.java → 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. * Created by XiaXiang on 2017/5/27.
*/ */
public class AlphafineContext { public class AlphaFineContext {
private static List<AlphafineListener> fireLoginContextListener = new ArrayList<AlphafineListener>(); private static List<AlphaFineListener> fireLoginContextListener = new ArrayList<AlphaFineListener>();
/** /**
* 触发AlphaFine弹窗 * 触发AlphaFine弹窗
*/ */
public static void fireAlphaFineContextListener() { public static void fireAlphaFineContextListener() {
for (AlphafineListener l : fireLoginContextListener) { for (AlphaFineListener l : fireLoginContextListener) {
l.showDialog(); l.showDialog();
} }
} }
@ -23,7 +23,7 @@ public class AlphafineContext {
* *
* @param l AlphaFine框弹出监听事件 * @param l AlphaFine框弹出监听事件
*/ */
public static void addAlphafineContextListener(AlphafineListener l) { public static void addAlphafineContextListener(AlphaFineListener l) {
fireLoginContextListener.add(l); fireLoginContextListener.add(l);
} }
} }

2
designer_base/src/com/fr/design/actions/help/alphafine/AlphafineListener.java → 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. * Created by XiaXiang on 2017/5/27.
*/ */
public interface AlphafineListener { public interface AlphaFineListener {
void showDialog(); void showDialog();
} }

2
designer_base/src/com/fr/design/actions/help/alphafine/RemindDialog.java

@ -22,7 +22,7 @@ public class RemindDialog extends UIDialog {
} }
private void initComponent() { private void initComponent() {
final AlphafineConfigManager manager = DesignerEnvManager.getEnvManager().getAlphafineConfigManager(); final AlphaFineConfigManager manager = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager();
remindPane = new RemindPane(manager, this); remindPane = new RemindPane(manager, this);
this.add(remindPane); this.add(remindPane);

6
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)); this.setPreferredSize(new Dimension(WIDTH, HEIGHT));
initUI(manager, remindDialog); initUI(manager, remindDialog);
this.setLayout(getAbsoluteLayout()); this.setLayout(getAbsoluteLayout());
@ -53,7 +53,7 @@ public class RemindPane extends JPanel {
* @param manager * @param manager
* @param dialog * @param dialog
*/ */
private void initUI(final AlphafineConfigManager manager, final UIDialog dialog) { private void initUI(final AlphaFineConfigManager manager, final UIDialog dialog) {
openButton = new UIButton(); openButton = new UIButton();
openButton.setIcon(openIcon); openButton.setIcon(openIcon);
@ -63,7 +63,7 @@ public class RemindPane extends JPanel {
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
manager.setOperateCount(0); manager.setOperateCount(0);
dialog.dispose(); dialog.dispose();
AlphafineContext.fireAlphaFineContextListener(); AlphaFineContext.fireAlphaFineContextListener();
} }
}); });

2
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); northEastPane.add(ad.createAlphafinePane(), BorderLayout.CENTER);
} }
return northEastPane; return northEastPane;

4
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.community.*;
import com.fr.design.actions.file.*; import com.fr.design.actions.file.*;
import com.fr.design.actions.help.AboutAction; 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.TutorialAction;
import com.fr.design.actions.help.WebDemoAction; import com.fr.design.actions.help.WebDemoAction;
import com.fr.design.actions.server.*; import com.fr.design.actions.server.*;
@ -374,7 +374,7 @@ public abstract class ToolBarMenuDock {
shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(SeparatorDef.DEFAULT);
shortCuts.add(new AboutAction()); shortCuts.add(new AboutAction());
shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(SeparatorDef.DEFAULT);
shortCuts.add(new AlphafineAction()); shortCuts.add(new AlphaFineAction());
return shortCuts.toArray(new ShortCut[shortCuts.size()]); return shortCuts.toArray(new ShortCut[shortCuts.size()]);
} }

Loading…
Cancel
Save