Browse Source

主要修改:

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

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

@ -22,30 +22,33 @@ public class UIPassWordField extends JPasswordField {
public UIPassWordField() {
super();
InputEventBaseOnOS.addBasicEditInputMap(this);
addRollOverListener();
init();
}
public UIPassWordField(String text) {
super(text);
InputEventBaseOnOS.addBasicEditInputMap(this);
addRollOverListener();
init();
}
public UIPassWordField(int columns) {
super(columns);
InputEventBaseOnOS.addBasicEditInputMap(this);
addRollOverListener();
init();
}
public UIPassWordField(String text, int columns) {
super(text, columns);
InputEventBaseOnOS.addBasicEditInputMap(this);
addRollOverListener();
init();
}
public UIPassWordField(Document doc, String txt, int columns) {
super(doc, txt, columns);
init();
}
/**
* 每个构造方法里都需要做的一些操作
*/
public void init() {
InputEventBaseOnOS.addBasicEditInputMap(this);
addRollOverListener();
}

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

@ -42,30 +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