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() { public UIPassWordField() {
super(); super();
InputEventBaseOnOS.addBasicEditInputMap(this); init();
addRollOverListener();
} }
public UIPassWordField(String text) { public UIPassWordField(String text) {
super(text); super(text);
InputEventBaseOnOS.addBasicEditInputMap(this); init();
addRollOverListener();
} }
public UIPassWordField(int columns) { public UIPassWordField(int columns) {
super(columns); super(columns);
InputEventBaseOnOS.addBasicEditInputMap(this); init();
addRollOverListener();
} }
public UIPassWordField(String text, int columns) { public UIPassWordField(String text, int columns) {
super(text, columns); super(text, columns);
InputEventBaseOnOS.addBasicEditInputMap(this); init();
addRollOverListener();
} }
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); InputEventBaseOnOS.addBasicEditInputMap(this);
addRollOverListener(); 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() { 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();
} }

Loading…
Cancel
Save