Changeset 17894 in josm for trunk/src/org
- Timestamp:
- 2021-05-15T21:12:23+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/io/BasicUploadSettingsPanel.java
r17709 r17894 28 28 import javax.swing.event.ChangeEvent; 29 29 import javax.swing.event.ChangeListener; 30 import javax.swing.event.DocumentEvent; 31 import javax.swing.event.DocumentListener; 30 32 import javax.swing.event.HyperlinkEvent; 31 33 … … 96 98 hcbUploadComment.getEditor().addActionListener(commentModelListener); 97 99 hcbUploadComment.getEditorComponent().addFocusListener(commentModelListener); 100 hcbUploadComment.getEditorComponent().getDocument().addDocumentListener(commentModelListener); 98 101 pnl.add(hcbUploadComment, GBC.eol().fill(GBC.HORIZONTAL)); 99 102 pnl.add(uploadCommentFeedback, GBC.eol().insets(0, 3, 0, 0).fill(GBC.HORIZONTAL)); … … 133 136 hcbUploadSource.getEditor().addActionListener(sourceModelListener); 134 137 hcbUploadSource.getEditorComponent().addFocusListener(sourceModelListener); 138 hcbUploadSource.getEditorComponent().getDocument().addDocumentListener(sourceModelListener); 135 139 pnl.add(hcbUploadSource, GBC.eol().fill(GBC.HORIZONTAL)); 136 140 pnl.add(hcbUploadSourceFeedback, GBC.eol().insets(0, 3, 0, 0).fill(GBC.HORIZONTAL)); … … 350 354 * Updates the changeset comment model upon changes in the input field. 351 355 */ 352 static class CommentModelListener extends FocusAdapter implements ActionListener {356 static class CommentModelListener extends FocusAdapter implements ActionListener, DocumentListener { 353 357 354 358 private final HistoryComboBox source; … … 360 364 } 361 365 366 private void setComment() { 367 destination.setComment(source.getText()); 368 } 369 362 370 @Override 363 371 public void actionPerformed(ActionEvent e) { 364 destination.setComment(source.getText());372 setComment(); 365 373 } 366 374 367 375 @Override 368 376 public void focusLost(FocusEvent e) { 369 destination.setComment(source.getText()); 377 setComment(); 378 } 379 380 @Override 381 public void insertUpdate(DocumentEvent e) { 382 setComment(); 383 } 384 385 @Override 386 public void removeUpdate(DocumentEvent e) { 387 setComment(); 388 } 389 390 @Override 391 public void changedUpdate(DocumentEvent e) { 392 setComment(); 370 393 } 371 394 }
Note:
See TracChangeset
for help on using the changeset viewer.