Browse Source

CHART-18080 变量名更换

zheng-1641779399395
kuangshuai 3 years ago
parent
commit
e329e432ff
  1. 13
      designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java

13
designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java

@ -39,7 +39,10 @@ public class UINumberField extends UITextField {
private boolean isContentChanged = false; private boolean isContentChanged = false;
private boolean fillNegativeNumber = true; private boolean fillNegativeNumber = true;
private boolean isInputMethodChange = false; /**
* 输入法输入完成一个字符输入过程的标记开始输入的时候是true输入完矫正光标后为false
*/
private boolean isInputMethodOnceInserting = false;
private int insertOffset = 0; private int insertOffset = 0;
public UINumberField() { public UINumberField() {
@ -73,7 +76,7 @@ public class UINumberField extends UITextField {
addInputMethodListener(new InputMethodListener() { addInputMethodListener(new InputMethodListener() {
@Override @Override
public void inputMethodTextChanged(InputMethodEvent event) { public void inputMethodTextChanged(InputMethodEvent event) {
isInputMethodChange = true; isInputMethodOnceInserting = true;
} }
@Override @Override
@ -84,8 +87,8 @@ public class UINumberField extends UITextField {
addCaretListener(new CaretListener() { addCaretListener(new CaretListener() {
@Override @Override
public void caretUpdate(CaretEvent e) { public void caretUpdate(CaretEvent e) {
if (isInputMethodChange) { if (isInputMethodOnceInserting) {
isInputMethodChange = false; isInputMethodOnceInserting = false;
setCaretPosition(insertOffset); setCaretPosition(insertOffset);
} else { } else {
insertOffset = e.getDot(); insertOffset = e.getDot();
@ -219,7 +222,7 @@ public class UINumberField extends UITextField {
} }
public void remove(int offs, int len) throws BadLocationException { public void remove(int offs, int len) throws BadLocationException {
if (isInputMethodChange) { if (isInputMethodOnceInserting) {
return; return;
} }
super.remove(offs, len); super.remove(offs, len);

Loading…
Cancel
Save