()
| 356 | } |
| 357 | |
| 358 | protected void endEdit() { |
| 359 | text = text.trim(); //trim text after editing |
| 360 | if (!text.equals(textBeforeKeyInput)) { |
| 361 | if (validate()) { |
| 362 | if (changedHandler != null) { |
| 363 | //handle change event if text changed during input |
| 364 | changedHandler.handleEvent(new FEvent(FTextField.this, FEventType.CHANGE, textBeforeKeyInput)); |
| 365 | } |
| 366 | } |
| 367 | else { //restore previous text if new text isn't valid |
| 368 | setText(textBeforeKeyInput); |
| 369 | } |
| 370 | } |
| 371 | isEditing = false; |
| 372 | selStart = 0; |
| 373 | selLength = 0; |
| 374 | textBeforeKeyInput = null; |
| 375 | } |
| 376 | |
| 377 | @Override |
| 378 | public void draw(Graphics g) { |
no test coverage detected