Browse Source

REPORT-2773 mac中复制快捷键的修复

master
hzzz 8 years ago
parent
commit
71025db06a
  1. 172
      designer/src/com/fr/design/mainframe/FormatBrushAction.java
  2. 23
      designer_base/src/com/fr/design/gui/itextarea/UITextArea.java
  3. 41
      designer_base/src/com/fr/design/gui/itextfield/UITextField.java
  4. 4
      designer_base/src/com/fr/design/gui/itree/checkboxtree/CheckBoxTree.java

172
designer/src/com/fr/design/mainframe/FormatBrushAction.java

File diff suppressed because one or more lines are too long

23
designer_base/src/com/fr/design/gui/itextarea/UITextArea.java

@ -19,14 +19,21 @@ public class UITextArea extends JTextArea implements UIObserver {
public UITextArea(int i, int j) { public UITextArea(int i, int j) {
super(i, j); super(i, j);
InputMap inputMap = this.getInputMap(); InputMap inputMap = this.getInputMap();
inputMap.getParent().put(KeyStroke.getKeyStroke(KeyEvent.VK_A, DEFAULT_MODIFIER), while (inputMap.getParent() != null) {
DefaultEditorKit.selectAllAction); inputMap = inputMap.getParent();
inputMap.getParent().put(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER), }
DefaultEditorKit.copyAction); if (inputMap.get(KeyStroke.getKeyStroke(KeyEvent.VK_A, DEFAULT_MODIFIER)) == null) {
inputMap.getParent().put(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER), inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_A, DEFAULT_MODIFIER), DefaultEditorKit.selectAllAction);
DefaultEditorKit.pasteAction); }
inputMap.getParent().put(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER), if (inputMap.get(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER)) == null) {
DefaultEditorKit.cutAction); 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(); initComponents();
} }

41
designer_base/src/com/fr/design/gui/itextfield/UITextField.java

@ -1,20 +1,19 @@
package com.fr.design.gui.itextfield; package com.fr.design.gui.itextfield;
import java.awt.*; import com.fr.design.event.GlobalNameListener;
import java.awt.event.KeyEvent; import com.fr.design.event.GlobalNameObserver;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.Constants;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import javax.swing.text.DefaultEditorKit; import javax.swing.text.DefaultEditorKit;
import javax.swing.text.Document; import javax.swing.text.Document;
import java.awt.*;
import com.fr.design.event.GlobalNameListener; import java.awt.event.KeyEvent;
import com.fr.design.event.GlobalNameObserver;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.stable.Constants;
import com.fr.design.utils.gui.GUICoreUtils;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
@ -33,14 +32,21 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs
public UITextField() { public UITextField() {
super(); super();
InputMap inputMap = this.getInputMap(); InputMap inputMap = this.getInputMap();
inputMap.getParent().put(KeyStroke.getKeyStroke(KeyEvent.VK_A, DEFAULT_MODIFIER), while (inputMap.getParent() != null) {
DefaultEditorKit.selectAllAction); inputMap = inputMap.getParent();
inputMap.getParent().put(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER), }
DefaultEditorKit.copyAction); if (inputMap.get(KeyStroke.getKeyStroke(KeyEvent.VK_A, DEFAULT_MODIFIER)) == null) {
inputMap.getParent().put(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER), inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_A, DEFAULT_MODIFIER), DefaultEditorKit.selectAllAction);
DefaultEditorKit.pasteAction); }
inputMap.getParent().put(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER), if (inputMap.get(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER)) == null) {
DefaultEditorKit.cutAction); 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(); initListener();
} }
@ -197,6 +203,7 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs
/** /**
* 主函数 * 主函数
*
* @param args 参数 * @param args 参数
*/ */
public static void main(String... args) { public static void main(String... args) {

4
designer_base/src/com/fr/design/gui/itree/checkboxtree/CheckBoxTree.java

@ -22,8 +22,6 @@ import java.beans.PropertyChangeListener;
import java.util.Hashtable; import java.util.Hashtable;
import java.util.Vector; import java.util.Vector;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/** /**
* CheckBoxTree is a special JTree which uses UICheckBox as the tree renderer. * CheckBoxTree is a special JTree which uses UICheckBox as the tree renderer.
* In addition to regular JTree's features, it also allows you select any number * In addition to regular JTree's features, it also allows you select any number
@ -82,8 +80,6 @@ public class CheckBoxTree extends JTree {
public CheckBoxTree(TreeModel newModel) { public CheckBoxTree(TreeModel newModel) {
super(newModel); super(newModel);
InputMap inputMap = this.getInputMap();
inputMap.getParent().put(KeyStroke.getKeyStroke(KeyEvent.VK_A, DEFAULT_MODIFIER), "selectAll");
init(); init();
} }

Loading…
Cancel
Save