diff --git a/designer-base/src/main/java/com/fr/start/server/ServerTray.java b/designer-base/src/main/java/com/fr/start/server/ServerTray.java index ce2da0407d..01cfc53fc6 100644 --- a/designer-base/src/main/java/com/fr/start/server/ServerTray.java +++ b/designer-base/src/main/java/com/fr/start/server/ServerTray.java @@ -17,32 +17,32 @@ import java.awt.event.MouseEvent; * Create server tray. */ public class ServerTray { - + private static ServerTray INSTANCE; - + private MenuItem startMenu; - + private MenuItem stopMenu; - + private Image trayStartedImage = BaseUtils.readImage("/com/fr/base/images/oem/trayStarted.png"); - + private Image trayStoppedImage = BaseUtils.readImage("/com/fr/base/images/oem/trayStopped.png"); - + private ServerManageFrame serverManageFrame; - + private TrayIcon trayIcon; - - + + private ServerTray() { - + listen(); //p:首先构建右键菜单 PopupMenu popup = new PopupMenu(); MenuItem manangeMenu = new MenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Open_Service_Manager")); manangeMenu.addActionListener(new ActionListener() { - + public void actionPerformed(ActionEvent e) { - + serverManageFrame = ServerManageFrame.getServerManageFrame(); if (!serverManageFrame.isVisible()) { serverManageFrame.setVisible(true); @@ -55,9 +55,9 @@ public class ServerTray { MenuItem exitMenu = new MenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Exit")); //创建打开监听器 ActionListener startListener = new ActionListener() { - + public void actionPerformed(ActionEvent e) { - + try { FineEmbedServer.start(); } catch (Exception exp) { @@ -66,9 +66,9 @@ public class ServerTray { } }; ActionListener stopListener = new ActionListener() { - + public void actionPerformed(ActionEvent e) { - + try { FineEmbedServer.stop(); } catch (Throwable exp) { @@ -80,13 +80,13 @@ public class ServerTray { stopMenu.addActionListener(stopListener); //创建退出菜单监听器 ActionListener exitListener = new ActionListener() { - + public void actionPerformed(ActionEvent e) { - + exit(); } }; - + exitMenu.addActionListener(exitListener); popup.add(manangeMenu); popup.addSeparator(); @@ -94,18 +94,18 @@ public class ServerTray { popup.add(stopMenu); popup.addSeparator(); popup.add(exitMenu); - + //p:开始创建托盘. trayIcon = new TrayIcon(trayStartedImage, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Embedded_Server"), popup); trayIcon.setImageAutoSize(true); trayIcon.addMouseListener(new MouseAdapter() { - + public void mouseClicked(MouseEvent e) { - + if (e.getClickCount() < 2) { return; } - + ServerManageFrame serverManageFrame = ServerManageFrame.getServerManageFrame(); if (!serverManageFrame.isVisible()) { serverManageFrame.setVisible(true); @@ -113,56 +113,56 @@ public class ServerTray { serverManageFrame.toFront();//p:到第一个. } }); - + TrayIcon[] icons = SystemTray.getSystemTray().getTrayIcons(); for (TrayIcon icon : icons) { SystemTray.getSystemTray().remove(icon); } - + try { SystemTray.getSystemTray().add(trayIcon); } catch (AWTException e) { System.err.println("Can not create the System Tray:" + e); } - + checkPopupMenuItemEnabled(); } - + private void listen() { - + ListenerAdaptor listenerAdaptor = new ListenerAdaptor() { - + @Override protected void on(Event event) { - + checkPopupMenuItemEnabled(); } }; EventDispatcher.listen(EmbedServerEvent.AfterStart, listenerAdaptor); EventDispatcher.listen(EmbedServerEvent.AfterStop, listenerAdaptor); } - + private void exit() { - + FineEmbedServer.stop(); SystemTray.getSystemTray().remove(trayIcon); } - + private void checkPopupMenuItemEnabled() { - + try { if (FineEmbedServer.isRunning()) { startMenu.setEnabled(false); stopMenu.setEnabled(true); - + trayIcon.setImage(trayStartedImage); } else { startMenu.setEnabled(true); stopMenu.setEnabled(false); - + trayIcon.setImage(trayStoppedImage); } - + if (serverManageFrame != null) { serverManageFrame.checkButtonEnabled(); serverManageFrame.repaint(); @@ -171,10 +171,9 @@ public class ServerTray { FRContext.getLogger().error(exp.getMessage(), exp); } } - + public static void init() { - - INSTANCE = new ServerTray(); - + if (INSTANCE == null) + INSTANCE = new ServerTray(); } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/AbstractTableDataContentPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/AbstractTableDataContentPane.java index 75c7f47b8f..df5d99fbdb 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/AbstractTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/AbstractTableDataContentPane.java @@ -5,8 +5,8 @@ import com.fr.design.beans.BasicBeanPane; import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.design.gui.icombobox.UIComboBox; -import javax.swing.*; -import java.awt.*; +import javax.swing.JSeparator; +import java.awt.Dimension; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.util.List; @@ -47,31 +47,16 @@ public abstract class AbstractTableDataContentPane extends BasicBeanPane list = new ArrayList(); for (int i = 0; i < chartSummaryColumnArray.length; i++) { ChartSummaryColumn column = chartSummaryColumnArray[i]; - String[] nameArray = {column.getName(), column.getCustomName(), getFunctionString(column.getFunction())}; + String[] nameArray = {column.getName(), column.getCustomName(), DataPaneHelper.getFunctionString(column.getFunction())}; list.add(nameArray); } seriesDataPane.populateBean(list); @@ -212,16 +212,6 @@ public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane extends AbstractReportDataContentPane { + private TinyFormulaPane seriesPane; + private TinyFormulaPane valuePane; + public AbstractExtendedChartReportDataPane() { initComponents(); } @@ -30,23 +35,38 @@ public abstract class AbstractExtendedChartReportDataPane fieldList = new ArrayList(); + if (hasCustomFieldPane()) { + fieldList.add(new ExtendedField(seriesPane.updateBean())); + fieldList.add(new ExtendedField(valuePane.updateBean())); + } + dataConfig.setCustomFields(fieldList); chart.setFilterDefinition(dataSet); } diff --git a/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java b/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java index ab61de5d1d..19a7b8e16b 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java @@ -11,11 +11,11 @@ import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.general.GeneralUtils; +import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.SwingConstants; import java.awt.BorderLayout; import java.awt.Component; -import java.awt.Dimension; import java.util.Arrays; import java.util.List; @@ -24,7 +24,7 @@ import java.util.List; */ public abstract class AbstractExtendedChartTableDataPane extends AbstractTableDataContentPane { - private CalculateComboBox function; + private ExtendedCustomFieldComboBoxPane customFieldComboBoxPane; public AbstractExtendedChartTableDataPane() { initComponents(); @@ -37,28 +37,27 @@ public abstract class AbstractExtendedChartTableDataPane { + private static final String[] HEADS = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Field_Name"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Summary_Method")}; + + private UseFieldValuePane useFieldValuePane; + private CustomFieldNamePane customFieldNamePane; + + private List fieldList = new ArrayList(); + + @Override + protected void initLayout() { + this.setLayout(new BorderLayout(0, 6)); + JPanel northPane = new JPanel(new BorderLayout()); + northPane.add(jcb, BorderLayout.CENTER); + UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name_From")); + label.setPreferredSize(new Dimension(82, 20)); + northPane.add(label, BorderLayout.WEST); + this.add(northPane, BorderLayout.NORTH); + this.add(cardPane, BorderLayout.CENTER); + } + + @Override + protected List> initPaneList() { + useFieldValuePane = new UseFieldValuePane(); + customFieldNamePane = new CustomFieldNamePane(); + List> list = new ArrayList>(); + list.add(useFieldValuePane); + list.add(customFieldNamePane); + return list; + } + + @Override + protected String title4PopupWindow() { + return StringUtils.EMPTY; + } + + public void checkBoxUse(boolean hasUse) { + jcb.setEnabled(hasUse); + useFieldValuePane.checkBoxUse(hasUse); + } + + public void clearAllBoxList() { + useFieldValuePane.clearAllBoxList(); + fieldList.clear(); + } + + protected void refreshBoxListWithSelectTableData(List columnNameList) { + useFieldValuePane.refreshBoxListWithSelectTableData(columnNameList); + fieldList = columnNameList; + } + + @Override + public void populateBean(AbstractDataConfig ob) { + if (ob.isCustomName()) { + customFieldNamePane.populateBean(ob); + jcb.setSelectedIndex(1); + } else { + useFieldValuePane.populateBean(ob); + jcb.setSelectedIndex(0); + } + } + + @Override + public void updateBean(AbstractDataConfig ob) { + if (jcb.getSelectedIndex() == 0) { + ob.setCustomName(false); + useFieldValuePane.updateBean(ob); + } else { + ob.setCustomName(true); + customFieldNamePane.updateBean(ob); + } + } + + private class UseFieldValuePane extends FurtherBasicBeanPane { + private UIComboBox series; + private UIComboBox value; + private CalculateComboBox function; + + private UseFieldValuePane() { + initComponents(); + } + + private void initComponents() { + + series = new UIComboBox(); + value = new UIComboBox(); + function = new CalculateComboBox(); + + Component[][] components = new Component[][]{ + new Component[]{new UILabel(HEADS[1], SwingConstants.LEFT), series}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Value"), SwingConstants.LEFT), value}, + new Component[]{new UILabel(HEADS[2], SwingConstants.LEFT), function}, + }; + + double p = TableLayout.PREFERRED; + double[] columnSize = {76, 120}; + double[] rowSize = {p, p, p}; + + JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + + this.setLayout(new BorderLayout(0, 6)); + this.add(panel, BorderLayout.CENTER); + } + + public void checkBoxUse(boolean hasUse) { + series.setEnabled(hasUse); + value.setEnabled(hasUse); + function.setEnabled(hasUse); + } + + public void clearAllBoxList() { + DataPaneHelper.clearBoxItems(series); + DataPaneHelper.clearBoxItems(value); + } + + public void refreshBoxListWithSelectTableData(List columnNameList) { + DataPaneHelper.refreshBoxItems(series, columnNameList); + DataPaneHelper.refreshBoxItems(value, columnNameList); + } + + @Override + public void populateBean(AbstractDataConfig ob) { + List list = ob.getCustomFields(); + if (list.size() == 2) { + series.setSelectedItem(list.get(0).getFieldName()); + value.setSelectedItem(list.get(1).getFieldName()); + function.populateBean((AbstractDataFunction) list.get(1).getDataFunction()); + } + } + + @Override + public void updateBean(AbstractDataConfig ob) { + List list = new ArrayList(); + + list.add(new ExtendedField(Utils.objectToString(series.getSelectedItem()))); + ExtendedField field = new ExtendedField(Utils.objectToString(value.getSelectedItem())); + field.setDataFunction(function.updateBean()); + list.add(field); + + ob.setCustomFields(list); + } + + @Override + public boolean accept(Object ob) { + return true; + } + + @Override + public void reset() { + } + + @Override + public String title4PopupWindow() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Enable_Field_Value"); + } + + @Override + public AbstractDataConfig updateBean() { + return null; + } + } + + private class CustomFieldNamePane extends FurtherBasicBeanPane { + + private UICorrelationPane correlationPane; + + public CustomFieldNamePane() { + initComponents(); + } + + private void initComponents() { + + correlationPane = new UICorrelationPane(HEADS) { + @Override + protected ActionListener getAddButtonListener() { + return new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + tablePane.addLine(new String[]{StringUtils.EMPTY, StringUtils.EMPTY, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None")}); + fireTargetChanged(); + } + }; + } + + public UITableEditor createUITableEditor() { + return new Editor() { + @Override + protected UICorrelationPane getParent() { + return correlationPane; + } + }; + } + }; + + this.setLayout(new BorderLayout()); + this.add(correlationPane, BorderLayout.CENTER); + + } + + @Override + public void populateBean(AbstractDataConfig ob) { + List customFields = ob.getCustomFields(); + + List list = new ArrayList(); + for (ExtendedField field : customFields) { + String[] array = {field.getFieldName(), field.getCustomName(), DataPaneHelper.getFunctionString(field.getDataFunction())}; + list.add(array); + } + correlationPane.populateBean(list); + } + + + @Override + public void updateBean(AbstractDataConfig ob) { + List list = correlationPane.updateBean(); + + List customFields = new ArrayList(); + for (Object[] line : list) { + ExtendedField field = new ExtendedField(Utils.objectToString(line[0])); + field.setCustomName(Utils.objectToString(line[1])); + if (line.length > 2) { + field.setDataFunction(DataPaneHelper.getFunctionByName(Utils.objectToString(line[2]))); + } + customFields.add(field); + } + + ob.setCustomFields(customFields); + + } + + @Override + public boolean accept(Object ob) { + return true; + } + + @Override + public void reset() { + } + + @Override + public String title4PopupWindow() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Enable_Field_Name"); + } + + @Override + public AbstractDataConfig updateBean() { + return null; + } + } + + private abstract class Editor extends UITableEditor { + private JComponent editorComponent; + + protected abstract UICorrelationPane getParent(); + + @Override + public Object getCellEditorValue() { + if (editorComponent instanceof UIComboBox) { + return ((UIComboBox) editorComponent).getSelectedItem(); + } else if (editorComponent instanceof UITextField) { + return ((UITextField) editorComponent).getText(); + } else if (editorComponent instanceof CalculateComboBox) { + return ((CalculateComboBox) editorComponent).getSelectedItem(); + } + return super.getCellEditorValue(); + } + + @Override + public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, final int row, int column) { + + switch (column) { + case 0: + editorComponent = createComboBoxEdit(row, value); + break; + case 1: + editorComponent = createTextEdit(value); + break; + default: + editorComponent = createCalculateComboBox(value); + break; + + } + return editorComponent; + } + + private void setDefaultName(int row) { + UITable table = getParent().getTable(); + Object object = table.getValueAt(row, 0); + if (object != null) { + table.setValueAt(object, row, 1); + } + } + + private UIComboBox createComboBoxEdit(final int row, Object value) { + UIComboBox uiComboBox = new UIComboBox(fieldList.toArray()); + + uiComboBox.addItemListener(new ItemListener() { + public void itemStateChanged(ItemEvent e) { + getParent().stopCellEditing(); + getParent().fireTargetChanged(); + setDefaultName(row); + } + }); + + if (value != null && StringUtils.isNotEmpty(value.toString())) { + uiComboBox.getModel().setSelectedItem(value); + } else { + uiComboBox.getModel().setSelectedItem(value); + } + + return uiComboBox; + } + + private UITextField createTextEdit(Object value) { + UITextField uiTextField = new UITextField(); + if (value != null) { + uiTextField.setText(value.toString()); + } + + uiTextField.registerChangeListener(new UIObserverListener() { + @Override + public void doChange() { + getParent().fireTargetChanged(); + } + }); + + return uiTextField; + } + + private CalculateComboBox createCalculateComboBox(Object value) { + CalculateComboBox calculateComboBox = new CalculateComboBox(); + if (value != null) { + calculateComboBox.setSelectedItem(value); + } + calculateComboBox.addItemListener(new ItemListener() { + public void itemStateChanged(ItemEvent e) { + getParent().stopCellEditing(); + getParent().fireTargetChanged(); + } + }); + return calculateComboBox; + } + } + +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/ComboBoxWithButtonPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/ComboBoxWithButtonPane.java index 75ad743def..c00109db92 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/ComboBoxWithButtonPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/ComboBoxWithButtonPane.java @@ -4,6 +4,7 @@ import com.fr.design.event.UIObserverListener; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.mainframe.chart.gui.data.table.DataPaneHelper; import javax.swing.BorderFactory; import javax.swing.Icon; @@ -62,29 +63,14 @@ public abstract class ComboBoxWithButtonPane extends JPanel { * 刷新Box的选项. */ public void refreshBoxItems(java.util.List list) { - if(comboBoxName == null) { - return; - } - - Object ob = comboBoxName.getSelectedItem(); - comboBoxName.removeAllItems(); - - int length = list.size(); - for(int i = 0; i < length; i++) { - comboBoxName.addItem(list.get(i)); - } - - comboBoxName.getModel().setSelectedItem(ob); + DataPaneHelper.refreshBoxItems(comboBoxName, list); } /** * 清空box里所有东西 */ public void clearBoxItems(){ - if(comboBoxName == null){ - return; - } - comboBoxName.removeAllItems(); + DataPaneHelper.clearBoxItems(comboBoxName); } diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormWidgetEditAction.java b/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormWidgetEditAction.java index 753dc812b4..300086040a 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormWidgetEditAction.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormWidgetEditAction.java @@ -3,9 +3,14 @@ package com.fr.design.designer.beans.actions; import com.fr.design.actions.TemplateComponentAction; import com.fr.design.designer.beans.actions.behavior.UpdateBehavior; import com.fr.design.mainframe.FormDesigner; +import com.fr.intelli.record.Focus; +import com.fr.intelli.record.Original; +import com.fr.record.analyzer.EnableMetrics; +import javax.swing.JButton; import java.awt.event.ActionEvent; +@EnableMetrics public abstract class FormWidgetEditAction extends TemplateComponentAction { private UpdateBehavior updateBehavior = new UpdateBehavior() { @@ -27,9 +32,24 @@ public abstract class FormWidgetEditAction extends TemplateComponentAction { public FormMobileAttrAction(JForm jf) { @@ -64,6 +68,7 @@ public class FormMobileAttrAction extends JTemplateAction { // 放到后面。如果提前 return 了,则仍然处于未设置状态,不要添加 jf.getTarget().addAttrMark(new MobileOnlyTemplateAttrMark()); } + recordFunction(); // 设置移动端属性并刷新界面 formTpl.setFormMobileAttr(formMobileAttr); // 会调整 body 的自适应布局,放到最后 ((FormArea)jf.getFormDesign().getParent()).onMobileAttrModified(); @@ -74,6 +79,11 @@ public class FormMobileAttrAction extends JTemplateAction { dialog.setVisible(true); } + @Focus(id = "com.fr.mobile.mobile_template_frm", text = "Fine-Design_Function_Mobile_Template_Frm", source = Original.EMBED) + private void recordFunction() { + // do nothing + } + private static final MenuKeySet REPORT_APP_ATTR = new MenuKeySet() { @Override public char getMnemonic() { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBodyWatermarkEditor.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBodyWatermarkEditor.java index c5acb61148..a0567bad1d 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBodyWatermarkEditor.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBodyWatermarkEditor.java @@ -7,6 +7,9 @@ import com.fr.design.mainframe.widget.editors.ITextComponent; import com.fr.design.mainframe.widget.renderer.WatermarkRenderer; import com.fr.design.mainframe.widget.wrappers.WatermarkWrapper; import com.fr.design.report.WatermarkPane; +import com.fr.intelli.record.Focus; +import com.fr.intelli.record.Original; +import com.fr.record.analyzer.EnableMetrics; import javax.swing.*; import java.awt.*; @@ -15,6 +18,7 @@ import java.awt.*; * Created by plough on 2018/5/15. */ +@EnableMetrics public class AccessibleBodyWatermarkEditor extends UneditableAccessibleEditor { private WatermarkPane watermarkPane; @@ -40,9 +44,15 @@ public class AccessibleBodyWatermarkEditor extends UneditableAccessibleEditor { public void doOk() { setValue(watermarkPane.update()); fireStateChanged(); + recordFunction(); } }); watermarkPane.populate((WatermarkAttr) getValue()); dlg.setVisible(true); } + + @Focus(id = "com.fr.watermark", text = "Fine-Design_Form_WaterMark", source = Original.EMBED) + private void recordFunction() { + // do nothing + } } \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java b/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java index 40d4e68a41..a31108f2c4 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java @@ -11,7 +11,9 @@ import com.fr.design.report.mobile.ReportMobileAttrPane; import com.fr.file.FILE; import com.fr.general.IOUtils; +import com.fr.intelli.record.Focus; import com.fr.main.TemplateWorkBook; +import com.fr.record.analyzer.EnableMetrics; import com.fr.report.mobile.ElementCaseMobileAttr; import javax.swing.*; @@ -22,6 +24,7 @@ import java.awt.event.ActionEvent; * * Created by Administrator on 2016/5/12/0012. */ +@EnableMetrics public class ReportMobileAttrAction extends JWorkBookAction{ public ReportMobileAttrAction(JWorkBook jwb) { @@ -64,6 +67,7 @@ public class ReportMobileAttrAction extends JWorkBookAction{ // 放到后面。如果提前 return 了,则仍然处于未设置状态,不要添加 wbTpl.addAttrMark(new MobileOnlyTemplateAttrMark()); } + recordFunction(); // 设置移动端属性并刷新界面 wbTpl.setReportMobileAttr(elementCaseMobileAttr); // 会同时修改页面设置,放到最后 jwb.fireTargetModified(); @@ -72,6 +76,11 @@ public class ReportMobileAttrAction extends JWorkBookAction{ dialog.setVisible(true); } + @Focus(id = "com.fr.mobile.mobile_template_cpt", text = "Fine-Design_Function_Mobile_Template_Cpt") + private void recordFunction() { + // do nothing + } + private static final MenuKeySet REPORT_APP_ATTR = new MenuKeySet() { @Override public char getMnemonic() { return 'P'; } diff --git a/designer-realize/src/main/java/com/fr/design/actions/report/ReportWatermarkAction.java b/designer-realize/src/main/java/com/fr/design/actions/report/ReportWatermarkAction.java index db1d10f9d1..a07df219f9 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/report/ReportWatermarkAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/report/ReportWatermarkAction.java @@ -8,7 +8,10 @@ import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JWorkBook; import com.fr.design.menu.KeySetUtils; import com.fr.design.report.WatermarkPane; +import com.fr.intelli.record.Focus; +import com.fr.intelli.record.Original; import com.fr.main.impl.WorkBook; +import com.fr.record.analyzer.EnableMetrics; import com.fr.report.core.ReportUtils; import java.awt.event.ActionEvent; @@ -16,6 +19,7 @@ import java.awt.event.ActionEvent; /** * Created by plough on 2018/5/15. */ +@EnableMetrics public class ReportWatermarkAction extends JWorkBookAction { public ReportWatermarkAction(JWorkBook jwb) { super(jwb); @@ -42,7 +46,13 @@ public class ReportWatermarkAction extends JWorkBookAction { public void doOk() { wbTpl.addAttrMark(watermarkPane.update()); jwb.fireTargetModified(); + recordFunction(); } }).setVisible(true); } + + @Focus(id = "com.fr.watermark", text = "Fine-Design_Form_WaterMark", source = Original.EMBED) + private void recordFunction() { + // do nothing + } }