From 5b17a17e85a5fdc382644ee7663bd1863cb379e0 Mon Sep 17 00:00:00 2001 From: hzzz Date: Sat, 27 May 2017 10:59:07 +0800 Subject: [PATCH] back 2 --- .../file/newReport/NewPolyReportAction.java | 4 +-- .../file/newReport/NewWorkBookAction.java | 5 ++-- .../fr/design/mainframe/ElementCasePane.java | 12 ++++----- .../design/mainframe/FormatBrushAction.java | 5 ++-- .../fr/design/actions/edit/CopyAction.java | 4 +-- .../com/fr/design/actions/edit/CutAction.java | 4 +-- .../fr/design/actions/edit/PasteAction.java | 4 +-- .../gui/autocomplete/AutoCompletion.java | 5 +--- .../design/gui/frpane/UIAdvancedTextPane.java | 8 +++--- .../gui/icombobox/ExtendedComboBox.java | 3 ++- .../fr/design/gui/icombobox/UIComboBoxUI.java | 5 ++-- .../gui/itabpane/UITabsHeaderIconPane.java | 4 +-- .../fr/design/gui/itextarea/UITextArea.java | 20 -------------- .../fr/design/gui/itextfield/UITextField.java | 20 -------------- .../loghandler/DesignerLogHandler.java | 27 +++---------------- .../src/com/fr/design/menu/KeySetUtils.java | 20 +++++++------- .../designer/beans/actions/CopyAction.java | 4 +-- .../designer/beans/actions/CutAction.java | 4 +-- .../designer/beans/actions/PasteAction.java | 4 +-- .../mainframe/actions/NewFormAction.java | 4 +-- .../widget/editors/DataTableConfigPane.java | 4 +-- 21 files changed, 40 insertions(+), 130 deletions(-) diff --git a/designer/src/com/fr/design/actions/file/newReport/NewPolyReportAction.java b/designer/src/com/fr/design/actions/file/newReport/NewPolyReportAction.java index 924d0c01d..ea7785f7a 100644 --- a/designer/src/com/fr/design/actions/file/newReport/NewPolyReportAction.java +++ b/designer/src/com/fr/design/actions/file/newReport/NewPolyReportAction.java @@ -11,15 +11,13 @@ import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JPolyWorkBook; import com.fr.general.Inter; -import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; - public class NewPolyReportAction extends UpdateAction { public NewPolyReportAction() { this.setName(Inter.getLocText("M-New_Multi_Report")); this.setMnemonic('F'); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/formExport.png")); - this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_M, DEFAULT_MODIFIER)); + this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_M, KeyEvent.CTRL_MASK)); } /** diff --git a/designer/src/com/fr/design/actions/file/newReport/NewWorkBookAction.java b/designer/src/com/fr/design/actions/file/newReport/NewWorkBookAction.java index cda7a0aa1..a537d3c43 100644 --- a/designer/src/com/fr/design/actions/file/newReport/NewWorkBookAction.java +++ b/designer/src/com/fr/design/actions/file/newReport/NewWorkBookAction.java @@ -12,8 +12,6 @@ import java.awt.event.ActionEvent; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; -import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; - public class NewWorkBookAction extends UpdateAction { public NewWorkBookAction() { @@ -30,6 +28,7 @@ public class NewWorkBookAction extends UpdateAction { /** * 动作 + * * @param e 事件 */ public void actionPerformed(ActionEvent e) { @@ -49,7 +48,7 @@ public class NewWorkBookAction extends UpdateAction { @Override public KeyStroke getKeyStroke() { - return KeyStroke.getKeyStroke(KeyEvent.VK_N, DEFAULT_MODIFIER); + return KeyStroke.getKeyStroke(KeyEvent.VK_N, InputEvent.CTRL_MASK); } }; diff --git a/designer/src/com/fr/design/mainframe/ElementCasePane.java b/designer/src/com/fr/design/mainframe/ElementCasePane.java index 52bbc6393..dcc68ab81 100644 --- a/designer/src/com/fr/design/mainframe/ElementCasePane.java +++ b/designer/src/com/fr/design/mainframe/ElementCasePane.java @@ -127,8 +127,6 @@ import com.fr.stable.ColumnRow; import com.fr.stable.Constants; import com.fr.stable.unit.FU; -import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; - /** * This class used to edit Report. */ @@ -282,7 +280,7 @@ public abstract class ElementCasePane extends Tar } } }); - formatBrush.registerKeyboardAction(keyListener, KeyStroke.getKeyStroke(KeyEvent.VK_B, DEFAULT_MODIFIER), JComponent.WHEN_IN_FOCUSED_WINDOW); + formatBrush.registerKeyboardAction(keyListener, KeyStroke.getKeyStroke(KeyEvent.VK_B, InputEvent.CTRL_MASK), JComponent.WHEN_IN_FOCUSED_WINDOW); formatBrush.registerKeyboardAction(escKey, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW); } @@ -857,7 +855,7 @@ public abstract class ElementCasePane extends Tar // clearReportPage old values. inputMapAncestor.clear(); actionMap.clear(); - inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER), "cut"); + inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.CTRL_MASK), "cut"); actionMap.put("cut", new AbstractAction() { public void actionPerformed(ActionEvent evt) { if (cut()) { @@ -865,13 +863,13 @@ public abstract class ElementCasePane extends Tar } } }); - inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER), "copy"); + inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK), "copy"); actionMap.put("copy", new AbstractAction() { public void actionPerformed(ActionEvent evt) { copy(); } }); - inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER), "paste"); + inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_MASK), "paste"); actionMap.put("paste", new AbstractAction() { public void actionPerformed(ActionEvent evt) { if (paste()) { @@ -889,7 +887,7 @@ public abstract class ElementCasePane extends Tar } } }); - inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, DEFAULT_MODIFIER), "delete_all"); + inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, InputEvent.CTRL_MASK), "delete_all"); actionMap.put("delete_all", new AbstractAction() { public void actionPerformed(ActionEvent evt) { if (clearAll()) { diff --git a/designer/src/com/fr/design/mainframe/FormatBrushAction.java b/designer/src/com/fr/design/mainframe/FormatBrushAction.java index f77bda9eb..687631250 100644 --- a/designer/src/com/fr/design/mainframe/FormatBrushAction.java +++ b/designer/src/com/fr/design/mainframe/FormatBrushAction.java @@ -12,10 +12,9 @@ import com.fr.report.elementcase.TemplateElementCase; import javax.swing.*; import java.awt.*; +import java.awt.event.InputEvent; import java.awt.event.KeyEvent; -import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; - /** * Author : daisy * Date: 13-8-7 @@ -32,7 +31,7 @@ public class FormatBrushAction extends ElementCaseAction { this.setName(Inter.getLocText("M_Edit-FormatBrush")); this.setMnemonic('B'); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/formatBrush.png")); - this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_B, DEFAULT_MODIFIER)); + this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_B, InputEvent.CTRL_MASK)); } public boolean executeActionReturnUndoRecordNeeded() { diff --git a/designer_base/src/com/fr/design/actions/edit/CopyAction.java b/designer_base/src/com/fr/design/actions/edit/CopyAction.java index b3a932ba5..d0579a579 100644 --- a/designer_base/src/com/fr/design/actions/edit/CopyAction.java +++ b/designer_base/src/com/fr/design/actions/edit/CopyAction.java @@ -11,8 +11,6 @@ import com.fr.general.Inter; import javax.swing.*; import java.awt.event.KeyEvent; -import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; - /** * Copy. */ @@ -23,7 +21,7 @@ public class CopyAction extends TemplateComponentAction { this.setName(Inter.getLocText("M_Edit-Copy")); this.setMnemonic('C'); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/copy.png")); - this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER)); + this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.CTRL_MASK)); } @Override diff --git a/designer_base/src/com/fr/design/actions/edit/CutAction.java b/designer_base/src/com/fr/design/actions/edit/CutAction.java index b0e7847a6..735ec5bf3 100644 --- a/designer_base/src/com/fr/design/actions/edit/CutAction.java +++ b/designer_base/src/com/fr/design/actions/edit/CutAction.java @@ -12,8 +12,6 @@ import com.fr.design.actions.TemplateComponentAction; import com.fr.design.designer.TargetComponent; import com.fr.general.Inter; -import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; - /** * Cut. */ @@ -27,7 +25,7 @@ public class CutAction extends TemplateComponentAction { this.setName(Inter.getLocText("M_Edit-Cut")); this.setMnemonic('T'); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/cut.png")); - this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER)); + this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.CTRL_MASK)); } @Override diff --git a/designer_base/src/com/fr/design/actions/edit/PasteAction.java b/designer_base/src/com/fr/design/actions/edit/PasteAction.java index 4ca42c0f2..f6b71e421 100644 --- a/designer_base/src/com/fr/design/actions/edit/PasteAction.java +++ b/designer_base/src/com/fr/design/actions/edit/PasteAction.java @@ -12,8 +12,6 @@ import com.fr.design.actions.TemplateComponentAction; import com.fr.design.designer.TargetComponent; import com.fr.general.Inter; -import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; - /** * Paste. */ @@ -27,7 +25,7 @@ public class PasteAction extends TemplateComponentAction { this.setName(Inter.getLocText("M_Edit-Paste")); this.setMnemonic('P'); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/paste.png")); - this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER)); + this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.CTRL_MASK)); } @Override diff --git a/designer_base/src/com/fr/design/gui/autocomplete/AutoCompletion.java b/designer_base/src/com/fr/design/gui/autocomplete/AutoCompletion.java index fb5f2b763..42d547200 100644 --- a/designer_base/src/com/fr/design/gui/autocomplete/AutoCompletion.java +++ b/designer_base/src/com/fr/design/gui/autocomplete/AutoCompletion.java @@ -20,9 +20,6 @@ import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.List; -import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; - - /** * Adds auto-completion to a text component. Provides a popup window with a * list of auto-complete choices on a given keystroke, such as Crtrl+Space.

@@ -310,7 +307,7 @@ public class AutoCompletion { */ public static KeyStroke getDefaultTriggerKey() { // Default to CTRL, even on Mac, since Ctrl+Space activates Spotlight - return KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, DEFAULT_MODIFIER); + return KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, InputEvent.CTRL_MASK); } diff --git a/designer_base/src/com/fr/design/gui/frpane/UIAdvancedTextPane.java b/designer_base/src/com/fr/design/gui/frpane/UIAdvancedTextPane.java index 8ce8ec1a0..4cff0ef2d 100644 --- a/designer_base/src/com/fr/design/gui/frpane/UIAdvancedTextPane.java +++ b/designer_base/src/com/fr/design/gui/frpane/UIAdvancedTextPane.java @@ -20,8 +20,6 @@ import com.fr.design.actions.UpdateAction; import com.fr.design.menu.KeySetUtils; import com.fr.general.Inter; -import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; - /** * p:这是一个增强的JTextPane,支持很多Action */ @@ -145,7 +143,7 @@ public class UIAdvancedTextPane extends UITextPane { setName(Inter.getLocText("M_Edit-Cut")); setMnemonic('T'); setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/cut.png")); - setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER)); + setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.CTRL_MASK)); } public void actionPerformed(ActionEvent evt) { @@ -164,7 +162,7 @@ public class UIAdvancedTextPane extends UITextPane { this.setName(Inter.getLocText("M_Edit-Copy")); this.setMnemonic('C'); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/copy.png")); - this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER)); + this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.CTRL_MASK)); } public void actionPerformed(ActionEvent evt) { @@ -183,7 +181,7 @@ public class UIAdvancedTextPane extends UITextPane { this.setName(Inter.getLocText("M_Edit-Paste")); this.setMnemonic('P'); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/paste.png")); - this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER)); + this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.CTRL_MASK)); } public void actionPerformed(ActionEvent evt) { diff --git a/designer_base/src/com/fr/design/gui/icombobox/ExtendedComboBox.java b/designer_base/src/com/fr/design/gui/icombobox/ExtendedComboBox.java index 60cdd2683..295b2d673 100644 --- a/designer_base/src/com/fr/design/gui/icombobox/ExtendedComboBox.java +++ b/designer_base/src/com/fr/design/gui/icombobox/ExtendedComboBox.java @@ -5,6 +5,7 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.basic.BasicComboPopup; import javax.swing.plaf.basic.ComboPopup; import java.awt.*; +import java.awt.event.InputEvent; import java.awt.event.MouseEvent; import java.util.Vector; @@ -72,7 +73,7 @@ public class ExtendedComboBox extends UIComboBox { // Key from the list. // ie., don't allow CTRL key deselection. e = new MouseEvent((Component) e.getSource(), e.getID(), e.getWhen(), e.getModifiers() - ^ DEFAULT_MODIFIER, e.getX(), e.getY(), e.getClickCount(), e.isPopupTrigger()); + ^ InputEvent.CTRL_MASK, e.getX(), e.getY(), e.getClickCount(), e.isPopupTrigger()); } super.processMouseEvent(e); } diff --git a/designer_base/src/com/fr/design/gui/icombobox/UIComboBoxUI.java b/designer_base/src/com/fr/design/gui/icombobox/UIComboBoxUI.java index 5ba3b2ce5..032f75643 100644 --- a/designer_base/src/com/fr/design/gui/icombobox/UIComboBoxUI.java +++ b/designer_base/src/com/fr/design/gui/icombobox/UIComboBoxUI.java @@ -12,11 +12,10 @@ import javax.swing.plaf.basic.BasicComboBoxUI; import javax.swing.plaf.basic.BasicComboPopup; import javax.swing.plaf.basic.ComboPopup; import java.awt.*; +import java.awt.event.InputEvent; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; -import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; - /** * @author zhou F * @since 2012-5-9下午4:33:07 @@ -201,7 +200,7 @@ public class UIComboBoxUI extends BasicComboBoxUI implements MouseListener { @Override public void processMouseEvent(MouseEvent e) { if (e.isControlDown()) { - e = new MouseEvent((Component) e.getSource(), e.getID(), e.getWhen(), e.getModifiers() ^ DEFAULT_MODIFIER, e.getX(), e.getY(), e.getClickCount(), + e = new MouseEvent((Component) e.getSource(), e.getID(), e.getWhen(), e.getModifiers() ^ InputEvent.CTRL_MASK, e.getX(), e.getY(), e.getClickCount(), e.isPopupTrigger()); } super.processMouseEvent(e); diff --git a/designer_base/src/com/fr/design/gui/itabpane/UITabsHeaderIconPane.java b/designer_base/src/com/fr/design/gui/itabpane/UITabsHeaderIconPane.java index 84f0cd35f..8582b5eef 100644 --- a/designer_base/src/com/fr/design/gui/itabpane/UITabsHeaderIconPane.java +++ b/designer_base/src/com/fr/design/gui/itabpane/UITabsHeaderIconPane.java @@ -17,8 +17,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; - /** * 本来想弄个延迟加载的,发现在单元格属性表那边没有意义,就算了.这个面板是纯粹的,没有与模板的任何交互操作(比如说populate() update()) * @@ -113,7 +111,7 @@ public class UITabsHeaderIconPane extends JPanel implements UITabComponent { inputMapAncestor.clear(); actionMap.clear(); - inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, DEFAULT_MODIFIER), "switch"); + inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, KeyEvent.CTRL_MASK), "switch"); actionMap.put("switch", new AbstractAction() { /** diff --git a/designer_base/src/com/fr/design/gui/itextarea/UITextArea.java b/designer_base/src/com/fr/design/gui/itextarea/UITextArea.java index 6e04eacb8..cf89971b3 100644 --- a/designer_base/src/com/fr/design/gui/itextarea/UITextArea.java +++ b/designer_base/src/com/fr/design/gui/itextarea/UITextArea.java @@ -7,33 +7,13 @@ import com.fr.design.utils.gui.GUICoreUtils; import javax.swing.*; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; -import javax.swing.text.DefaultEditorKit; import java.awt.*; -import java.awt.event.KeyEvent; - -import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; public class UITextArea extends JTextArea implements UIObserver { private UIObserverListener uiObserverListener; public UITextArea(int i, int j) { super(i, j); - InputMap inputMap = this.getInputMap(); - while (inputMap.getParent() != null) { - inputMap = inputMap.getParent(); - } - if (inputMap.get(KeyStroke.getKeyStroke(KeyEvent.VK_A, DEFAULT_MODIFIER)) == null) { - inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_A, DEFAULT_MODIFIER), DefaultEditorKit.selectAllAction); - } - if (inputMap.get(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER)) == null) { - inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER), DefaultEditorKit.copyAction); - } - if (inputMap.get(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER)) == null) { - inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER), DefaultEditorKit.pasteAction); - } - if (inputMap.get(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER)) == null) { - inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER), DefaultEditorKit.cutAction); - } initComponents(); } diff --git a/designer_base/src/com/fr/design/gui/itextfield/UITextField.java b/designer_base/src/com/fr/design/gui/itextfield/UITextField.java index 4f15b1f81..bf5b85628 100644 --- a/designer_base/src/com/fr/design/gui/itextfield/UITextField.java +++ b/designer_base/src/com/fr/design/gui/itextfield/UITextField.java @@ -10,12 +10,8 @@ import com.fr.stable.Constants; import javax.swing.*; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; -import javax.swing.text.DefaultEditorKit; import javax.swing.text.Document; import java.awt.*; -import java.awt.event.KeyEvent; - -import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; /** * @author Jerry @@ -31,22 +27,6 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs public UITextField() { super(); - InputMap inputMap = this.getInputMap(); - while (inputMap.getParent() != null) { - inputMap = inputMap.getParent(); - } - if (inputMap.get(KeyStroke.getKeyStroke(KeyEvent.VK_A, DEFAULT_MODIFIER)) == null) { - inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_A, DEFAULT_MODIFIER), DefaultEditorKit.selectAllAction); - } - if (inputMap.get(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER)) == null) { - inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER), DefaultEditorKit.copyAction); - } - if (inputMap.get(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER)) == null) { - inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER), DefaultEditorKit.pasteAction); - } - if (inputMap.get(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER)) == null) { - inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER), DefaultEditorKit.cutAction); - } initListener(); } diff --git a/designer_base/src/com/fr/design/mainframe/loghandler/DesignerLogHandler.java b/designer_base/src/com/fr/design/mainframe/loghandler/DesignerLogHandler.java index e45ade484..c95926213 100644 --- a/designer_base/src/com/fr/design/mainframe/loghandler/DesignerLogHandler.java +++ b/designer_base/src/com/fr/design/mainframe/loghandler/DesignerLogHandler.java @@ -21,8 +21,6 @@ import java.util.Date; import java.util.logging.Handler; import java.util.logging.LogRecord; -import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; - public class DesignerLogHandler { protected static final int INFO_INT = FRLogLevel.INFO.intValue(); protected static final int ERRO_INT = FRLogLevel.ERROR.intValue(); @@ -131,7 +129,7 @@ public class DesignerLogHandler { private UIMenuItem clear; private LogHandlerArea() { - jTextArea = initLogJTextArea(); + jTextArea = new JTextPane(); this.setLayout(FRGUIPaneFactory.createBorderLayout()); UIScrollPane js = new UIScrollPane(jTextArea); this.add(js, BorderLayout.CENTER); @@ -156,9 +154,9 @@ public class DesignerLogHandler { clear.setIcon(BaseUtils.readIcon("/com/fr/design/images/log/clear.png")); popup.add(clear); - selectAll.setAccelerator(KeyStroke.getKeyStroke('A', DEFAULT_MODIFIER)); - copy.setAccelerator(KeyStroke.getKeyStroke('C', DEFAULT_MODIFIER)); - clear.setAccelerator(KeyStroke.getKeyStroke('L', DEFAULT_MODIFIER)); + selectAll.setAccelerator(KeyStroke.getKeyStroke('A', InputEvent.CTRL_MASK)); + copy.setAccelerator(KeyStroke.getKeyStroke('C', InputEvent.CTRL_MASK)); + clear.setAccelerator(KeyStroke.getKeyStroke('L', InputEvent.CTRL_MASK)); jTextArea.addMouseListener(new MouseAdapter() { // check for right click @@ -186,23 +184,6 @@ public class DesignerLogHandler { }); } - private JTextPane initLogJTextArea() { - final JTextPane resultPane = new JTextPane(); - InputMap inputMap = resultPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); - inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER), DefaultEditorKit.copyAction); - inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_A, DEFAULT_MODIFIER), DefaultEditorKit.selectAllAction); - inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_L, DEFAULT_MODIFIER), "clear"); - ActionMap actionMap = resultPane.getActionMap(); - actionMap.put("clear", new AbstractAction() { - public void actionPerformed(ActionEvent evt) { - resultPane.setText(""); - caption.clearMessage(); - DesignerLogImpl.getInstance().clear(); - } - }); - return resultPane; - } - public void printStackTrace(LogRecordTimeProvider logRecordTime) { LogRecord logRecord = logRecordTime.getLogRecord(); Date date = logRecordTime.getDate(); diff --git a/designer_base/src/com/fr/design/menu/KeySetUtils.java b/designer_base/src/com/fr/design/menu/KeySetUtils.java index 401da7fb9..1b62fcdc4 100644 --- a/designer_base/src/com/fr/design/menu/KeySetUtils.java +++ b/designer_base/src/com/fr/design/menu/KeySetUtils.java @@ -12,8 +12,6 @@ import javax.swing.*; import java.awt.event.KeyEvent; import java.util.Locale; -import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; - /** * Created by IntelliJ IDEA. * Author : daisy @@ -38,7 +36,7 @@ public class KeySetUtils { @Override public KeyStroke getKeyStroke() { - return KeyStroke.getKeyStroke(KeyEvent.VK_O, DEFAULT_MODIFIER); + return KeyStroke.getKeyStroke(KeyEvent.VK_O, KeyEvent.CTRL_MASK); } }; @@ -73,7 +71,7 @@ public class KeySetUtils { @Override public KeyStroke getKeyStroke() { - return KeyStroke.getKeyStroke(KeyEvent.VK_W, DEFAULT_MODIFIER); + return KeyStroke.getKeyStroke(KeyEvent.VK_W, KeyEvent.CTRL_MASK); } }; @@ -90,7 +88,7 @@ public class KeySetUtils { @Override public KeyStroke getKeyStroke() { - return KeyStroke.getKeyStroke(KeyEvent.VK_S, DEFAULT_MODIFIER); + return KeyStroke.getKeyStroke(KeyEvent.VK_S, KeyEvent.CTRL_MASK); } }; @@ -124,7 +122,7 @@ public class KeySetUtils { @Override public KeyStroke getKeyStroke() { - return KeyStroke.getKeyStroke(KeyEvent.VK_Z, DEFAULT_MODIFIER); + return KeyStroke.getKeyStroke(KeyEvent.VK_Z, KeyEvent.CTRL_MASK); } }; @@ -141,7 +139,7 @@ public class KeySetUtils { @Override public KeyStroke getKeyStroke() { - return KeyStroke.getKeyStroke(KeyEvent.VK_Y, DEFAULT_MODIFIER); + return KeyStroke.getKeyStroke(KeyEvent.VK_Y, KeyEvent.CTRL_MASK); } }; @@ -158,7 +156,7 @@ public class KeySetUtils { @Override public KeyStroke getKeyStroke() { - return KeyStroke.getKeyStroke(KeyEvent.VK_E, DEFAULT_MODIFIER); + return KeyStroke.getKeyStroke(KeyEvent.VK_E, KeyEvent.CTRL_MASK); } }; @@ -355,7 +353,7 @@ public class KeySetUtils { @Override public KeyStroke getKeyStroke() { - return KeyStroke.getKeyStroke(KeyEvent.VK_M, DEFAULT_MODIFIER); + return KeyStroke.getKeyStroke(KeyEvent.VK_M, KeyEvent.CTRL_MASK); } }; @@ -372,7 +370,7 @@ public class KeySetUtils { @Override public KeyStroke getKeyStroke() { - return KeyStroke.getKeyStroke(KeyEvent.VK_E, DEFAULT_MODIFIER); + return KeyStroke.getKeyStroke(KeyEvent.VK_E, KeyEvent.CTRL_MASK); } }; @@ -389,7 +387,7 @@ public class KeySetUtils { @Override public KeyStroke getKeyStroke() { - return KeyStroke.getKeyStroke(KeyEvent.VK_E, DEFAULT_MODIFIER); + return KeyStroke.getKeyStroke(KeyEvent.VK_E, KeyEvent.CTRL_MASK); } }; diff --git a/designer_form/src/com/fr/design/designer/beans/actions/CopyAction.java b/designer_form/src/com/fr/design/designer/beans/actions/CopyAction.java index d3906040d..23686f651 100644 --- a/designer_form/src/com/fr/design/designer/beans/actions/CopyAction.java +++ b/designer_form/src/com/fr/design/designer/beans/actions/CopyAction.java @@ -8,8 +8,6 @@ import javax.swing.*; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; -import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; - public class CopyAction extends FormEditAction { public CopyAction(FormDesigner t) { @@ -17,7 +15,7 @@ public class CopyAction extends FormEditAction { this.setName(Inter.getLocText("M_Edit-Copy")); this.setMnemonic('C'); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/copy.png")); - this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER)); + this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK)); } @Override diff --git a/designer_form/src/com/fr/design/designer/beans/actions/CutAction.java b/designer_form/src/com/fr/design/designer/beans/actions/CutAction.java index 1f81c1280..9acb26148 100644 --- a/designer_form/src/com/fr/design/designer/beans/actions/CutAction.java +++ b/designer_form/src/com/fr/design/designer/beans/actions/CutAction.java @@ -9,8 +9,6 @@ import com.fr.base.BaseUtils; import com.fr.general.Inter; import com.fr.design.mainframe.FormDesigner; -import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; - public class CutAction extends FormEditAction { public CutAction(FormDesigner t) { @@ -18,7 +16,7 @@ public class CutAction extends FormEditAction { this.setName(Inter.getLocText("M_Edit-Cut")); this.setMnemonic('T'); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/cut.png")); - this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER)); + this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.CTRL_MASK)); } @Override diff --git a/designer_form/src/com/fr/design/designer/beans/actions/PasteAction.java b/designer_form/src/com/fr/design/designer/beans/actions/PasteAction.java index 351a809f6..85ce1d6ed 100644 --- a/designer_form/src/com/fr/design/designer/beans/actions/PasteAction.java +++ b/designer_form/src/com/fr/design/designer/beans/actions/PasteAction.java @@ -9,8 +9,6 @@ import com.fr.base.BaseUtils; import com.fr.general.Inter; import com.fr.design.mainframe.FormDesigner; -import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; - public class PasteAction extends FormEditAction { public PasteAction(FormDesigner t) { @@ -18,7 +16,7 @@ public class PasteAction extends FormEditAction { this.setName(Inter.getLocText("M_Edit-Paste")); this.setMnemonic('P'); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/paste.png")); - this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER)); + this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_MASK)); } @Override diff --git a/designer_form/src/com/fr/design/mainframe/actions/NewFormAction.java b/designer_form/src/com/fr/design/mainframe/actions/NewFormAction.java index 78b17d4b3..107b9da58 100644 --- a/designer_form/src/com/fr/design/mainframe/actions/NewFormAction.java +++ b/designer_form/src/com/fr/design/mainframe/actions/NewFormAction.java @@ -14,8 +14,6 @@ import java.awt.event.ActionEvent; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; -import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; - public class NewFormAction extends UpdateAction { public NewFormAction() { @@ -50,7 +48,7 @@ public class NewFormAction extends UpdateAction { @Override public KeyStroke getKeyStroke() { - return KeyStroke.getKeyStroke(KeyEvent.VK_F, DEFAULT_MODIFIER); + return KeyStroke.getKeyStroke(KeyEvent.VK_F, InputEvent.CTRL_MASK); } }; } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/mainframe/widget/editors/DataTableConfigPane.java b/designer_form/src/com/fr/design/mainframe/widget/editors/DataTableConfigPane.java index 00d70bd1e..3c993bde7 100644 --- a/designer_form/src/com/fr/design/mainframe/widget/editors/DataTableConfigPane.java +++ b/designer_form/src/com/fr/design/mainframe/widget/editors/DataTableConfigPane.java @@ -21,8 +21,6 @@ import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.ArrayList; -import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; - public class DataTableConfigPane extends JComponent implements PropertyChangeListener { private DataEditingTable table; @@ -187,7 +185,7 @@ public class DataTableConfigPane extends JComponent implements PropertyChangeLis this.setName(Inter.getLocText("M_Edit-Cut")); this.setMnemonic('T'); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/cut.png")); - this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER)); + this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.CTRL_MASK)); } @Override