Changeset 17713 in josm
- Timestamp:
- 2021-04-07T23:41:11+02:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
r17450 r17713 62 62 import javax.swing.event.CellEditorListener; 63 63 import javax.swing.event.ChangeEvent; 64 import javax.swing.event.DocumentEvent;65 import javax.swing.event.DocumentListener;66 64 import javax.swing.event.ListSelectionEvent; 67 65 import javax.swing.event.ListSelectionListener; … … 86 84 import org.openstreetmap.josm.gui.MainApplication; 87 85 import org.openstreetmap.josm.gui.PleaseWaitRunnable; 86 import org.openstreetmap.josm.gui.util.DocumentAdapter; 88 87 import org.openstreetmap.josm.gui.util.FileFilterAllFiles; 89 88 import org.openstreetmap.josm.gui.util.GuiHelper; … … 831 830 832 831 // Make OK button enabled only when a file/URL has been set 833 tfURL.getDocument().addDocumentListener(new DocumentListener() { 834 @Override 835 public void insertUpdate(DocumentEvent e) { 836 updateOkButtonState(); 837 } 838 839 @Override 840 public void removeUpdate(DocumentEvent e) { 841 updateOkButtonState(); 842 } 843 844 @Override 845 public void changedUpdate(DocumentEvent e) { 846 updateOkButtonState(); 847 } 848 }); 832 tfURL.getDocument().addDocumentListener(DocumentAdapter.create(ignore -> updateOkButtonState())); 849 833 } 850 834 -
trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java
r17331 r17713 33 33 import javax.swing.JPopupMenu; 34 34 import javax.swing.JScrollPane; 35 import javax.swing.event.DocumentEvent;36 import javax.swing.event.DocumentListener;37 35 import javax.swing.event.MenuEvent; 38 36 import javax.swing.event.MenuListener; … … 53 51 import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory; 54 52 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 53 import org.openstreetmap.josm.gui.util.DocumentAdapter; 55 54 import org.openstreetmap.josm.gui.util.GuiHelper; 56 55 import org.openstreetmap.josm.gui.widgets.AbstractFileChooser; … … 174 173 txtFilterPanel.add(lbFilter, GBC.std().insets(0, 0, 5, 0)); 175 174 txtFilterPanel.add(txtFilter, GBC.eol().fill(GBC.HORIZONTAL)); 176 txtFilter.getDocument().addDocumentListener(new DocumentListener() { 177 @Override 178 public void changedUpdate(DocumentEvent e) { 179 action(); 180 } 181 182 @Override 183 public void insertUpdate(DocumentEvent e) { 184 action(); 185 } 186 187 @Override 188 public void removeUpdate(DocumentEvent e) { 189 action(); 190 } 191 192 private void action() { 193 applyFilter(); 194 } 195 }); 175 txtFilter.getDocument().addDocumentListener(DocumentAdapter.create(ignore -> applyFilter())); 196 176 readPreferences(Preferences.main()); 197 177 -
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddImageryPanel.java
r14302 r17713 21 21 import javax.swing.JSpinner; 22 22 import javax.swing.SpinnerNumberModel; 23 import javax.swing.event.DocumentEvent;24 import javax.swing.event.DocumentListener;25 23 import javax.swing.text.JTextComponent; 26 24 … … 29 27 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType; 30 28 import org.openstreetmap.josm.data.imagery.TMSCachedTileLoaderJob; 29 import org.openstreetmap.josm.gui.util.DocumentAdapter; 31 30 import org.openstreetmap.josm.gui.widgets.JosmTextArea; 32 31 import org.openstreetmap.josm.gui.widgets.JosmTextField; … … 138 137 139 138 protected final void registerValidableComponent(JTextComponent component) { 140 component.getDocument().addDocumentListener(new DocumentListener() { 141 @Override 142 public void removeUpdate(DocumentEvent e) { 143 notifyListeners(); 144 } 145 146 @Override 147 public void insertUpdate(DocumentEvent e) { 148 notifyListeners(); 149 } 150 151 @Override 152 public void changedUpdate(DocumentEvent e) { 153 notifyListeners(); 154 } 155 }); 139 component.getDocument().addDocumentListener(DocumentAdapter.create(ignore -> notifyListeners())); 156 140 } 157 141 -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Text.java
r17651 r17713 22 22 import javax.swing.JPanel; 23 23 import javax.swing.JToggleButton; 24 import javax.swing.event.DocumentEvent;25 import javax.swing.event.DocumentListener;26 24 27 25 import org.openstreetmap.josm.data.osm.Tag; … … 30 28 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItem; 31 29 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport; 30 import org.openstreetmap.josm.gui.util.DocumentAdapter; 32 31 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 33 32 import org.openstreetmap.josm.gui.widgets.JosmTextField; … … 250 249 251 250 private void setupListeners(AutoCompletingTextField textField, TaggingPresetItemGuiSupport support) { 252 textField.getDocument().addDocumentListener(new DocumentListener() { 253 @Override 254 public void insertUpdate(DocumentEvent e) { 255 support.fireItemValueModified(Text.this, key, textField.getText()); 256 } 257 258 @Override 259 public void removeUpdate(DocumentEvent e) { 260 support.fireItemValueModified(Text.this, key, textField.getText()); 261 } 262 263 @Override 264 public void changedUpdate(DocumentEvent e) { 265 support.fireItemValueModified(Text.this, key, textField.getText()); 266 } 267 }); 251 textField.getDocument().addDocumentListener(DocumentAdapter.create(ignore -> 252 support.fireItemValueModified(Text.this, key, textField.getText()))); 268 253 269 254 if (valueTemplate != null) { -
trunk/src/org/openstreetmap/josm/gui/widgets/SearchTextResultListPanel.java
r17333 r17713 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.gui.widgets; 3 4 import org.openstreetmap.josm.gui.util.DocumentAdapter; 3 5 4 6 import java.awt.BorderLayout; … … 16 18 import javax.swing.JScrollPane; 17 19 import javax.swing.ListSelectionModel; 18 import javax.swing.event.DocumentEvent;19 import javax.swing.event.DocumentListener;20 20 import javax.swing.event.ListSelectionListener; 21 21 … … 44 44 45 45 edSearchText = new JosmTextField(); 46 edSearchText.getDocument().addDocumentListener(new DocumentListener() { 47 @Override 48 public void removeUpdate(DocumentEvent e) { 49 filterItems(); 50 } 51 52 @Override 53 public void insertUpdate(DocumentEvent e) { 54 filterItems(); 55 } 56 57 @Override 58 public void changedUpdate(DocumentEvent e) { 59 filterItems(); 60 } 61 }); 46 edSearchText.getDocument().addDocumentListener(DocumentAdapter.create(ignore -> filterItems())); 62 47 edSearchText.addKeyListener(new KeyAdapter() { 63 48 @Override
Note:
See TracChangeset
for help on using the changeset viewer.