Browse Source

CHART-18080 变量名更换

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

Loading…
Cancel
Save