Browse Source

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

* commit 'd705d50fa21418af0872eed06a6e3dde7cc3b11c':
  bug fix
  bug fix
  bug fix
  bug fix
  bug fix
  bug fix
  bug fix
  bug fix
  bug fix
  bug fix 设置的搜索
  bug fix
  bug fix
  bug fix
  bug fix
  bug fix
  bug fix
  bug fix
  bug fix
  alphafine bug fix 设置搜索
  alphafine 设置的面板内容搜索
master
superman 8 years ago
parent
commit
f311ec8c0f
  1. 8
      designer/src/com/fr/design/actions/insert/cell/DSColumnCellAction.java
  2. 10
      designer/src/com/fr/design/actions/report/ReportEngineAttrAction.java
  3. 5
      designer/src/com/fr/design/actions/report/ReportExportAttrAction.java
  4. 4
      designer/src/com/fr/design/actions/report/ReportMobileAttrAction.java
  5. 4
      designer/src/com/fr/design/actions/report/ReportPageAttrAction.java
  6. 13
      designer/src/com/fr/design/actions/report/ReportPageSetupAction.java
  7. 7
      designer/src/com/fr/design/actions/report/ReportWebAttrAction.java
  8. 10
      designer/src/com/fr/design/actions/report/ReportWriteAttrAction.java
  9. 7
      designer/src/com/fr/design/actions/server/ServerConfigManagerAction.java
  10. 4
      designer/src/com/fr/design/actions/server/StyleListAction.java
  11. 5
      designer/src/com/fr/design/mainframe/alphafine/AlphaFineHelper.java
  12. 16
      designer/src/com/fr/design/mainframe/alphafine/cell/model/ActionModel.java
  13. 79
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  14. 33
      designer/src/com/fr/design/mainframe/alphafine/search/manager/ActionSearchManager.java
  15. 100
      designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java
  16. 2
      designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java
  17. 8
      designer/src/com/fr/design/webattr/EditReportServerParameterPane.java
  18. 11
      designer/src/com/fr/design/webattr/ReportWebAttrPane.java
  19. 2
      designer/src/com/fr/design/webattr/ReportWriteAttrPane.java
  20. 119
      designer_base/src/com/fr/design/actions/UpdateAction.java
  21. 56
      designer_base/src/com/fr/design/actions/file/PreferenceAction.java
  22. 3
      designer_base/src/com/fr/design/actions/help/AboutAction.java
  23. 4
      designer_base/src/com/fr/design/actions/help/alphafine/AlphafineAction.java
  24. 1
      designer_base/src/com/fr/design/actions/help/alphafine/AlphafineConfigManager.java
  25. 6
      designer_base/src/com/fr/design/actions/server/ConnectionListAction.java
  26. 4
      designer_base/src/com/fr/design/actions/server/FunctionManagerAction.java
  27. 26
      designer_base/src/com/fr/design/gui/frpane/LoadingBasicPane.java
  28. 5
      designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  29. 39
      designer_base/src/com/fr/design/mainframe/toolbar/UpdateActionModel.java
  30. 4
      designer_chart/src/com/fr/design/module/ChartPreStyleAction.java

8
designer/src/com/fr/design/actions/insert/cell/DSColumnCellAction.java

@ -1,9 +1,10 @@
package com.fr.design.actions.insert.cell;
import com.fr.base.BaseUtils;
import com.fr.design.actions.core.WorkBookSupportable;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.dscolumn.DSColumnPane;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.menu.KeySetUtils;
import com.fr.general.IOUtils;
import com.fr.report.cell.cellattr.core.group.DSColumn;
public class DSColumnCellAction extends AbstractCellAction implements WorkBookSupportable {
@ -12,7 +13,8 @@ public class DSColumnCellAction extends AbstractCellAction implements WorkBookSu
this.setMenuKeySet(KeySetUtils.INSERT_DATA_COLUMN);
this.setName(getMenuKeySet().getMenuKeySetName()+ "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/bindColumn.png"));
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_insert/bindColumn.png"));
this.setSearchText(new DSColumnPane());
}
@Override

10
designer/src/com/fr/design/actions/report/ReportEngineAttrAction.java

@ -1,13 +1,13 @@
package com.fr.design.actions.report;
import com.fr.base.BaseUtils;
import com.fr.design.actions.ReportComponentAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.WorkSheetDesigner;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.report.LayerReportPane;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.general.IOUtils;
import com.fr.report.worksheet.WorkSheet;
public class ReportEngineAttrAction extends ReportComponentAction<WorkSheetDesigner> {
@ -17,7 +17,9 @@ public class ReportEngineAttrAction extends ReportComponentAction<WorkSheetDesig
this.setMenuKeySet(KeySetUtils.REPORT_ENGINE);
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/reportEngineAttr.png"));
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_report/reportEngineAttr.png"));
this.setSearchText(new LayerReportPane(null));
}
private boolean isChange;

5
designer/src/com/fr/design/actions/report/ReportExportAttrAction.java

@ -9,7 +9,9 @@ import com.fr.design.mainframe.JWorkBook;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.report.ReportExportAttrPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.general.IOUtils;
import com.fr.main.TemplateWorkBook;
import com.fr.plugin.chart.designer.other.HyperlinkMapFactory;
public class ReportExportAttrAction extends JWorkBookAction {
@ -18,7 +20,8 @@ public class ReportExportAttrAction extends JWorkBookAction {
this.setMenuKeySet(KeySetUtils.REPORT_EXPORT_ATTR);
this.setName(getMenuKeySet().getMenuKeySetName()+"...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/exportAttr.png"));
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_report/exportAttr.png"));
this.setSearchText(new ReportExportAttrPane());
}
/**

4
designer/src/com/fr/design/actions/report/ReportMobileAttrAction.java

@ -8,6 +8,7 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JWorkBook;
import com.fr.design.menu.MenuKeySet;
import com.fr.design.report.mobile.ReportMobileAttrPane;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.main.TemplateWorkBook;
import com.fr.report.mobile.ElementCaseMobileAttr;
@ -27,7 +28,8 @@ public class ReportMobileAttrAction extends JWorkBookAction{
this.setMenuKeySet(REPORT_APP_ATTR);
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/mobile.png"));
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_report/mobile.png"));
this.setSearchText(new ReportMobileAttrPane());
}
/**

4
designer/src/com/fr/design/actions/report/ReportPageAttrAction.java

@ -12,6 +12,7 @@ import com.fr.design.menu.KeySetUtils;
import com.fr.design.report.freeze.RepeatAndFreezeSettingPane;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.general.IOUtils;
import com.fr.report.worksheet.WorkSheet;
/**
@ -27,7 +28,8 @@ public class ReportPageAttrAction extends ReportComponentAction<WorkSheetDesigne
this.setMenuKeySet(KeySetUtils.REPORT_PAGE);
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/pageSetup.png"));
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_file/pageSetup.png"));
this.setSearchText(new RepeatAndFreezeSettingPane());
}
/**

13
designer/src/com/fr/design/actions/report/ReportPageSetupAction.java

@ -3,18 +3,18 @@
*/
package com.fr.design.actions.report;
import javax.swing.SwingUtilities;
import com.fr.base.BaseUtils;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.ReportComponentAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.ReportComponent;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.report.PageSetupPane;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.general.IOUtils;
import com.fr.report.report.TemplateReport;
import javax.swing.*;
/**
* PageSetup action.
*/
@ -27,7 +27,8 @@ public class ReportPageSetupAction extends ReportComponentAction<ReportComponent
this.setMenuKeySet(KeySetUtils.REPORT_PAGE_SETUP);
this.setName(getMenuKeySet().getMenuKeySetName()+"...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/pageSetup.png"));
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_file/pageSetup.png"));
this.setSearchText(new PageSetupPane());
}
/**

7
designer/src/com/fr/design/actions/report/ReportWebAttrAction.java

@ -3,8 +3,8 @@
*/
package com.fr.design.actions.report;
import com.fr.base.BaseUtils;
import com.fr.base.ConfigManager;
import com.fr.base.ConfigManagerProvider;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.design.actions.JWorkBookAction;
@ -14,8 +14,8 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JWorkBook;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.webattr.ReportWebAttrPane;
import com.fr.general.IOUtils;
import com.fr.main.TemplateWorkBook;
import com.fr.base.ConfigManagerProvider;
import java.awt.event.ActionEvent;
@ -29,7 +29,8 @@ public class ReportWebAttrAction extends JWorkBookAction {
this.setMenuKeySet(KeySetUtils.REPORT_WEB_ATTR);
this.setName(getMenuKeySet().getMenuKeySetName()+"...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/webreportattribute.png"));
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_report/webreportattribute.png"));
this.setSearchText(new ReportWebAttrPane().getAllComponents());
}
/**

10
designer/src/com/fr/design/actions/report/ReportWriteAttrAction.java

@ -1,14 +1,14 @@
package com.fr.design.actions.report;
import com.fr.base.BaseUtils;
import com.fr.design.actions.ReportComponentAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.WorkSheetDesigner;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.webattr.ReportWriteAttrPane;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.general.IOUtils;
import com.fr.report.worksheet.WorkSheet;
/**
@ -20,7 +20,9 @@ public class ReportWriteAttrAction extends ReportComponentAction<WorkSheetDesign
this.setMenuKeySet(KeySetUtils.REPORT_WRITE);
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/reportWriteAttr.png"));
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_report/reportWriteAttr.png"));
this.setSearchText(new ReportWriteAttrPane(null).getAllComponents());
}
// ben:用来判断是否update

7
designer/src/com/fr/design/actions/server/ServerConfigManagerAction.java

@ -3,8 +3,8 @@
*/
package com.fr.design.actions.server;
import com.fr.base.BaseUtils;
import com.fr.base.ConfigManager;
import com.fr.base.ConfigManagerProvider;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.design.actions.UpdateAction;
@ -13,8 +13,8 @@ import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.menu.MenuKeySet;
import com.fr.design.webattr.EditReportServerParameterPane;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.base.ConfigManagerProvider;
import javax.swing.*;
import java.awt.event.ActionEvent;
@ -27,7 +27,8 @@ public class ServerConfigManagerAction extends UpdateAction {
this.setMenuKeySet(SERVER_CONFIG_MANAGER);
this.setName(getMenuKeySet().getMenuKeySetName()+ "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_web/edit.png"));
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_web/edit.png"));
this.setSearchText(new EditReportServerParameterPane().getAllComponents());
}
/**

4
designer/src/com/fr/design/actions/server/StyleListAction.java

@ -10,6 +10,7 @@ import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import javax.swing.*;
@ -24,7 +25,8 @@ public class StyleListAction extends UpdateAction {
this.setMenuKeySet(PREDEFINED_STYLES);
this.setName(getMenuKeySet().getMenuKeySetName()+ "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_web/style.png"));
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_web/style.png"));
this.setSearchText(new StyleManagerPane());
}
/**

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

@ -8,15 +8,12 @@ import com.fr.stable.StringUtils;
* Created by XiaXiang on 2017/5/8.
*/
public class AlphaFineHelper {
private static AlphaFineDialog dialog;
/**
* 弹出alphafine搜索面板
*/
public static void showAlphaFineDialog(boolean forceOpen) {
if (dialog == null) {
dialog = new AlphaFineDialog(DesignerContext.getDesignerFrame(), forceOpen);
}
AlphaFineDialog dialog = new AlphaFineDialog(DesignerContext.getDesignerFrame(), forceOpen);
dialog.setVisible(true);
}

16
designer/src/com/fr/design/mainframe/alphafine/cell/model/ActionModel.java

@ -6,7 +6,6 @@ import com.fr.json.JSONException;
import com.fr.json.JSONObject;
import javax.swing.*;
import java.io.Serializable;
/**
* Created by XiaXiang on 2017/4/20.
@ -14,7 +13,7 @@ import java.io.Serializable;
public class ActionModel extends AlphaCellModel {
private Action action;
private String actionName;
private String className;
public ActionModel(String name, String content, CellType type) {
super(name, content, type);
@ -44,11 +43,6 @@ public class ActionModel extends AlphaCellModel {
this.setDescription(description);
}
public ActionModel(String name, Action action) {
super(name, null, CellType.ACTION);
this.action = action;
}
public Action getAction() {
return action;
}
@ -70,14 +64,14 @@ public class ActionModel extends AlphaCellModel {
@Override
public String getStoreInformation() {
return getActionName();
return getClassName();
}
public String getActionName() {
public String getClassName() {
return getAction().getClass().getName();
}
public void setActionName(String actionName) {
this.actionName = actionName;
public void setClassName(String className) {
this.className = className;
}
}

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

@ -68,15 +68,19 @@ public class AlphaFineDialog extends UIDialog {
private SearchListModel searchListModel;
private SwingWorker searchWorker;
//是否强制打开,因为面板是否关闭绑定了全局鼠标事件,这里需要处理一下
private boolean foreOpen;
private boolean forceOpen;
public AlphaFineDialog(Frame parent, boolean foreOpen) {
public AlphaFineDialog(Frame parent, boolean forceOpen) {
super(parent);
this.forceOpen = forceOpen;
initProperties();
initListener();
initComponents();
}
/**
* 初始化全部组件
*/
private void initComponents() {
searchTextField = new AlphaFineTextField("AlphaFine");
searchTextField.setFont(AlphaFineConstants.GREATER_FONT);
@ -122,6 +126,9 @@ public class AlphaFineDialog extends UIDialog {
});
}
/**
*
*/
private void initProperties() {
setUndecorated(true);
addComponentListener(new ComponentHandler());
@ -129,6 +136,10 @@ public class AlphaFineDialog extends UIDialog {
centerWindow(this);
}
/**
* 设置面板位置
* @param win
*/
private void centerWindow(Window win) {
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
@ -144,6 +155,10 @@ public class AlphaFineDialog extends UIDialog {
win.setLocation((screenSize.width - winSize.width ) / 2, (screenSize.height - winSize.height) / AlphaFineConstants.SHOW_SIZE);
}
/**
* 执行搜索暂时字符要求超过两个才开始搜索
* @param text
*/
private void doSearch(String text) {
if (text.length() < 2 || text.contains("'")) {
return;
@ -156,6 +171,9 @@ public class AlphaFineDialog extends UIDialog {
}
/**
* 移除搜索结果
*/
private void removeSearchResult() {
if (searchResultPane != null) {
remove(searchResultPane);
@ -178,7 +196,10 @@ public class AlphaFineDialog extends UIDialog {
// }
/**
* 展示搜索结果
* @param searchText
*/
private void showSearchResult(String searchText) {
if (searchResultPane == null) {
initSearchResultComponents();
@ -187,6 +208,9 @@ public class AlphaFineDialog extends UIDialog {
initSearchWorker(searchText);
}
/**
* 初始化搜索面板
*/
private void initSearchResultComponents() {
searchResultList = new JList();
searchResultPane = new JPanel();
@ -208,6 +232,10 @@ public class AlphaFineDialog extends UIDialog {
setSize(AlphaFineConstants.FULL_SIZE);
}
/**
* 异步加载搜索结构
* @param searchText
*/
private void initSearchWorker(final String searchText) {
searchResultList.setModel(new SearchListModel(AlphaSearchManager.getSearchManager().showDefaultSearchResult()));
if (this.searchWorker != null && !this.searchWorker.isDone()) {
@ -230,6 +258,13 @@ public class AlphaFineDialog extends UIDialog {
searchResultList.repaint();
validate();
repaint();
/**
* 默认选中第1项第0项为title
*/
if (searchResultList.getModel().getSize() > 0) {
searchResultList.setSelectedIndex(1);
}
}
} catch (InterruptedException e) {
FRLogger.getLogger().error(e.getMessage());
@ -243,7 +278,14 @@ public class AlphaFineDialog extends UIDialog {
this.searchWorker.execute();
}
/**
* 初始化监听器
* @param searchText
*/
private void initListListener(final String searchText) {
/**
* 鼠标监听器
*/
searchResultList.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
@ -262,7 +304,9 @@ public class AlphaFineDialog extends UIDialog {
}
});
// TODO: 2017/5/8 xiaxiang: e.getClickCount() == 1 时,偶发性的不能触发,所以先放到valueChanged
/**
*单击时触发右侧面板展示搜索结果
*/
searchResultList.addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent e) {
@ -273,6 +317,9 @@ public class AlphaFineDialog extends UIDialog {
}
});
/**
* 键盘监听器
*/
searchResultList.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
@ -435,6 +482,9 @@ public class AlphaFineDialog extends UIDialog {
}
/**
* 窗口拖拽
*/
private void initMouseListener() {
addMouseMotionListener(new MouseMotionAdapter() {
@Override
@ -487,9 +537,9 @@ public class AlphaFineDialog extends UIDialog {
Point p = k.getLocationOnScreen();
Rectangle dialogRectangle = AlphaFineDialog.this.getBounds();
Rectangle paneRectangle = new Rectangle(AlphaFinePane.createAlphaFinePane().getLocationOnScreen(), AlphaFinePane.createAlphaFinePane().getSize());
if (!dialogRectangle.contains(p) && !paneRectangle.contains(p) && !foreOpen) {
if (!dialogRectangle.contains(p) && !paneRectangle.contains(p) && !forceOpen) {
AlphaFineDialog.this.dispose();
foreOpen = false;
forceOpen = false;
}
}
}
@ -604,15 +654,20 @@ public class AlphaFineDialog extends UIDialog {
}
/**
* 点击显示更多时添加对应的model到list点击收起是移除model
* @param index
* @param selectedValue
*/
private void rebuildShowMoreList(int index, MoreModel selectedValue) {
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.insertElementAt(moreResult.get(i), index + AlphaFineConstants.SHOW_SIZE + 1 + i);
}
} else {
for (int i = 0; i < moreResult.size(); i++) {
this.searchListModel.removeElementAt(index + AlphaFineConstants.SHOW_SIZE - 1);
this.searchListModel.removeElementAt(index + AlphaFineConstants.SHOW_SIZE + 1);
}
}
@ -669,11 +724,11 @@ public class AlphaFineDialog extends UIDialog {
}
public boolean isForeOpen() {
return foreOpen;
public boolean isForceOpen() {
return forceOpen;
}
public void setForeOpen(boolean foreOpen) {
this.foreOpen = foreOpen;
public void setForceOpen(boolean forceOpen) {
this.forceOpen = forceOpen;
}
}

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

@ -1,16 +1,16 @@
package com.fr.design.mainframe.alphafine.search.manager;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.UpdateAction;
import com.fr.design.mainframe.alphafine.AlphaFineConstants;
import com.fr.design.mainframe.alphafine.CellType;
import com.fr.design.mainframe.alphafine.cell.model.MoreModel;
import com.fr.design.mainframe.alphafine.cell.model.ActionModel;
import com.fr.design.mainframe.alphafine.cell.model.MoreModel;
import com.fr.design.mainframe.alphafine.model.SearchResult;
import com.fr.design.mainframe.toolbar.UpdateActionManager;
import com.fr.design.mainframe.toolbar.UpdateActionModel;
import com.fr.general.FRLogger;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import java.util.List;
@ -38,8 +38,8 @@ public class ActionSearchManager implements AlphaFineSearchProcessor {
if (DesignerEnvManager.getEnvManager().getAlphafineConfigManager().isContainAction()) {
List<UpdateActionModel> updateActions = UpdateActionManager.getUpdateActionManager().getUpdateActions();
for (UpdateActionModel updateActionModel : updateActions) {
if (updateActionModel.getActionName() != null) {
if (updateActionModel.getActionName().toLowerCase().contains(searchText.toLowerCase()) || updateActionModel.getParentName().toLowerCase().contains(searchText.toLowerCase())) {
if (StringUtils.isNotBlank(updateActionModel.getSearchKey())) {
if (updateActionModel.getSearchKey().toLowerCase().contains(searchText.toLowerCase()) ) {
filterModelList.add(new ActionModel(updateActionModel.getActionName(), updateActionModel.getParentName(), updateActionModel.getAction()));
}
}
@ -53,7 +53,7 @@ public class ActionSearchManager implements AlphaFineSearchProcessor {
moreModelList.add(filterModelList.get(i));
}
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));
lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Set"), Inter.getLocText("FR-Designer_AlphaFine_ShowAll"), true, CellType.ACTION));
} else {
lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Set"), CellType.ACTION));
}
@ -70,24 +70,17 @@ public class ActionSearchManager implements AlphaFineSearchProcessor {
}
/**
* 根据类名反射获取对象
* 根据类名获取对象
* @param actionName
* @return
*/
public static ActionModel getModelFromCloud(String actionName ) {
UpdateAction action = null;
String name = null;
try {
Class<?> className = Class.forName(actionName);
action = (UpdateAction) className.newInstance();
name = action.getName();
} catch (ClassNotFoundException e) {
FRLogger.getLogger().error(e.getMessage());
} catch (IllegalAccessException e) {
FRLogger.getLogger().error(e.getMessage());
} catch (InstantiationException e) {
FRLogger.getLogger().error(e.getMessage());
List<UpdateActionModel> updateActions = UpdateActionManager.getUpdateActionManager().getUpdateActions();
for (UpdateActionModel updateActionModel : updateActions) {
if (ComparatorUtils.equals(actionName, updateActionModel.getClassName())) {
return new ActionModel(updateActionModel.getActionName(), updateActionModel.getParentName(), updateActionModel.getAction());
}
}
return new ActionModel(name, action);
return null;
}
}

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

@ -3,7 +3,7 @@ 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.cell.CellModelHelper;
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.design.mainframe.alphafine.model.SearchResult;
@ -38,11 +38,11 @@ public class RecentSearchManager extends XMLFileManager implements AlphaFineSear
private static final int MAX_SIZE = 3;
private static RecentSearchManager recentSearchManager = null;
private static File recentFile = null;
private List<String> fileList;
private List<String> actionList;
private List<String> documentList;
private SearchResult modelList;
private List<String> pluginList;
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<>();
@ -95,17 +95,73 @@ public class RecentSearchManager extends XMLFileManager implements AlphaFineSear
}
}
private void addModelToList(List<AlphaCellModel> list, String name) {
try {
AlphaCellModel model = CellModelHelper.getModelFromJson(new JSONObject(name));
AlphaCellModel model = getModelFromJson(new JSONObject(name));
if (model != null) {
list.add(CellModelHelper.getModelFromJson(new JSONObject(name)));
list.add(model);
}
} catch (JSONException e) {
FRLogger.getLogger().error(e.getMessage());
}
}
/**
* 转成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) {
writer.startTAG(XML_TAG);
@ -135,37 +191,7 @@ public class RecentSearchManager extends XMLFileManager implements AlphaFineSear
return "alphafine_recent.xml";
}
public List<String> getFileList() {
return fileList;
}
public void setFileList(List<String> fileList) {
this.fileList = fileList;
}
public List<String> getActionList() {
return actionList;
}
public void setActionList(List<String> actionList) {
this.actionList = actionList;
}
public List<String> getDocumentList() {
return documentList;
}
public void setDocumentList(List<String> documentList) {
this.documentList = documentList;
}
public List<String> getPluginList() {
return pluginList;
}
public void setPluginList(List<String> pluginList) {
this.pluginList = pluginList;
}
/**
* 获取xml

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

@ -47,7 +47,7 @@ public class RecommendSearchManager implements AlphaFineSearchProcessor {
if (jsonArray != null && jsonArray.length() > 0) {
for (int i = 0; i < jsonArray.length(); i++) {
AlphaCellModel alphaCellModel = CellModelHelper.getModelFromJson((JSONObject) jsonArray.get(i));
if (!RecentSearchManager.getRecentSearchManger().getRecentModelList().contains(alphaCellModel)) {
if (alphaCellModel != null && !RecentSearchManager.getRecentSearchManger().getRecentModelList().contains(alphaCellModel)) {
this.modelList.add(alphaCellModel);
}
}

8
designer/src/com/fr/design/webattr/EditReportServerParameterPane.java

@ -4,6 +4,7 @@
package com.fr.design.webattr;
import com.fr.base.ConfigManager;
import com.fr.base.ConfigManagerProvider;
import com.fr.base.FRContext;
import com.fr.design.gui.frpane.LoadingBasicPane;
import com.fr.design.gui.frpane.UITabbedPane;
@ -12,7 +13,6 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter;
import com.fr.base.ConfigManagerProvider;
import com.fr.stable.project.ProjectConstants;
import com.fr.web.attr.ReportWebAttr;
@ -33,17 +33,17 @@ public class EditReportServerParameterPane extends LoadingBasicPane {
//TODO 表单
// private FormToolBarPane formPane;
private WriteToolBarPane writePane;
private ReportWebAttr webAttr ;
private ReportWebAttr webAttr;
private WebCssPane cssPane;
private WebJsPane jsPane;
private ErrorTemplatePane errorTemplatePane;
@Override
protected void initComponents(JPanel container) {
protected synchronized void initComponents(JPanel container) {
JPanel defaultPane = container;
defaultPane.setLayout(FRGUIPaneFactory.createBorderLayout());

11
designer/src/com/fr/design/webattr/ReportWebAttrPane.java

@ -3,18 +3,17 @@
*/
package com.fr.design.webattr;
import java.awt.BorderLayout;
import javax.swing.JPanel;
import com.fr.design.gui.frpane.LoadingBasicPane;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.style.background.BackgroundPane;
import com.fr.design.style.background.BackgroundPane4Browser;
import com.fr.general.Inter;
import com.fr.design.style.background.BackgroundPane;
import com.fr.web.attr.ReportWebAttr;
import javax.swing.*;
import java.awt.*;
/**
* ReportWebAttr Dialog
*/
@ -37,7 +36,7 @@ public class ReportWebAttrPane extends LoadingBasicPane {
@Override
protected void initComponents(JPanel container) {
protected synchronized void initComponents(JPanel container) {
JPanel defaultPane = container;
defaultPane.setLayout(FRGUIPaneFactory.createBorderLayout());

2
designer/src/com/fr/design/webattr/ReportWriteAttrPane.java

@ -25,7 +25,7 @@ public class ReportWriteAttrPane extends LoadingBasicPane {
}
@Override
protected void initComponents(JPanel container) {
protected synchronized void initComponents(JPanel container) {
container.setLayout(FRGUIPaneFactory.createBorderLayout());
final UITabbedPane tabbedPane = new UITabbedPane(SwingConstants.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
container.add(tabbedPane, BorderLayout.CENTER);

119
designer_base/src/com/fr/design/actions/UpdateAction.java

@ -6,19 +6,22 @@ package com.fr.design.actions;
import com.fr.base.NameStyle;
import com.fr.base.ScreenResolution;
import com.fr.base.Style;
import com.fr.design.constants.UIConstants;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.imenu.UICheckBoxMenuItem;
import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.menu.ShortCut;
import com.fr.design.selection.SelectionListener;
import com.fr.stable.StringUtils;
import com.fr.stable.pinyin.PinyinFormat;
import com.fr.stable.pinyin.PinyinHelper;
import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.border.TitledBorder;
import java.awt.*;
import java.awt.event.ComponentEvent;
import java.awt.event.ContainerEvent;
import java.beans.PropertyChangeListener;
import java.util.HashMap;
import java.util.Iterator;
@ -50,6 +53,10 @@ public abstract class UpdateAction extends ShortCut implements Action {
*/
private Map<String, Object> componentMap;
private String searchText = StringUtils.EMPTY;
/**
* Constructor
*/
@ -426,4 +433,112 @@ public abstract class UpdateAction extends ShortCut implements Action {
return menuItem;
}
public void setSearchText(JPanel panel) {
this.searchText = getComponentTexts(panel, "_", new StringBuffer(), new StringBuffer(), new StringBuffer());
}
/**
* 获取搜索匹配字符串
* @return
*/
public String getSearchText() {
return searchText;
}
/**
* 遍历面板中所有控件,获取text用于alphafine的action搜索,考虑分词拼音首字母检索
* @param panel
* @param separator
* @param text
* @param pinyin
* @param shortPinyin
* @return
*/
public String getComponentTexts(JPanel panel, String separator, StringBuffer text, StringBuffer pinyin, StringBuffer shortPinyin) {
Border border = panel.getBorder();
if (border instanceof TitledBorder) {
String title = ((TitledBorder) border).getTitle();
text.append(title).append(separator);
pinyin.append(PinyinHelper.convertToPinyinString(title, "", PinyinFormat.WITHOUT_TONE)).append(separator);
shortPinyin.append(PinyinHelper.getShortPinyin(title)).append(separator);
}
Component[] components = panel.getComponents();
for (Component component : components) {
if (component instanceof JPanel) {
getComponentTexts((JPanel) component, separator, text, pinyin, shortPinyin);
} else if (component instanceof JScrollPane) {
Component childComponent = ((JScrollPane) component).getViewport().getView();
if (childComponent instanceof JPanel) {
getComponentTexts((JPanel) childComponent, separator, text, pinyin, shortPinyin);
}
} else if (component instanceof JLabel) {
String title = ((JLabel) component).getText();
handleSearchText(separator, text, pinyin, shortPinyin, title);
} else if (component instanceof JCheckBox) {
String title = ((JCheckBox) component).getText();
handleSearchText(separator, text, pinyin, shortPinyin, title);
} else if (component instanceof JButton) {
String title = ((JButton) component).getText();
handleSearchText(separator, text, pinyin, shortPinyin, title);
} else if (component instanceof JRadioButton) {
String title = ((JRadioButton) component).getText();
handleSearchText(separator, text, pinyin, shortPinyin, title);
} else if (component instanceof JComboBox) {
for (int i = 0; i < ((JComboBox) component).getItemCount(); i++) {
text.append(((JComboBox) component).getItemAt(i));
String title = String.valueOf(((JComboBox) component).getItemAt(i));
handleSearchText(separator, text, pinyin, shortPinyin, title);
}
} else if (component instanceof JTabbedPane) {
getTabPaneTexts((JTabbedPane) component, separator, text, pinyin, shortPinyin);
}
}
return String.valueOf(text.append(pinyin).append(shortPinyin));
}
/**
* 递归遍历tabbedPane
* @param component
* @param separator
* @param text
* @param pinyin
* @param shortPinyin
*/
private synchronized void getTabPaneTexts(JTabbedPane component, String separator, StringBuffer text, StringBuffer pinyin, StringBuffer shortPinyin) {
for (int i = 0; i < component.getTabCount(); i++) {
String title = component.getTitleAt(i);
handleSearchText(separator, text, pinyin, shortPinyin, title);
Component tabComponent = component.getComponentAt(i);
if (tabComponent instanceof JPanel) {
getComponentTexts((JPanel) tabComponent, separator, text, pinyin, shortPinyin);
} else if (tabComponent instanceof JTabbedPane) {
getTabPaneTexts((JTabbedPane) tabComponent, separator, text, pinyin, shortPinyin);
}
}
}
/**
* 将text,pinyin,pinyin首字母拼接到一起
* @param separator
* @param text
* @param pinyin
* @param shortPinyin
* @param title
*/
private void handleSearchText(String separator, StringBuffer text, StringBuffer pinyin, StringBuffer shortPinyin, String title) {
if (StringUtils.isBlank(title)) {
return;
}
text.append(title).append(separator);
pinyin.append(PinyinHelper.convertToPinyinString(title, "", PinyinFormat.WITHOUT_TONE));
shortPinyin.append(PinyinHelper.getShortPinyin(title)).append(separator);
}
}

56
designer_base/src/com/fr/design/actions/file/PreferenceAction.java

@ -1,47 +1,49 @@
package com.fr.design.actions.file;
import java.awt.event.ActionEvent;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import java.awt.event.ActionEvent;
public class PreferenceAction extends UpdateAction {
public PreferenceAction() {
public PreferenceAction() {
this.setMenuKeySet(KeySetUtils.PREFERENCE);
this.setName(getMenuKeySet().getMenuKeySetName()+"...");
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
}
this.setSearchText(new PreferencePane());
}
/**
* 动作
*
* @param e 事件
*/
public void actionPerformed(ActionEvent e) {
final DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
final PreferencePane preferencePane = new PreferencePane();
preferencePane.populate(DesignerEnvManager.getEnvManager());
BasicDialog basicDialog = preferencePane.showWindow(designerFrame);
basicDialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() {
preferencePane.update(DesignerEnvManager.getEnvManager());
DesignerEnvManager.loadLogSetting();
DesignerEnvManager.getEnvManager().saveXMLFile();
JTemplate jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
jt.refreshToolArea();
preferencePane.showRestartDialog();
}
});
basicDialog.setVisible(true);
}
public void actionPerformed(ActionEvent e) {
final DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
final PreferencePane preferencePane = new PreferencePane();
preferencePane.populate(DesignerEnvManager.getEnvManager());
BasicDialog basicDialog = preferencePane.showWindow(designerFrame);
basicDialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() {
preferencePane.update(DesignerEnvManager.getEnvManager());
DesignerEnvManager.loadLogSetting();
DesignerEnvManager.getEnvManager().saveXMLFile();
JTemplate jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
jt.refreshToolArea();
preferencePane.showRestartDialog();
}
});
basicDialog.setVisible(true);
}
}

3
designer_base/src/com/fr/design/actions/help/AboutAction.java

@ -47,4 +47,7 @@ public class AboutAction extends UpdateAction {
return null;
}
};
}

4
designer_base/src/com/fr/design/actions/help/alphafine/AlphafineAction.java

@ -9,6 +9,7 @@ import com.fr.design.dialog.DialogActionListener;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.IOUtils;
import javax.swing.*;
import java.awt.event.ActionEvent;
@ -21,7 +22,8 @@ public class AlphafineAction extends UpdateAction {
this.setMenuKeySet(ALPHAFINE);
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.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());
}
public static final MenuKeySet ALPHAFINE = new MenuKeySet() {

1
designer_base/src/com/fr/design/actions/help/alphafine/AlphafineConfigManager.java

@ -95,6 +95,7 @@ public class AlphafineConfigManager implements XMLable {
public void readXML(XMLableReader reader) {
if (reader.isAttr()) {
this.setEnabled(reader.getAttrAsBoolean("isEnabled", true));
this.setSearchOnLine(reader.getAttrAsBoolean("isSearchOnline", true));
this.setContainPlugin(reader.getAttrAsBoolean("isContainDocument", true));
this.setContainDocument(reader.getAttrAsBoolean("isContainDocument", true));
this.setContainRecommend(reader.getAttrAsBoolean("isContainRecommend", true));

6
designer_base/src/com/fr/design/actions/server/ConnectionListAction.java

@ -1,6 +1,5 @@
package com.fr.design.actions.server;
import com.fr.base.BaseUtils;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.base.ModifiedTable;
@ -9,6 +8,7 @@ import com.fr.dav.LocalEnv;
import com.fr.design.actions.UpdateAction;
import com.fr.design.data.datapane.connect.ConnectionManagerPane;
import com.fr.design.data.datapane.connect.ConnectionShowPane;
import com.fr.design.data.datapane.connect.DatabaseConnectionPane;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.DesignerContext;
@ -16,6 +16,7 @@ import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.menu.MenuKeySet;
import com.fr.file.DatasourceManager;
import com.fr.file.DatasourceManagerProvider;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import javax.swing.*;
@ -31,7 +32,8 @@ public class ConnectionListAction extends UpdateAction {
this.setMenuKeySet(DEFINE_DATA_CONNECTION);
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_web/connection.png"));
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_web/connection.png"));
this.setSearchText(new DatabaseConnectionPane.JDBC());
}
public static final MenuKeySet DEFINE_DATA_CONNECTION = new MenuKeySet() {

4
designer_base/src/com/fr/design/actions/server/FunctionManagerAction.java

@ -14,6 +14,7 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.design.menu.MenuKeySet;
import com.fr.file.FunctionManager;
import com.fr.file.FunctionManagerProvider;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import javax.swing.*;
@ -28,7 +29,8 @@ public class FunctionManagerAction extends UpdateAction {
this.setMenuKeySet(FUNCTION_MANAGER);
this.setName(getMenuKeySet().getMenuKeySetName()+"...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_web/function.png"));
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_web/function.png"));
this.setSearchText(new FunctionManagerPane());
}
/**

26
designer_base/src/com/fr/design/gui/frpane/LoadingBasicPane.java

@ -3,19 +3,14 @@
*/
package com.fr.design.gui.frpane;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.SwingConstants;
import javax.swing.SwingWorker;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicPane;
import com.fr.general.Inter;
import com.fr.design.utils.gui.LayoutUtils;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
* @author richer
@ -46,6 +41,7 @@ public abstract class LoadingBasicPane extends BasicPane {
}.execute();
}
private void initCards() {
card = new CardLayout();
setLayout(card);
@ -74,6 +70,16 @@ public abstract class LoadingBasicPane extends BasicPane {
}
/**
* 为了alphafine搜索使用预加载面板控件获取全部控件的信息
* @return
*/
public JPanel getAllComponents() {
JPanel panel = new JPanel();
initComponents(panel);
return panel;
}
/**
* 完成时
*/

5
designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -166,14 +166,13 @@ public abstract class ToolBarMenuDock {
* @param menuDef
*/
private void addUpdateActionToList(MenuDef menuDef) {
String ParentName = menuDef.getName();
if (menuDef instanceof OpenRecentReportMenuDef) {
return;
}
String parentName = menuDef.getName();
for (ShortCut shortCut : menuDef.getShortcutList()) {
if (shortCut instanceof UpdateAction) {
shortCutsList.add(new UpdateActionModel(ParentName, (UpdateAction) shortCut));
shortCutsList.add(new UpdateActionModel(parentName, (UpdateAction) shortCut));
} else if (shortCut instanceof MenuDef) {
addUpdateActionToList((MenuDef) shortCut);
}

39
designer_base/src/com/fr/design/mainframe/toolbar/UpdateActionModel.java

@ -1,6 +1,8 @@
package com.fr.design.mainframe.toolbar;
import com.fr.design.actions.UpdateAction;
import com.fr.stable.pinyin.PinyinFormat;
import com.fr.stable.pinyin.PinyinHelper;
/**
* Created by XiaXiang on 2017/5/24.
@ -10,14 +12,35 @@ import com.fr.design.actions.UpdateAction;
* action对象
*/
public class UpdateActionModel {
private static final String SEPARATOR = "/";
private String parentName;
private String actionName;
private String className;
private String searchKey;
private UpdateAction action;
public UpdateActionModel(String parentName, UpdateAction action) {
this.parentName = parentName;
this.action = action;
this.actionName = action.getName();
setSearchKey(parentName, action);
}
/**
* 获取搜索关键字包括上级菜单名菜单名以及对应打开面板的所有文字信息使其能够支持模糊搜索
* @param parentName
* @param action
*/
private void setSearchKey(String parentName, UpdateAction action) {
StringBuffer buffer = new StringBuffer();
if (actionName == null) {
return;
}
buffer.append(parentName).append(SEPARATOR).append(PinyinHelper.convertToPinyinString(parentName, "", PinyinFormat.WITHOUT_TONE))
.append(SEPARATOR).append(PinyinHelper.getShortPinyin(parentName)).append(SEPARATOR)
.append(actionName).append(SEPARATOR).append(PinyinHelper.convertToPinyinString(actionName, "", PinyinFormat.WITHOUT_TONE))
.append(SEPARATOR).append(PinyinHelper.getShortPinyin(actionName)).append(action.getSearchText());
this.searchKey = buffer.toString();
}
/**
@ -55,4 +78,20 @@ public class UpdateActionModel {
public void setActionName(String actionName) {
this.actionName = actionName;
}
public String getSearchKey() {
return searchKey;
}
public void setSearchKey(String searchKey) {
this.searchKey = searchKey;
}
public String getClassName() {
return getAction().getClass().getName();
}
public void setClassName(String className) {
this.className = className;
}
}

4
designer_chart/src/com/fr/design/module/ChartPreStyleAction.java

@ -9,6 +9,7 @@ import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import javax.swing.*;
@ -25,7 +26,8 @@ public class ChartPreStyleAction extends UpdateAction {
this.setMenuKeySet(CHART_DEFAULT_STYLE);
this.setName(getMenuKeySet().getMenuKeySetName()+ "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("com/fr/design/images/chart/ChartType.png"));
this.setSmallIcon(IOUtils.readIcon("com/fr/design/images/chart/ChartType.png"));
this.setSearchText(new ChartPreStyleManagerPane());
}
/**

Loading…
Cancel
Save