Browse Source

alphafine 设置的面板内容搜索

master
XiaXiang 8 years ago
parent
commit
cd0e098e43
  1. 7
      designer/src/com/fr/design/actions/report/ReportEngineAttrAction.java
  2. 5
      designer/src/com/fr/design/actions/report/ReportExportAttrAction.java
  3. 4
      designer/src/com/fr/design/actions/report/ReportMobileAttrAction.java
  4. 4
      designer/src/com/fr/design/actions/report/ReportPageAttrAction.java
  5. 4
      designer/src/com/fr/design/actions/report/ReportPageSetupAction.java
  6. 4
      designer/src/com/fr/design/actions/report/ReportWebAttrAction.java
  7. 4
      designer/src/com/fr/design/actions/report/ReportWriteAttrAction.java
  8. 4
      designer/src/com/fr/design/actions/server/ServerConfigManagerAction.java
  9. 4
      designer/src/com/fr/design/actions/server/StyleListAction.java
  10. 79
      designer_base/src/com/fr/design/actions/UpdateAction.java
  11. 12
      designer_base/src/com/fr/design/actions/file/PreferenceAction.java
  12. 8
      designer_base/src/com/fr/design/actions/help/AboutAction.java
  13. 4
      designer_base/src/com/fr/design/actions/help/alphafine/AlphafineAction.java
  14. 4
      designer_base/src/com/fr/design/actions/server/FunctionManagerAction.java
  15. 7
      designer_base/src/com/fr/design/gui/frpane/LoadingBasicPane.java
  16. 19
      designer_base/src/com/fr/design/mainframe/toolbar/UpdateActionModel.java
  17. 4
      designer_chart/src/com/fr/design/module/ChartPreStyleAction.java

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

@ -8,6 +8,7 @@ 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 +18,11 @@ 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"));
WorkSheetDesigner jws = getEditingComponent();
if (jws != null) {
this.setSearchText(new LayerReportPane(jws.getTemplateReport()));
}
}
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());
}
/**

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

@ -13,6 +13,7 @@ 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;
/**
@ -27,7 +28,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());
}
/**

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

@ -14,6 +14,7 @@ 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;
@ -29,7 +30,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());
}
/**

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

@ -6,9 +6,11 @@ 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.report.LayerReportPane;
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 +22,7 @@ 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"));
}
// ben:用来判断是否update

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

@ -13,6 +13,7 @@ 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;
@ -27,7 +28,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());
}
/**

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());
}
/**

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

@ -8,14 +8,18 @@ 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.gui.frpane.LoadingBasicPane;
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 org.apache.batik.apps.svgbrowser.JPEGOptionPanel;
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;
@ -50,6 +54,8 @@ public abstract class UpdateAction extends ShortCut implements Action {
*/
private Map<String, Object> componentMap;
private String searchText = StringUtils.EMPTY;
/**
* Constructor
*/
@ -426,4 +432,77 @@ public abstract class UpdateAction extends ShortCut implements Action {
return menuItem;
}
public void setSearchText(JPanel panel) {
if (panel instanceof LoadingBasicPane) {
((LoadingBasicPane) panel).initForSearch();
}
this.searchText = getComponentTexts(panel, new StringBuffer());
}
/**
* 获取搜索匹配字符串
* @return
*/
public String getSearchText() {
return searchText;
}
/**
* 遍历面板中所有控件,获取text用于alphafine的action搜索
* @param panel
* @param stringBuffer
* @return
*/
public String getComponentTexts(JPanel panel, StringBuffer stringBuffer) {
Border border = panel.getBorder();
if (border instanceof TitledBorder) {
stringBuffer.append(((TitledBorder) border).getTitle());
}
Component[] components = panel.getComponents();
for (Component component : components) {
if (component instanceof JPanel) {
getComponentTexts((JPanel) component, stringBuffer);
} else if (component instanceof JScrollPane) {
Component childComponent = ((JScrollPane) component).getViewport().getView();
if (childComponent instanceof JPanel) {
getComponentTexts((JPanel) childComponent, stringBuffer);
}
} else if (component instanceof JLabel) {
stringBuffer.append(((JLabel) component).getText());
} else if (component instanceof JCheckBox) {
stringBuffer.append(((JCheckBox) component).getText());
} else if (component instanceof JButton) {
stringBuffer.append(((JButton) component).getText());
} else if (component instanceof JRadioButton) {
stringBuffer.append(((JRadioButton) component).getText());
} else if (component instanceof JComboBox) {
for (int i = 0; i < ((JComboBox) component).getItemCount(); i++) {
stringBuffer.append(((JComboBox) component).getItemAt(i));
}
} else if (component instanceof JTabbedPane) {
getTabPaneTexts(stringBuffer, (JTabbedPane) component);
}
}
return String.valueOf(stringBuffer);
}
/**
* 递归遍历tabbedPane
* @param stringBuffer
* @param component
*/
private void getTabPaneTexts(StringBuffer stringBuffer, JTabbedPane component) {
for (int i = 0; i < component.getTabCount(); i++) {
stringBuffer.append(component.getTitleAt(i));
Component tabComponent = component.getComponentAt(i);
if (tabComponent instanceof JPanel) {
getComponentTexts((JPanel) tabComponent, stringBuffer);
} else if (tabComponent instanceof JTabbedPane) {
getTabPaneTexts(stringBuffer, (JTabbedPane) tabComponent);
}
}
}
}

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

@ -1,27 +1,29 @@
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() {
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) {

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

@ -7,8 +7,12 @@ import com.fr.design.actions.UpdateAction;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import org.eclipse.swt.internal.ole.win32.COM;
import javax.imageio.plugins.jpeg.JPEGHuffmanTable;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
/**
@ -19,6 +23,7 @@ public class AboutAction extends UpdateAction {
this.setMenuKeySet(ABOUT);
this.setName(getMenuKeySet().getMenuKeySetName()+"...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSearchText(new AboutPane());
}
/**
@ -47,4 +52,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() {

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());
}
/**

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

@ -74,6 +74,13 @@ public abstract class LoadingBasicPane extends BasicPane {
}
/**
* 为了alphafine搜索需要初始化的时候加载一次组件
*/
public void initForSearch() {
initComponents(new JPanel());
}
/**
* 完成时
*/

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

@ -12,12 +12,15 @@ import com.fr.design.actions.UpdateAction;
public class UpdateActionModel {
private String parentName;
private String actionName;
private String relatedKey;
private String searchKey;
private UpdateAction action;
public UpdateActionModel(String parentName, UpdateAction action) {
this.parentName = parentName;
this.action = action;
this.actionName = action.getName();
this.searchKey = action.getSearchText();
}
/**
@ -55,4 +58,20 @@ public class UpdateActionModel {
public void setActionName(String actionName) {
this.actionName = actionName;
}
public String getRelatedKey() {
return relatedKey;
}
public void setRelatedKey(String relatedKey) {
this.relatedKey = relatedKey;
}
public String getSearchKey() {
return searchKey;
}
public void setSearchKey(String searchKey) {
this.searchKey = searchKey;
}
}

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