Browse Source

Pull request #1935: REPORT-34451 mac下,设计器输入密码的地方(远程设计/数据连接)无法使用粘贴快捷键

Merge in DESIGN/design from ~YVAN/design:release/10.0 to release/10.0

* commit 'a965e07ff90e52597b37d4b605a84de1ed084ae3':
  主要修改: 1.将MacOS系统下的粘贴键添加到UIPasswordField的InputMap中,使其支持command+v为粘贴键 2.修改导包 3.将构造方法里的公用操作抽取出来放在init()中
  主要修改: 1.将MacOS系统下的粘贴键添加到UIPasswordField的InputMap中,使其支持command+v为粘贴键 2.修改导包
  主要修改: 1.将MacOS系统下的粘贴键添加到UIPasswordField的InputMap中,使其支持command+v为粘贴键 2.修改导包
  主要修改: 1.将MacOS系统下的粘贴键添加到UIPasswordField的InputMap中,使其支持command+v为粘贴键 2.修改导包
  主要修改: 1.将MacOS系统下的粘贴键添加到UIPasswordField的InputMap中,使其支持command+v为粘贴键 2.修改导包
  主要修改: 1.将MacOS系统下的粘贴键添加到UIPasswordField的InputMap中,使其支持command+v为粘贴键 2.修改导包
feature/big-screen
Yvan 4 years ago
parent
commit
b53b34cfa3
  1. 23
      designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java
  2. 35
      designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java

23
designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java

@ -1,11 +1,12 @@
package com.fr.design.gui.ipasswordfield; package com.fr.design.gui.ipasswordfield;
import com.fr.common.inputevent.InputEventBaseOnOS;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import javax.swing.*; import javax.swing.JPasswordField;
import javax.swing.text.Document; import javax.swing.text.Document;
import java.awt.*; import java.awt.Graphics;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
@ -21,26 +22,34 @@ public class UIPassWordField extends JPasswordField {
public UIPassWordField() { public UIPassWordField() {
super(); super();
addRollOverListener(); init();
} }
public UIPassWordField(String text) { public UIPassWordField(String text) {
super(text); super(text);
addRollOverListener(); init();
} }
public UIPassWordField(int columns) { public UIPassWordField(int columns) {
super(columns); super(columns);
addRollOverListener(); init();
} }
public UIPassWordField(String text, int columns) { public UIPassWordField(String text, int columns) {
super(text, columns); super(text, columns);
addRollOverListener(); init();
} }
public UIPassWordField(Document doc, String txt, int columns) { public UIPassWordField(Document doc, String txt, int columns) {
super(doc, txt, columns); super(doc, txt, columns);
init();
}
/**
* 每个构造方法里都需要做的一些操作
*/
public void init() {
InputEventBaseOnOS.addBasicEditInputMap(this);
addRollOverListener(); addRollOverListener();
} }
@ -69,4 +78,4 @@ public class UIPassWordField extends JPasswordField {
super.paintBorder(g); super.paintBorder(g);
} }
} }
} }

35
designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java

@ -9,11 +9,20 @@ import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import javax.swing.text.Document; import javax.swing.text.Document;
import java.awt.*; import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.LayoutManager;
import java.awt.RenderingHints;
/** /**
* @author Jerry * @author Jerry
@ -33,31 +42,33 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs
public UITextField() { public UITextField() {
super(); super();
InputEventBaseOnOS.addBasicEditInputMap(this); init();
initListener();
} }
public UITextField(int columns) { public UITextField(int columns) {
super(columns); super(columns);
InputEventBaseOnOS.addBasicEditInputMap(this); init();
initListener();
} }
public UITextField(String text, int columns) { public UITextField(String text, int columns) {
super(text, columns); super(text, columns);
InputEventBaseOnOS.addBasicEditInputMap(this); init();
initListener();
} }
public UITextField(String text) { public UITextField(String text) {
super(text); super(text);
InputEventBaseOnOS.addBasicEditInputMap(this); init();
initListener();
} }
public UITextField(Document doc, String text, int columns) { public UITextField(Document doc, String text, int columns) {
super(doc, text, columns); super(doc, text, columns);
init();
}
/**
* 每个构造方法里都需要做的一些操作
*/
public void init() {
InputEventBaseOnOS.addBasicEditInputMap(this); InputEventBaseOnOS.addBasicEditInputMap(this);
initListener(); initListener();
} }
@ -251,4 +262,4 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs
this.isBorderPainted = isBorderPainted; this.isBorderPainted = isBorderPainted;
} }
} }

Loading…
Cancel
Save