Browse Source

主要修改:

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

20
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,36 +42,31 @@ 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