Browse Source

主要修改:

1.将MacOS系统下的粘贴键添加到UIPasswordField的InputMap中,使其支持command+v为粘贴键
2.修改导包
feature/big-screen
Yvan 4 years ago
parent
commit
eef74f18a3
  1. 6
      designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java
  2. 6
      designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java

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

@ -22,31 +22,35 @@ public class UIPassWordField extends JPasswordField {
public UIPassWordField() { public UIPassWordField() {
super(); super();
InputEventBaseOnOS.addBasicEditInputMap(this);
addRollOverListener(); addRollOverListener();
} }
public UIPassWordField(String text) { public UIPassWordField(String text) {
super(text); super(text);
InputEventBaseOnOS.addBasicEditInputMap(this);
addRollOverListener(); addRollOverListener();
} }
public UIPassWordField(int columns) { public UIPassWordField(int columns) {
super(columns); super(columns);
InputEventBaseOnOS.addBasicEditInputMap(this);
addRollOverListener(); addRollOverListener();
} }
public UIPassWordField(String text, int columns) { public UIPassWordField(String text, int columns) {
super(text, columns); super(text, columns);
InputEventBaseOnOS.addBasicEditInputMap(this);
addRollOverListener(); 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);
InputEventBaseOnOS.addBasicEditInputMap(this);
addRollOverListener(); addRollOverListener();
} }
private void addRollOverListener() { private void addRollOverListener() {
InputEventBaseOnOS.addBasicEditInputMap(this);
this.addMouseListener(new MouseAdapter() { this.addMouseListener(new MouseAdapter() {
@Override @Override
public void mouseEntered(MouseEvent e) { public void mouseEntered(MouseEvent e) {

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

@ -42,31 +42,35 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs
public UITextField() { public UITextField() {
super(); super();
InputEventBaseOnOS.addBasicEditInputMap(this);
initListener(); initListener();
} }
public UITextField(int columns) { public UITextField(int columns) {
super(columns); super(columns);
InputEventBaseOnOS.addBasicEditInputMap(this);
initListener(); initListener();
} }
public UITextField(String text, int columns) { public UITextField(String text, int columns) {
super(text, columns); super(text, columns);
InputEventBaseOnOS.addBasicEditInputMap(this);
initListener(); initListener();
} }
public UITextField(String text) { public UITextField(String text) {
super(text); super(text);
InputEventBaseOnOS.addBasicEditInputMap(this);
initListener(); 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);
InputEventBaseOnOS.addBasicEditInputMap(this);
initListener(); initListener();
} }
protected void initListener() { protected void initListener() {
InputEventBaseOnOS.addBasicEditInputMap(this);
if (shouldResponseChangeListener()) { if (shouldResponseChangeListener()) {
getDocument().addDocumentListener(new DocumentListener() { getDocument().addDocumentListener(new DocumentListener() {
@Override @Override

Loading…
Cancel
Save