Browse Source

Merge pull request #930 in BA/design from ~XIAOXIA/design:9.0 to 9.0

* commit '4fbe80e858c8d084c838fd8bebeda1ba59668ab5':
  fix pmd
  bug fix 国际化
  代码质量
  alphafine bug fix 去重
  alphafine bug fix
  alphafine bug fix
  bug fix
  bug fix alphafine
  alphafine bug fix
  改了几个类的类名
  alphafine bug fix
  bug fix
  alphafine 异步搜索优化 中断
  alphafine bug fix
  bug fix
  bug fix alphafine
  bug fix
master
superman 8 years ago
parent
commit
f94f7e9f0f
  1. 2
      designer/src/com/fr/design/mainframe/alphafine/AlphaFineConstants.java
  2. 32
      designer/src/com/fr/design/mainframe/alphafine/AlphaFineHelper.java
  3. 2
      designer/src/com/fr/design/mainframe/alphafine/CellType.java
  4. 24
      designer/src/com/fr/design/mainframe/alphafine/cell/model/NoResultModel.java
  5. 10
      designer/src/com/fr/design/mainframe/alphafine/cell/render/ContentCellRender.java
  6. 149
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  7. 22
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java
  8. 19
      designer/src/com/fr/design/mainframe/alphafine/model/SearchListModel.java
  9. 34
      designer/src/com/fr/design/mainframe/alphafine/search/manager/ActionSearchManager.java
  10. 69
      designer/src/com/fr/design/mainframe/alphafine/search/manager/AlphaSearchManager.java
  11. 55
      designer/src/com/fr/design/mainframe/alphafine/search/manager/DocumentSearchManager.java
  12. 57
      designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java
  13. 60
      designer/src/com/fr/design/mainframe/alphafine/search/manager/PluginSearchManager.java
  14. 67
      designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java
  15. 32
      designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java
  16. 2
      designer/src/com/fr/start/Designer.java
  17. 4
      designer_base/src/com/fr/aspectj/designerbase/AlphaFineReminder.aj
  18. 18
      designer_base/src/com/fr/design/DesignerEnvManager.java
  19. 22
      designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineAction.java
  20. 8
      designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java
  21. 65
      designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigPane.java
  22. 40
      designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineContext.java
  23. 18
      designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineListener.java
  24. 29
      designer_base/src/com/fr/design/actions/help/alphafine/AlphafineContext.java
  25. 8
      designer_base/src/com/fr/design/actions/help/alphafine/AlphafineListener.java
  26. 3
      designer_base/src/com/fr/design/actions/help/alphafine/RemindDialog.java
  27. 6
      designer_base/src/com/fr/design/actions/help/alphafine/RemindPane.java
  28. 6
      designer_base/src/com/fr/design/locale/designer.properties
  29. 18
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  30. 6
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  31. 6
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  32. 2
      designer_base/src/com/fr/design/mainframe/DesignerFrame.java
  33. 4
      designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

2
designer/src/com/fr/design/mainframe/alphafine/AlphaFineConstants.java

@ -47,6 +47,8 @@ public class AlphaFineConstants {
public static final Color LIGHT_GRAY = new Color(0xcccccc);
public static final Color MEDIUM_GRAY = new Color(0x999999);
public static final Color BLUE = new Color(0x3394f0);
public static final Color BLACK = new Color(0x222222);

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

@ -1,22 +1,38 @@
package com.fr.design.mainframe.alphafine;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.help.alphafine.AlphaFineConfigManager;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel;
import com.fr.design.mainframe.alphafine.cell.model.NoResultModel;
import com.fr.design.mainframe.alphafine.component.AlphaFineDialog;
import com.fr.design.mainframe.alphafine.search.manager.RecentSearchManager;
import com.fr.design.mainframe.alphafine.search.manager.RecommendSearchManager;
import com.fr.general.Inter;
import com.fr.general.ProcessCanceledException;
import com.fr.stable.StringUtils;
import java.util.List;
/**
* Created by XiaXiang on 2017/5/8.
*/
public class AlphaFineHelper {
public static final NoResultModel NO_RESULT_MODEL = new NoResultModel(Inter.getLocText("FR-Designer_AlphaFine_NoResult"));
public static final NoResultModel NO_CONNECTION_MODEL = new NoResultModel(Inter.getLocText("FR-Designer_ConnectionFailed"));
/**
* 弹出alphafine搜索面板
*/
public static void showAlphaFineDialog(boolean forceOpen) {
AlphaFineDialog dialog = new AlphaFineDialog(DesignerContext.getDesignerFrame(), forceOpen);
final AlphaFineConfigManager manager = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager();
manager.setNeedRemind(false);
dialog.setVisible(true);
}
/**
* 获取文件名上级目录
* @param text
@ -51,6 +67,22 @@ public class AlphaFineHelper {
return getSplitText(text, 1);
}
/**
* 中断当前线程的搜索
*/
public static void checkCancel() {
if (Thread.interrupted()) {
throw new ProcessCanceledException();
}
}
public static List<AlphaCellModel> getFilterResult() {
List<AlphaCellModel> recentList = RecentSearchManager.getRecentSearchManger().getRecentModelList();
List<AlphaCellModel> recommendList = RecommendSearchManager.getRecommendSearchManager().getRecommendModelList();
recentList.addAll(recommendList);
return recentList;
}

2
designer/src/com/fr/design/mainframe/alphafine/CellType.java

@ -4,7 +4,7 @@ package com.fr.design.mainframe.alphafine;
* Created by XiaXiang on 2017/4/27.
*/
public enum CellType {
RECOMMEND(0), ACTION(1), DOCUMENT(2), FILE(3), PLUGIN(4), REUSE(5);
RECOMMEND(0), ACTION(1), DOCUMENT(2), FILE(3), PLUGIN(4), REUSE(5), NO_RESULT(6);
private int typeValue;

24
designer/src/com/fr/design/mainframe/alphafine/cell/model/NoResultModel.java

@ -0,0 +1,24 @@
package com.fr.design.mainframe.alphafine.cell.model;
import com.fr.design.mainframe.alphafine.CellType;
import com.fr.json.JSONException;
import com.fr.json.JSONObject;
/**
* Created by XiaXiang on 2017/6/8.
*/
public class NoResultModel extends AlphaCellModel {
public NoResultModel(String name) {
super(name, null, CellType.NO_RESULT);
}
@Override
public JSONObject ModelToJson() throws JSONException {
return null;
}
@Override
public String getStoreInformation() {
return null;
}
}

10
designer/src/com/fr/design/mainframe/alphafine/cell/render/ContentCellRender.java

@ -2,6 +2,7 @@ package com.fr.design.mainframe.alphafine.cell.render;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.alphafine.AlphaFineConstants;
import com.fr.design.mainframe.alphafine.CellType;
import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel;
import com.fr.design.mainframe.alphafine.cell.model.MoreModel;
import com.fr.stable.StringUtils;
@ -34,9 +35,14 @@ public class ContentCellRender implements ListCellRenderer<Object> {
AlphaCellModel model = (AlphaCellModel) value;
name.setText(model.getName());
String iconUrl = "/com/fr/design/mainframe/alphafine/images/alphafine" + model.getType().getTypeValue() + ".png";
name.setIcon(new ImageIcon(getClass().getResource(iconUrl)));
if (model.getType() == CellType.NO_RESULT) {
name.setIcon(null);
name.setForeground(AlphaFineConstants.MEDIUM_GRAY);
} else {
name.setIcon(new ImageIcon(getClass().getResource(iconUrl)));
name.setForeground(AlphaFineConstants.BLACK);
}
name.setFont(AlphaFineConstants.MEDIUM_FONT);
name.setForeground(AlphaFineConstants.BLACK);
name.setVerticalTextPosition(SwingConstants.CENTER);
name.setHorizontalTextPosition(SwingConstants.RIGHT);
String description = model.getDescription();

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

@ -10,8 +10,8 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.alphafine.AlphaFineConstants;
import com.fr.design.mainframe.alphafine.AlphaFineHelper;
import com.fr.design.mainframe.alphafine.cell.CellModelHelper;
import com.fr.design.mainframe.alphafine.cell.render.ContentCellRender;
import com.fr.design.mainframe.alphafine.cell.model.*;
import com.fr.design.mainframe.alphafine.cell.render.ContentCellRender;
import com.fr.design.mainframe.alphafine.listener.ComponentHandler;
import com.fr.design.mainframe.alphafine.listener.DocumentAdapter;
import com.fr.design.mainframe.alphafine.model.SearchListModel;
@ -45,7 +45,7 @@ import javax.swing.event.ListSelectionListener;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import java.io.*;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
@ -78,6 +78,7 @@ public class AlphaFineDialog extends UIDialog {
initComponents();
}
/**
* 初始化全部组件
*/
@ -134,6 +135,7 @@ public class AlphaFineDialog extends UIDialog {
addComponentListener(new ComponentHandler());
setSize(AlphaFineConstants.FIELD_SIZE);
centerWindow(this);
}
/**
@ -156,17 +158,17 @@ public class AlphaFineDialog extends UIDialog {
}
/**
* 执行搜索暂时字符要求超过两个才开始搜索
* 执行搜索
* @param text
*/
private void doSearch(String text) {
if (text.length() < 2 || text.contains("'")) {
return;
}
if (StringUtils.isBlank(text) || text.equals("AlphaFine")) {
removeSearchResult();
} else if (text.contains("'")) {
return;
} else {
showSearchResult(text);
showSearchResult();
}
}
@ -198,14 +200,13 @@ public class AlphaFineDialog extends UIDialog {
/**
* 展示搜索结果
* @param searchText
*/
private void showSearchResult(String searchText) {
private void showSearchResult() {
if (searchResultPane == null) {
initSearchResultComponents();
initListListener(searchText);
initListListener();
}
initSearchWorker(searchText);
initSearchWorker();
}
/**
@ -213,6 +214,8 @@ public class AlphaFineDialog extends UIDialog {
*/
private void initSearchResultComponents() {
searchResultList = new JList();
searchListModel = new SearchListModel(new SearchResult());
searchResultList.setModel(searchListModel);
searchResultPane = new JPanel();
searchResultPane.setPreferredSize(AlphaFineConstants.CONTENT_SIZE);
searchResultPane.setLayout(new BorderLayout());
@ -233,56 +236,105 @@ public class AlphaFineDialog extends UIDialog {
}
/**
* 异步加载搜索结构
* @param searchText
* 异步加载搜索结果
*/
private void initSearchWorker(final String searchText) {
searchResultList.setModel(new SearchListModel(AlphaSearchManager.getSearchManager().showDefaultSearchResult()));
private void initSearchWorker() {
if (this.searchWorker != null && !this.searchWorker.isDone()) {
this.searchWorker.cancel(true);
this.searchWorker = null;
}
this.searchWorker = new SwingWorker<SearchListModel, String>() {
this.searchWorker = new SwingWorker() {
@Override
protected SearchListModel doInBackground() {
return setListModel(new SearchListModel(AlphaSearchManager.getSearchManager().getLessSearchResult(searchText)));
protected Object doInBackground() throws Exception {
rebuildList(searchTextField.getText());
return null;
}
@Override
protected void done() {
try {
if (!isCancelled()) {
searchResultList.setModel(get());
searchResultList.validate();
searchResultList.repaint();
validate();
repaint();
/**
* 默认选中第1项第0项为title
*/
if (searchResultList.getModel().getSize() > 0) {
searchResultList.setSelectedIndex(1);
}
}
} catch (InterruptedException e) {
FRLogger.getLogger().error(e.getMessage());
} catch (ExecutionException e) {
FRLogger.getLogger().error(e.getMessage());
if (!isCancelled()) {
searchResultList.setSelectedIndex(1);
}
}
};
this.searchWorker.execute();
}
/**
* 初始化监听器
* 重新构建搜索结果列表
* @param searchText
*/
private void initListListener(final String searchText) {
private void rebuildList(String searchText) {
searchListModel.removeAllElements();
getRecentList(searchText);
getRecommendList(searchText);
getActionList(searchText);
getFileList(searchText);
getDocumentList(searchText);
getPluginList(searchText);
}
private synchronized void getDocumentList(final String searchText) {
SearchResult documentModelList = DocumentSearchManager.getDocumentSearchManager().getLessSearchResult(searchText);
for (Object object : documentModelList) {
AlphaFineHelper.checkCancel();
searchListModel.addElement(object);
}
}
private synchronized void getFileList(final String searchText) {
SearchResult fileModelList = FileSearchManager.getFileSearchManager().getLessSearchResult(searchText);
for (Object object : fileModelList) {
AlphaFineHelper.checkCancel();
searchListModel.addElement(object);
}
}
private synchronized void getActionList(final String searchText) {
SearchResult actionModelList = ActionSearchManager.getActionSearchManager().getLessSearchResult(searchText);
for (Object object : actionModelList) {
AlphaFineHelper.checkCancel();
searchListModel.addElement(object);
}
}
private synchronized void getPluginList(final String searchText) {
SearchResult pluginModelList = PluginSearchManager.getPluginSearchManager().getLessSearchResult(searchText);
for (Object object : pluginModelList) {
AlphaFineHelper.checkCancel();
searchListModel.addElement(object);
}
}
private synchronized void getRecommendList(final String searchText) {
SearchResult recommendModelList = RecommendSearchManager.getRecommendSearchManager().getLessSearchResult(searchText);
for (Object object : recommendModelList) {
AlphaFineHelper.checkCancel();
searchListModel.addElement(object);
}
}
private synchronized void getRecentList(final String searchText) {
SearchResult recentModelList = RecentSearchManager.getRecentSearchManger().getLessSearchResult(searchText);
for (Object object : recentModelList) {
AlphaFineHelper.checkCancel();
searchListModel.addElement(object);
}
}
/**
* 初始化监听器
*/
private void initListListener() {
/**
* 鼠标监听器
*/
@ -536,7 +588,7 @@ public class AlphaFineDialog extends UIDialog {
if (SwingUtilities.isLeftMouseButton(k)) {
Point p = k.getLocationOnScreen();
Rectangle dialogRectangle = AlphaFineDialog.this.getBounds();
Rectangle paneRectangle = new Rectangle(AlphaFinePane.createAlphaFinePane().getLocationOnScreen(), AlphaFinePane.createAlphaFinePane().getSize());
Rectangle paneRectangle = new Rectangle(AlphaFinePane.getAlphaFinePane().getLocationOnScreen(), AlphaFinePane.getAlphaFinePane().getSize());
if (!dialogRectangle.contains(p) && !paneRectangle.contains(p) && !forceOpen) {
AlphaFineDialog.this.dispose();
forceOpen = false;
@ -559,8 +611,8 @@ 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();
if (ComparatorUtils.equals(keyStroke.toString(), storeKeyStroke.toString())) {
KeyStroke storeKeyStroke = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().getShortCutKeyStore();
if (ComparatorUtils.equals(keyStroke.toString(), storeKeyStroke.toString()) && AlphaFinePane.getAlphaFinePane().isVisible()) {
doClickAction();
}
@ -663,11 +715,11 @@ public class AlphaFineDialog extends UIDialog {
SearchResult moreResult = getMoreResult(selectedValue);
if((selectedValue).getContent().equals(Inter.getLocText("FR-Designer_AlphaFine_ShowLess"))) {
for (int i = 0; i < moreResult.size(); i++) {
this.searchListModel.insertElementAt(moreResult.get(i), index + AlphaFineConstants.SHOW_SIZE + 1 + i);
this.searchListModel.add(index + AlphaFineConstants.SHOW_SIZE + 1 + i, moreResult.get(i));
}
} else {
for (int i = 0; i < moreResult.size(); i++) {
this.searchListModel.removeElementAt(index + AlphaFineConstants.SHOW_SIZE + 1);
this.searchListModel.remove(index + AlphaFineConstants.SHOW_SIZE + 1);
}
}
@ -701,7 +753,7 @@ public class AlphaFineDialog extends UIDialog {
moreResult = ActionSearchManager.getActionSearchManager().getMoreSearchResult();
break;
default:
moreResult = AlphaSearchManager.getSearchManager().getMoreSearchResult();
moreResult = new SearchResult();
}
return moreResult;
}
@ -731,4 +783,5 @@ public class AlphaFineDialog extends UIDialog {
public void setForceOpen(boolean forceOpen) {
this.forceOpen = forceOpen;
}
}

22
designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java

@ -1,12 +1,12 @@
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;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import javax.swing.*;
@ -20,7 +20,7 @@ import java.awt.event.ActionListener;
public class AlphaFinePane extends BasicPane {
private static AlphaFinePane alphaFinePane;
public static AlphaFinePane createAlphaFinePane() {
public static AlphaFinePane getAlphaFinePane() {
if (alphaFinePane == null) {
alphaFinePane = new AlphaFinePane();
}
@ -28,12 +28,12 @@ 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();
refreshButton.setIcon(BaseUtils.readIcon("/com/fr/design/mainframe/alphafine/images/smallsearch.png"));
refreshButton.setToolTipText(Inter.getLocText("FR-Designer_Alphafine"));
refreshButton.setIcon(IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/smallsearch.png"));
refreshButton.setToolTipText(Inter.getLocText("FR-Designer_AlphaFine"));
refreshButton.set4ToolbarButton();
this.add(refreshButton);
refreshButton.addActionListener(new ActionListener() {
@ -42,11 +42,17 @@ public class AlphaFinePane extends BasicPane {
AlphaFineHelper.showAlphaFineDialog(false);
}
});
AlphafineContext.addAlphafineContextListener(new AlphafineListener() {
AlphaFineContext.addAlphaFineListener(new AlphaFineListener() {
@Override
public void showDialog() {
AlphaFineHelper.showAlphaFineDialog(true);
}
@Override
public void setEnable(boolean isEnable) {
alphaFinePane.setVisible(isEnable);
}
});
}

19
designer/src/com/fr/design/mainframe/alphafine/model/SearchListModel.java

@ -14,7 +14,9 @@ public class SearchListModel extends DefaultListModel {
@Override
public void addElement(Object element) {
int index = myDelegate.size();
myDelegate.add(element);
fireContentsChanged(this, index, index);
}
@Override
@ -23,17 +25,26 @@ public class SearchListModel extends DefaultListModel {
}
@Override
public void insertElementAt(Object element, int index) {
this.myDelegate.add(index, element);
public void add(int index, Object element) {
myDelegate.add(index, element);
fireIntervalAdded(this, index, index);
}
@Override
public void removeElementAt(int index) {
this.myDelegate.remove(index);
public Object remove(int index) {
Object object = myDelegate.get(index);
myDelegate.remove(object);
fireIntervalRemoved(this, index, index);
return object;
}
@Override
public int getSize() {
return this.myDelegate.size();
}
@Override
public void removeAllElements() {
this.myDelegate.clear();
}
}

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

@ -2,6 +2,7 @@ package com.fr.design.mainframe.alphafine.search.manager;
import com.fr.design.DesignerEnvManager;
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.ActionModel;
import com.fr.design.mainframe.alphafine.cell.model.MoreModel;
@ -23,6 +24,9 @@ public class ActionSearchManager implements AlphaFineSearchProcessor {
private SearchResult lessModelList;
private SearchResult moreModelList;
private static final MoreModel TITLE_MODEL = new MoreModel(Inter.getLocText("FR-Designer_Set"), CellType.ACTION);
private static final MoreModel MORE_MODEL = new MoreModel(Inter.getLocText("FR-Designer_Set"), Inter.getLocText("FR-Designer_AlphaFine_ShowAll"), true, CellType.ACTION);
public synchronized static ActionSearchManager getActionSearchManager() {
if (actionSearchManager == null) {
actionSearchManager = new ActionSearchManager();
@ -35,29 +39,33 @@ 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<UpdateActionModel> updateActions = UpdateActionManager.getUpdateActionManager().getUpdateActions();
for (UpdateActionModel updateActionModel : updateActions) {
if (StringUtils.isNotBlank(updateActionModel.getSearchKey())) {
if (updateActionModel.getSearchKey().toLowerCase().contains(searchText.toLowerCase()) ) {
if (updateActionModel.getSearchKey().toLowerCase().contains(searchText.toLowerCase()) && updateActionModel.getAction().isEnabled()) {
filterModelList.add(new ActionModel(updateActionModel.getActionName(), updateActionModel.getParentName(), updateActionModel.getAction()));
}
}
}
if (filterModelList != null && filterModelList.size() > 0) {
final int length = Math.min(AlphaFineConstants.SHOW_SIZE, filterModelList.size());
for (int i = 0; i < length; i++) {
lessModelList.add(filterModelList.get(i));
}
for (int i = length; i < filterModelList.size(); i++) {
moreModelList.add(filterModelList.get(i));
SearchResult result = new SearchResult();
for (Object object : filterModelList) {
if (!AlphaFineHelper.getFilterResult().contains(object)) {
result.add(object);
}
if (filterModelList.size() > AlphaFineConstants.SHOW_SIZE) {
lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Set"), Inter.getLocText("FR-Designer_AlphaFine_ShowAll"), true, CellType.ACTION));
}
if (result.size() < AlphaFineConstants.SHOW_SIZE + 1) {
lessModelList.add(0, TITLE_MODEL);
if (result.size() == 0) {
lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL);
} else {
lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Set"), CellType.ACTION));
lessModelList.addAll(result);
}
} else {
lessModelList.add(0, MORE_MODEL);
lessModelList.addAll(result.subList(0, AlphaFineConstants.SHOW_SIZE));
moreModelList.addAll(result.subList(AlphaFineConstants.SHOW_SIZE, result.size()));
}
}

69
designer/src/com/fr/design/mainframe/alphafine/search/manager/AlphaSearchManager.java

@ -1,69 +0,0 @@
package com.fr.design.mainframe.alphafine.search.manager;
import com.fr.design.mainframe.alphafine.cell.model.MoreModel;
import com.fr.design.mainframe.alphafine.model.SearchResult;
import com.fr.general.Inter;
/**
* Created by XiaXiang on 2017/3/28.
*/
public class AlphaSearchManager implements AlphaFineSearchProcessor {
private static AlphaSearchManager searchManager;
private static PluginSearchManager pluginSearchManager;
private static DocumentSearchManager documentSearchManager;
private static FileSearchManager fileSearchManager;
private static ActionSearchManager actionSearchManager;
private static RecommendSearchManager recommendSearchManager;
private static RecentSearchManager recentSearchManager;
public synchronized static AlphaSearchManager getSearchManager() {
init();
return searchManager;
}
private synchronized static void init() {
if (searchManager == null) {
searchManager = new AlphaSearchManager();
pluginSearchManager = PluginSearchManager.getPluginSearchManager();
documentSearchManager = DocumentSearchManager.getDocumentSearchManager();
fileSearchManager = FileSearchManager.getFileSearchManager();
actionSearchManager = ActionSearchManager.getActionSearchManager();
recommendSearchManager = RecommendSearchManager.getRecommendSearchManager();
recentSearchManager = RecentSearchManager.getRecentSearchManger();
}
}
@Override
public synchronized SearchResult getLessSearchResult(String searchText) {
SearchResult recentModelList = recentSearchManager.getLessSearchResult(searchText);
SearchResult recommendModelList = recommendSearchManager.getLessSearchResult(searchText);
SearchResult actionModelList = actionSearchManager.getLessSearchResult(searchText);
SearchResult fileModelList = fileSearchManager.getLessSearchResult(searchText);
SearchResult documentModelList = documentSearchManager.getLessSearchResult(searchText);
SearchResult pluginModelList = pluginSearchManager.getLessSearchResult(searchText);
recentModelList.addAll(recommendModelList);
recentModelList.addAll(actionModelList);
recentModelList.addAll(fileModelList);
recentModelList.addAll(documentModelList);
recentModelList.addAll(pluginModelList);
return recentModelList;
}
public SearchResult showDefaultSearchResult() {
SearchResult searchResult = new SearchResult();
searchResult.add(new MoreModel(Inter.getLocText("FR-Designer_AlphaFine_Latest")));
searchResult.add(new MoreModel(Inter.getLocText("FR-Designer_AlphaFine_Conclude")));
searchResult.add(new MoreModel(Inter.getLocText("FR-Designer_Set")));
searchResult.add(new MoreModel(Inter.getLocText("FR-Designer_Templates")));
searchResult.add(new MoreModel(Inter.getLocText("FR-Designer_COMMUNITY_HELP")));
searchResult.add(new MoreModel(Inter.getLocText("FR-Designer-Plugin_Addon")));
return searchResult;
}
@Override
public SearchResult getMoreSearchResult() {
return null;
}
}

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

@ -2,6 +2,7 @@ package com.fr.design.mainframe.alphafine.search.manager;
import com.fr.design.DesignerEnvManager;
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.DocumentModel;
import com.fr.design.mainframe.alphafine.cell.model.MoreModel;
@ -20,6 +21,8 @@ public class DocumentSearchManager implements AlphaFineSearchProcessor {
private static DocumentSearchManager documentSearchManager = null;
private SearchResult lessModelList;
private SearchResult moreModelList;
private static final MoreModel TITLE_MODEL = new MoreModel(Inter.getLocText("FR-Designer_COMMUNITY_HELP"), CellType.DOCUMENT);
private static final MoreModel MORE_MODEL = new MoreModel(Inter.getLocText("FR-Designer_COMMUNITY_HELP"), Inter.getLocText("FR-Designer_AlphaFine_ShowAll"),true, CellType.DOCUMENT);
public synchronized static DocumentSearchManager getDocumentSearchManager() {
if (documentSearchManager == null) {
@ -33,48 +36,62 @@ 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);
httpClient.setTimeout(5000);
httpClient.asGet();
if (!httpClient.isServerAlive()) {
return lessModelList;
return getNoConnectList();
}
result = httpClient.getResponseText();
AlphaFineHelper.checkCancel();
try {
JSONObject jsonObject = new JSONObject(result);
JSONArray jsonArray = jsonObject.optJSONArray("docdata");
if (jsonArray != null && jsonArray.length() > 0) {
final int length = Math.min(AlphaFineConstants.SHOW_SIZE, jsonArray.length());
for (int i = 0; i < length; i++) {
if (jsonArray != null) {
SearchResult searchResult = new SearchResult();
for (int i = 0; i < jsonArray.length(); i++) {
AlphaFineHelper.checkCancel();
DocumentModel cellModel = getModelFromCloud(jsonArray.optJSONObject(i));
this.lessModelList.add(cellModel);
if (!AlphaFineHelper.getFilterResult().contains(cellModel)) {
searchResult.add(cellModel);
}
}
for (int i = length; i < jsonArray.length(); i++) {
DocumentModel cellModel = getModelFromCloud(jsonArray.optJSONObject(i));
this.moreModelList.add(cellModel);
}
if (jsonArray.length() > AlphaFineConstants.SHOW_SIZE) {
lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_COMMUNITY_HELP"), Inter.getLocText("FR-Designer_AlphaFine_ShowAll"),true, CellType.DOCUMENT));
} else {
lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_COMMUNITY_HELP"), CellType.DOCUMENT));
if (searchResult.size() < AlphaFineConstants.SHOW_SIZE + 1) {
lessModelList.add(0, TITLE_MODEL);
if (searchResult.size() == 0) {
lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL);
} else {
lessModelList.addAll(searchResult);
}
} else {
lessModelList.add(0, MORE_MODEL);
lessModelList.addAll(searchResult.subList(0, AlphaFineConstants.SHOW_SIZE));
moreModelList.addAll(searchResult.subList(AlphaFineConstants.SHOW_SIZE, searchResult.size()));
}
}
} catch (JSONException e) {
FRLogger.getLogger().error(e.getMessage());
return lessModelList;
FRLogger.getLogger().error("document search error: " + e.getMessage());
}
}
return lessModelList;
}
/**
* 无连接
* @return
*/
private SearchResult getNoConnectList() {
SearchResult result = new SearchResult();
result.add(0, TITLE_MODEL);
result.add(AlphaFineHelper.NO_CONNECTION_MODEL);
return result;
}
/**
* 根据json信息获取文档model
* @param object

57
designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java

@ -29,6 +29,9 @@ public class FileSearchManager implements AlphaFineSearchProcessor {
private List<FileNode> fileNodes = null;
private static FileSearchManager fileSearchManager = null;
private static final MoreModel TITLE_MODEL = new MoreModel(Inter.getLocText("FR-Designer_Templates"), CellType.FILE);
private static final MoreModel MORE_MODEL = new MoreModel(Inter.getLocText("FR-Designer_Templates"), Inter.getLocText("FR-Designer_AlphaFine_ShowAll"),true, CellType.FILE);
public synchronized static FileSearchManager getFileSearchManager() {
init();
return fileSearchManager;
@ -44,30 +47,36 @@ public class FileSearchManager implements AlphaFineSearchProcessor {
this.filterModelList = new SearchResult();
this.lessModelList = new SearchResult();
this.moreModelList = new SearchResult();
Env env = FRContext.getCurrentEnv();
fileNodes = new ArrayList<>();
fileNodes = listTpl(env, ProjectConstants.REPORTLETS_NAME, true);
for (FileNode node : fileNodes) {
boolean isAlreadyContain = false;
String fileEnvPath = node.getEnvPath();
String filePath = StableUtils.pathJoin(env.getPath(), fileEnvPath);
isAlreadyContain = searchFile(searchText, node, isAlreadyContain);
searchFileContent(searchText, node, isAlreadyContain, filePath);
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainTemplate()) {
Env env = FRContext.getCurrentEnv();
fileNodes = new ArrayList<>();
fileNodes = listTpl(env, ProjectConstants.REPORTLETS_NAME, true);
for (FileNode node : fileNodes) {
boolean isAlreadyContain = false;
String fileEnvPath = node.getEnvPath();
String filePath = StableUtils.pathJoin(env.getPath(), fileEnvPath);
isAlreadyContain = searchFile(searchText, node, isAlreadyContain);
searchFileContent(searchText, node, isAlreadyContain, filePath);
}
}
SearchResult result = new SearchResult();
for (Object object : filterModelList) {
if (!AlphaFineHelper.getFilterResult().contains(object)) {
result.add(object);
}
final int length = Math.min(AlphaFineConstants.SHOW_SIZE, filterModelList.size());
for (int i = 0; i < length; i++) {
lessModelList.add(filterModelList.get(i));
}
for (int i = length; i< filterModelList.size(); i++) {
moreModelList.add(filterModelList.get(i));
}
if (filterModelList.size() > 0) {
if (filterModelList.size() > AlphaFineConstants.SHOW_SIZE) {
lessModelList.add(0,new MoreModel(Inter.getLocText("FR-Designer_Templates"), Inter.getLocText("FR-Designer_AlphaFine_ShowAll"),true, CellType.FILE));
}
if (result.size() < AlphaFineConstants.SHOW_SIZE + 1) {
lessModelList.add(0, TITLE_MODEL);
if (result.size() == 0) {
lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL);
} else {
lessModelList.addAll(result);
}
} else {
lessModelList.add(0,new MoreModel(Inter.getLocText("FR-Designer_Templates"), CellType.FILE));
lessModelList.add(0, MORE_MODEL);
lessModelList.addAll(result.subList(0, AlphaFineConstants.SHOW_SIZE));
moreModelList.addAll(result.subList(AlphaFineConstants.SHOW_SIZE, result.size()));
}
}
return this.lessModelList;
@ -81,7 +90,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));
@ -115,7 +124,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);
@ -165,7 +174,7 @@ public class FileSearchManager implements AlphaFineSearchProcessor {
} else {
nodeList.add(fns[i]);
}
} else {
} else if (fileNode.isFileType("cpt") || fileNode.isFileType("frm")) {
nodeList.add(fileNode);
}
}

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

@ -2,6 +2,7 @@ package com.fr.design.mainframe.alphafine.search.manager;
import com.fr.design.DesignerEnvManager;
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.PluginModel;
import com.fr.design.mainframe.alphafine.cell.model.MoreModel;
@ -11,6 +12,7 @@ import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.general.http.HttpClient;
import com.fr.json.JSONArray;
import com.fr.json.JSONException;
import com.fr.json.JSONObject;
import java.io.UnsupportedEncodingException;
@ -21,9 +23,14 @@ import java.net.URLEncoder;
*/
public class PluginSearchManager implements AlphaFineSearchProcessor {
private static PluginSearchManager pluginSearchManager = null;
private static final MoreModel TITLE_MODEL = new MoreModel(Inter.getLocText("FR-Designer-Plugin_Addon"), CellType.PLUGIN);
private static final MoreModel MORE_MODEL = new MoreModel(Inter.getLocText("FR-Designer-Plugin_Addon"), Inter.getLocText("FR-Designer_AlphaFine_ShowAll"),true, CellType.PLUGIN);
private SearchResult lessModelList;
private SearchResult moreModelList;
public synchronized static PluginSearchManager getPluginSearchManager() {
if (pluginSearchManager == null) {
pluginSearchManager = new PluginSearchManager();
@ -34,10 +41,9 @@ public class PluginSearchManager implements AlphaFineSearchProcessor {
@Override
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");
@ -46,35 +52,51 @@ public class PluginSearchManager implements AlphaFineSearchProcessor {
httpClient.setTimeout(5000);
httpClient.asGet();
if (!httpClient.isServerAlive()) {
return lessModelList;
return getNoConnectList();
}
result = httpClient.getResponseText();
AlphaFineHelper.checkCancel();
JSONObject jsonObject = new JSONObject(result);
JSONArray jsonArray = jsonObject.optJSONArray("result");
if (jsonArray != null && jsonArray.length() > 0) {
int length = Math.min(AlphaFineConstants.SHOW_SIZE, jsonArray.length());
for (int i = 0; i < length; i++) {
if (jsonArray != null) {
SearchResult searchResult = new SearchResult();
for (int i = 0; i < jsonArray.length(); i++) {
PluginModel cellModel = getPluginModel(jsonArray.optJSONObject(i), false);
this.lessModelList.add(cellModel);
if (!AlphaFineHelper.getFilterResult().contains(cellModel)) {
searchResult.add(cellModel);
}
}
for (int i = length; i < jsonArray.length(); i++) {
PluginModel cellModel = getPluginModel(jsonArray.optJSONObject(i), false);
this.moreModelList.add(cellModel);
}
if (jsonArray.length() > AlphaFineConstants.SHOW_SIZE) {
lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer-Plugin_Addon"), Inter.getLocText("FR-Designer_AlphaFine_ShowAll"),true, CellType.PLUGIN));
if (searchResult.size() < AlphaFineConstants.SHOW_SIZE + 1) {
lessModelList.add(0, TITLE_MODEL);
if (searchResult.size() == 0) {
lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL);
} else {
lessModelList.addAll(searchResult);
}
} else {
lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer-Plugin_Addon"), CellType.PLUGIN));
lessModelList.add(0, MORE_MODEL);
lessModelList.addAll(searchResult.subList(0, AlphaFineConstants.SHOW_SIZE));
moreModelList.addAll(searchResult.subList(AlphaFineConstants.SHOW_SIZE, searchResult.size()));
}
}
} catch (Exception e) {
FRLogger.getLogger().error(e.getMessage());
return lessModelList;
} catch (JSONException e) {
FRLogger.getLogger().error("plugin search json error :" + e.getMessage());
} catch (UnsupportedEncodingException e) {
FRLogger.getLogger().error("plugin search encode error :" + e.getMessage());
}
}
return this.lessModelList;
}
private SearchResult getNoConnectList() {
SearchResult result = new SearchResult();
result.add(0, TITLE_MODEL);
result.add(AlphaFineHelper.NO_CONNECTION_MODEL);
return result;
}
private static PluginModel getPluginModel(JSONObject object, boolean isFromCloud) {
@ -121,8 +143,4 @@ public class PluginSearchManager implements AlphaFineSearchProcessor {
}
}
}

67
designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java

@ -3,7 +3,8 @@ package com.fr.design.mainframe.alphafine.search.manager;
import com.fr.base.FRContext;
import com.fr.base.Utils;
import com.fr.design.mainframe.alphafine.AlphaFineConstants;
import com.fr.design.mainframe.alphafine.CellType;
import com.fr.design.mainframe.alphafine.AlphaFineHelper;
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;
import com.fr.design.mainframe.alphafine.model.SearchResult;
@ -39,10 +40,6 @@ public class RecentSearchManager extends XMLFileManager implements AlphaFineSear
private static RecentSearchManager recentSearchManager = null;
private static File recentFile = null;
private SearchResult modelList;
private List<AlphaCellModel> fileList = new ArrayList<>();
private List<AlphaCellModel> actionList = new ArrayList<>();
private List<AlphaCellModel> documentList = new ArrayList<>();
private List<AlphaCellModel> pluginList = new ArrayList<>();
private List<AlphaCellModel> recentModelList = new ArrayList<>();
private Map<String, List<AlphaCellModel>> recentKVModelMap = new HashMap<>();
@ -98,7 +95,7 @@ public class RecentSearchManager extends XMLFileManager implements AlphaFineSear
private void addModelToList(List<AlphaCellModel> list, String name) {
try {
AlphaCellModel model = getModelFromJson(new JSONObject(name));
AlphaCellModel model = CellModelHelper.getModelFromJson(new JSONObject(name));
if (model != null) {
list.add(model);
}
@ -107,60 +104,6 @@ public class RecentSearchManager extends XMLFileManager implements AlphaFineSear
}
}
/**
* 转成cellModel
* @param object
* @return
*/
private AlphaCellModel getModelFromJson(JSONObject object) {
int typeValue = object.optInt("cellType");
AlphaCellModel cellModel = null;
switch (CellType.parse(typeValue)) {
case ACTION:
cellModel = ActionSearchManager.getModelFromCloud(object.optString("result"));
if (cellModel != null) {
actionList.add(cellModel);
}
break;
case DOCUMENT:
cellModel = DocumentSearchManager.getModelFromCloud(object.optJSONObject("result"));
if (cellModel != null) {
documentList.add(cellModel);
}
break;
case FILE:
cellModel = FileSearchManager.getModelFromCloud(object.optString("result"));
if (cellModel != null) {
fileList.add(cellModel);
}
break;
case PLUGIN:
case REUSE:
cellModel = PluginSearchManager.getModelFromCloud(object.optJSONObject("result"));
if (cellModel != null) {
pluginList.add(cellModel);
}
break;
}
return cellModel;
}
public List<AlphaCellModel> getFileList() {
return fileList;
}
public List<AlphaCellModel> getActionList() {
return actionList;
}
public List<AlphaCellModel> getDocumentList() {
return documentList;
}
public List<AlphaCellModel> getPluginList() {
return pluginList;
}
@Override
public void writeXML(XMLPrintWriter writer) {
@ -209,7 +152,6 @@ public class RecentSearchManager extends XMLFileManager implements AlphaFineSear
if (!envFile.exists()) {
createRecentFile(envFile);
}
return envFile;
}
@ -273,9 +215,10 @@ public class RecentSearchManager extends XMLFileManager implements AlphaFineSear
* @param searchText
* @return
*/
public List<AlphaCellModel> getRecentModelList(String searchText) {
public synchronized List<AlphaCellModel> getRecentModelList(String searchText) {
recentModelList = new ArrayList<>();
for (String key : recentKVModelMap.keySet()) {
AlphaFineHelper.checkCancel();
if (ComparatorUtils.equals(key, searchText)) {
recentModelList = recentKVModelMap.get(searchText);
int size = recentModelList.size();

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

@ -1,6 +1,7 @@
package com.fr.design.mainframe.alphafine.search.manager;
import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.alphafine.AlphaFineHelper;
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;
@ -13,12 +14,16 @@ import com.fr.json.JSONException;
import com.fr.json.JSONObject;
import com.fr.stable.CodeUtils;
import java.util.ArrayList;
import java.util.List;
/**
* Created by XiaXiang on 2017/3/31.
*/
public class RecommendSearchManager implements AlphaFineSearchProcessor {
private static RecommendSearchManager recommendSearchManager = null;
private SearchResult modelList;
private List<AlphaCellModel> recommendModelList = new ArrayList<>();
//todo:for test
private static final String SEARCHAPI = "http://localhost:8080/monitor/alphafine/search/recommend?searchKey=";
@ -31,43 +36,60 @@ 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();
httpClient.setTimeout(5000);
if (!httpClient.isServerAlive()) {
return modelList;
return getNoConnectList();
}
result = httpClient.getResponseText();
AlphaFineHelper.checkCancel();
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++) {
AlphaFineHelper.checkCancel();
AlphaCellModel alphaCellModel = CellModelHelper.getModelFromJson((JSONObject) jsonArray.get(i));
if (alphaCellModel != null && !RecentSearchManager.getRecentSearchManger().getRecentModelList().contains(alphaCellModel)) {
this.modelList.add(alphaCellModel);
this.recommendModelList.add(alphaCellModel);
}
}
}
}
} catch (JSONException e) {
FRLogger.getLogger().error("data transform error! :" + e.getMessage());
FRLogger.getLogger().error("recommend search error! :" + e.getMessage());
}
if (modelList.size() > 0) {
modelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_AlphaFine_Conclude"), false));
modelList.add(new MoreModel(Inter.getLocText("FR-Designer_AlphaFine_Recommend"), false));
modelList.addAll(recommendModelList);
}
}
return modelList;
}
private SearchResult getNoConnectList() {
SearchResult result = new SearchResult();
result.add(0, new MoreModel(Inter.getLocText("FR-Designer_AlphaFine_Recommend"), false));
result.add(AlphaFineHelper.NO_CONNECTION_MODEL);
return result;
}
@Override
public SearchResult getMoreSearchResult() {
return new SearchResult();
}
public List<AlphaCellModel> getRecommendModelList() {
return recommendModelList;
}
public void setRecommendModelList(List<AlphaCellModel> recommendModelList) {
this.recommendModelList = recommendModelList;
}
}

2
designer/src/com/fr/start/Designer.java

@ -346,7 +346,7 @@ public class Designer extends BaseDesigner {
* @return 面板组件
*/
public Component createAlphafinePane() {
return AlphaFinePane.createAlphaFinePane();
return AlphaFinePane.getAlphaFinePane();
}

4
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) {

18
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;
}
}

22
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,6 @@
package com.fr.design.actions.help.alphafine;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog;
@ -17,13 +17,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 +49,19 @@ 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();
final AlphaFineConfigManager manager = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager();
if (!FRContext.isChineseEnv()) {
manager.setSearchOnLine(false);
}
alphaFineConfigPane.populate(manager);
DialogActionListener dialogActionListener = new DialogActionAdapter() {
public void doOk() {
alphafineConfigPane.update();
designerFrame.refreshToolbar();
alphaFineConfigPane.update();
AlphaFineContext.fireAlphaFineEnable(manager.isEnabled());
}
};
BasicDialog basicDialog = alphafineConfigPane.showMediumWindow(designerFrame, dialogActionListener);
BasicDialog basicDialog = alphaFineConfigPane.showMediumWindow(designerFrame, dialogActionListener);
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.
*/
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

65
designer_base/src/com/fr/design/actions/help/alphafine/AlphafineConfigPane.java → designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigPane.java

@ -1,5 +1,6 @@
package com.fr.design.actions.help.alphafine;
import com.fr.base.FRContext;
import com.fr.design.DesignerEnvManager;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icheckbox.UICheckBox;
@ -20,7 +21,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 +57,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 +72,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}
@ -85,13 +86,13 @@ public class AlphafineConfigPane extends BasicPane {
double[] columnSize = {COLUMN_GAP, COLUMN_GAP, COLUMN_GAP};
JPanel northPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_AlphaFine_SearchRange"));
isContainRecommendCheckbox = new UICheckBox(Inter.getLocText("FR-Designer_AlphaFine_Conclude"));
isContainRecommendCheckbox = new UICheckBox(Inter.getLocText("FR-Designer_AlphaFine_Recommend"));
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"));
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 +155,36 @@ 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.setEnabled(FRContext.isChineseEnv());
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 +195,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);

40
designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineContext.java

@ -0,0 +1,40 @@
package com.fr.design.actions.help.alphafine;
import java.util.ArrayList;
import java.util.List;
/**
* Created by XiaXiang on 2017/5/27.
*/
public class AlphaFineContext {
private static List<AlphaFineListener> fireAlphaFineListener = new ArrayList<AlphaFineListener>();
/**
* 触发AlphaFine弹窗
*/
public static void fireAlphaFineShowDialog() {
for (AlphaFineListener l : fireAlphaFineListener) {
l.showDialog();
}
}
/**
* 触发开启或关闭AlphaFine功能
* @param isEnable
*/
public static void fireAlphaFineEnable(boolean isEnable) {
for (AlphaFineListener l : fireAlphaFineListener) {
l.setEnable(isEnable);
}
}
/**
* 添加一个AlphaFine的监听事件
*
* @param l AlphaFine监听事件
*/
public static void addAlphaFineListener(AlphaFineListener l) {
fireAlphaFineListener.add(l);
}
}

18
designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineListener.java

@ -0,0 +1,18 @@
package com.fr.design.actions.help.alphafine;
/**
* Created by XiaXiang on 2017/5/27.
* AlphaFine监听器
*/
public interface AlphaFineListener {
/**
* 显示dialog
*/
void showDialog();
/**
* 设置可用性
* @param isEnable
*/
void setEnable(boolean isEnable);
}

29
designer_base/src/com/fr/design/actions/help/alphafine/AlphafineContext.java

@ -1,29 +0,0 @@
package com.fr.design.actions.help.alphafine;
import java.util.ArrayList;
import java.util.List;
/**
* Created by XiaXiang on 2017/5/27.
*/
public class AlphafineContext {
private static List<AlphafineListener> fireLoginContextListener = new ArrayList<AlphafineListener>();
/**
* 触发AlphaFine弹窗
*/
public static void fireAlphaFineContextListener() {
for (AlphafineListener l : fireLoginContextListener) {
l.showDialog();
}
}
/**
* 添加一个弹出AlphaFine的监听事件
*
* @param l AlphaFine框弹出监听事件
*/
public static void addAlphafineContextListener(AlphafineListener l) {
fireLoginContextListener.add(l);
}
}

8
designer_base/src/com/fr/design/actions/help/alphafine/AlphafineListener.java

@ -1,8 +0,0 @@
package com.fr.design.actions.help.alphafine;
/**
* Created by XiaXiang on 2017/5/27.
*/
public interface AlphafineListener {
void showDialog();
}

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

@ -8,6 +8,7 @@ import java.awt.*;
/**
* Created by XiaXiang on 2017/5/26.
* 提示弹窗
*/
public class RemindDialog extends UIDialog {
private RemindPane remindPane;
@ -22,7 +23,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);

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));
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.fireAlphaFineShowDialog();
}
});

6
designer_base/src/com/fr/design/locale/designer.properties

@ -1998,7 +1998,7 @@ FR-Designer_AlphaFine_EnableInternet=Designer_AlphaFine_EnableInternet
FR-Designer_AlphaFine_EnableInternetSearch=SearchOnLine
FR-Designer_AlphaFine_Shortcut_Config=Shortcut Config
FR-Designer_AlphaFine_SearchRange=Search Range
FR-Designer_AlphaFine_Conclude=Conclude
FR-Designer_AlphaFine_Recommend=Recommend
FR-Designer-Plugin_Addon=Plugin Addon
FR-Designer_Templates=FR-Designer_Templates
FR-Designer_Templates_Content=Templates Contents
@ -2006,4 +2006,6 @@ FR-Designer_AlphaFine_ShowAll=show all
FR-Designer_AlphaFine_Latest=Latest
FR-Designer_AlphaFine_ShowLess=show less
FR-Designer_Alphafine=AlphaFine
FR-Designer-Alphafine_No_Remind=
FR-Designer-Alphafine_No_Remind=
FR-Designer_AlphaFine_NoResult=no results
FR-Designer_ConnectionFailed=connection failed

18
designer_base/src/com/fr/design/locale/designer_en_US.properties

@ -1993,15 +1993,19 @@ FR-Designer_Permissions=Permissions
FR-Designer_Form_Button=Button
FR-Designer_WF_Name=Name
FR-Designer_AlphaFine_Enable=Enable
FR-Designer_AlphaFine_EnableInternetSearch=SearchOnLine
FR-Designer_AlphaFine_EnableInternetSearch=Search OnLine
FR-Designer_AlphaFine_Shortcut_Config=Shortcut Config
FR-Designer_AlphaFine_SearchRange=Search Range
FR-Designer_AlphaFine_Conclude=Conclude
FR-Designer_AlphaFine_Recommend=Recommend
FR-Designer-Plugin_Addon=Plugin Addon
FR-Designer_Templates=Templates
FR-Designer_Templates_Content=Template'Contents
FR-Designer_AlphaFine_ShowAll=show all
FR-Designer_Templates=Files
FR-Designer_Templates_Content=Files'contents
FR-Designer_AlphaFine_ShowAll=Show all
FR-Designer_AlphaFine_Latest=Recent
FR-Designer_AlphaFine_ShowLess=show less
FR-Designer_AlphaFine_ShowLess=Show less
FR-Designer_Alphafine=AlphaFine
FR-Designer-Alphafine_No_Remind=don't remind
FR-Designer-Alphafine_No_Remind=Don't remind
FR-Designer_AlphaFine_NoResult=No results
FR-Designer_ConnectionFailed=Connection failed
FR-Designer_AlphaFine_EnableAlphaFine=Enable AlphaFine
FR-Designer_AlphaFine_EnableInternet=Internet

6
designer_base/src/com/fr/design/locale/designer_zh_CN.properties

@ -1998,8 +1998,10 @@ FR-Designer-Plugin_Addon=\u5E94\u7528\u4E2D\u5FC3
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_Recommend=\u731C\u60A8\u9700\u8981
FR-Designer_AlphaFine_Latest=\u672C\u5730\u5E38\u7528
FR-Designer_AlphaFine_ShowLess=\u6536\u8D77
FR-Designer_Alphafine=AlphaFine\u667A\u80FD\u641C\u7D22
FR-Designer-Alphafine_No_Remind=\u4E0D\u518D\u63D0\u793A
FR-Designer-Alphafine_No_Remind=\u4E0D\u518D\u63D0\u793A
FR-Designer_AlphaFine_NoResult=\u6682\u65E0\u76F8\u5173\u5185\u5BB9
FR-Designer_ConnectionFailed=\u94FE\u63A5\u5931\u8D25

6
designer_base/src/com/fr/design/locale/designer_zh_TW.properties

@ -1992,7 +1992,7 @@ FR-Designer_AlphaFine_EnableAlphaFine=\u958B\u555FAlphaFine\u529F\u80FD
FR-Designer_AlphaFine_EnableInternetSearch=\u806F\u7DB2\u641C\u7D22
FR-Designer_AlphaFine_Shortcut_Config=\u5FEB\u6377\u9375\u914D\u7F6E
FR-Designer_AlphaFine_SearchRange=\u641C\u7D22\u7BC4\u570D
FR-Designer_AlphaFine_Conclude=\u731C\u60A8\u9700\u8981
FR-Designer_AlphaFine_Recommend=\u731C\u60A8\u9700\u8981
FR-Designer-Plugin_Addon=\u61C9\u7528\u4E2D\u5FC3
FR-Designer_Templates=\u6A21\u677F
FR-Designer_Templates_Content=\u6A21\u677F\u5167\u5BB9
@ -2000,4 +2000,6 @@ FR-Designer_AlphaFine_Latest=\u6700\u8FD1\u5E38\u7528
FR-Designer_AlphaFine_ShowLess=\u6536\u8D77
FR-Designer_Alphafine=AlphaFine\u667A\u80FD\u641C\u7D22
FR-Designer_AlphaFine_ShowAll=\u986F\u793A\u5168\u90E8
FR-Designer-Alphafine_No_Remind=\u4E0D\u518D\u63D0\u793A
FR-Designer-Alphafine_No_Remind=\u4E0D\u518D\u63D0\u793A
FR-Designer_AlphaFine_NoResult=\u66AB\u7121\u76F8\u95DC\u5167\u5BB9
FR-Designer_ConnectionFailed=\u93C8\u63A5\u5931\u6557

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);
}
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.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()]);
}

Loading…
Cancel
Save