|
|
|
@ -15,7 +15,6 @@ 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; |
|
|
|
@ -36,17 +35,9 @@ import com.fr.page.ReportSettingsProvider;
|
|
|
|
|
import com.fr.report.worksheet.WorkSheet; |
|
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
|
|
|
|
|
|
import javax.swing.AbstractAction; |
|
|
|
|
import javax.swing.ActionMap; |
|
|
|
|
import javax.swing.InputMap; |
|
|
|
|
import javax.swing.JComponent; |
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import javax.swing.KeyStroke; |
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
import java.awt.event.KeyEvent; |
|
|
|
|
|
|
|
|
|
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 类说明: 设计面板中最上方的"插入" "单元格"下拉列表Menu模块. |
|
|
|
@ -123,61 +114,6 @@ 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; |
|
|
|
|