Browse Source

REPORT-28813 bugfix

feature/big-screen
Java.Edge 5 years ago
parent
commit
0c4282585d
  1. 62
      designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java
  2. 67
      designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java

62
designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java

@ -15,6 +15,7 @@ import com.fr.design.actions.edit.HyperlinkAction;
import com.fr.design.actions.edit.merge.MergeCellAction;
import com.fr.design.actions.edit.merge.UnmergeCellAction;
import com.fr.design.actions.utils.DeprecatedActionManager;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener;
import com.fr.design.file.HistoryTemplateListPane;
@ -35,8 +36,12 @@ import com.fr.page.ReportSettingsProvider;
import com.fr.report.worksheet.WorkSheet;
import com.fr.stable.ArrayUtils;
import javax.swing.JPanel;
import javax.swing.*;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/**
* 类说明: 设计面板中最上方的"插入" "单元格"下拉列表Menu模块.
@ -113,6 +118,61 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
}
}
@Override
protected void initInputActionMap() {
InputMap inputMapAncestor = this.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
ActionMap actionMap = this.getActionMap();
inputMapAncestor.clear();
actionMap.clear();
if (!DesignModeContext.isBanCopyAndCut()) {
inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER), "cut");
actionMap.put("cut", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent evt) {
if (cut()) {
fireTargetModified();
}
}
});
inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER), "copy");
actionMap.put("copy", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent evt) {
copy();
}
});
}
inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER), "paste");
actionMap.put("paste", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent evt) {
if (paste()) {
refreshPropertyPanes();
repaint();
}
}
});
inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), "delete_content");
actionMap.put("delete_content", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent evt) {
if (clearContents()) {
fireTargetModified();
}
}
});
inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, DEFAULT_MODIFIER), "delete_all");
actionMap.put("delete_all", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent evt) {
if (clearAll()) {
fireTargetModified();
}
}
});
}
@Override
protected boolean supportRepeatedHeaderFooter() {
return true;

67
designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java

@ -1,7 +1,6 @@
package com.fr.design.mainframe.form;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.*;
import com.fr.design.DesignState;
import com.fr.design.actions.UpdateAction;
@ -9,9 +8,9 @@ import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.form.FormECBackgroundAction;
import com.fr.design.actions.form.FormECColumnsAction;
import com.fr.design.actions.form.FormECFrozenAction;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.mainframe.*;
import com.fr.design.mainframe.cell.QuickEditorRegion;
@ -22,13 +21,16 @@ import com.fr.design.menu.ToolBarDef;
import com.fr.design.present.ConditionAttributesGroupPane;
import com.fr.form.main.Form;
import com.fr.grid.Grid;
import com.fr.js.NameJavaScriptGroup;
import com.fr.page.ReportSettingsProvider;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.report.worksheet.FormElementCase;
import com.fr.design.selection.SelectionEvent;
import com.fr.design.selection.SelectionListener;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/**
*/
public class FormElementCasePaneDelegate extends ElementCasePane<FormElementCase>{
@ -72,6 +74,61 @@ public class FormElementCasePaneDelegate extends ElementCasePane<FormElementCase
EastRegionContainerPane.getInstance().updateCellElementState(isSelectedOneCell());
}
@Override
protected void initInputActionMap() {
InputMap inputMapAncestor = this.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
ActionMap actionMap = this.getActionMap();
inputMapAncestor.clear();
actionMap.clear();
if (!DesignModeContext.isBanCopyAndCut()) {
inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER), "cut");
actionMap.put("cut", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent evt) {
if (cut()) {
fireTargetModified();
}
}
});
inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER), "copy");
actionMap.put("copy", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent evt) {
copy();
}
});
}
inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER), "paste");
actionMap.put("paste", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent evt) {
if (paste()) {
refreshPropertyPanes();
repaint();
}
}
});
inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), "delete_content");
actionMap.put("delete_content", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent evt) {
if (clearContents()) {
fireTargetModified();
}
}
});
inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, DEFAULT_MODIFIER), "delete_all");
actionMap.put("delete_all", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent evt) {
if (clearAll()) {
fireTargetModified();
}
}
});
}
@Override
protected boolean supportRepeatedHeaderFooter() {
return true;

Loading…
Cancel
Save