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. 21
      designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java
  2. 33
      designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java

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

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

33
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.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.DocumentListener;
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
@ -33,31 +42,33 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs
public UITextField() {
super();
InputEventBaseOnOS.addBasicEditInputMap(this);
initListener();
init();
}
public UITextField(int columns) {
super(columns);
InputEventBaseOnOS.addBasicEditInputMap(this);
initListener();
init();
}
public UITextField(String text, int columns) {
super(text, columns);
InputEventBaseOnOS.addBasicEditInputMap(this);
initListener();
init();
}
public UITextField(String text) {
super(text);
InputEventBaseOnOS.addBasicEditInputMap(this);
initListener();
init();
}
public UITextField(Document doc, String text, int columns) {
super(doc, text, columns);
init();
}
/**
* 每个构造方法里都需要做的一些操作
*/
public void init() {
InputEventBaseOnOS.addBasicEditInputMap(this);
initListener();
}

Loading…
Cancel
Save