Changeset 18313 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2021-11-06T23:09:06+01:00 (3 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
r18221 r18313 434 434 */ 435 435 public static String getEditItem(AutoCompComboBox<AutoCompletionItem> cb) { 436 return Utils.removeWhiteSpaces(cb.getEditor ().getItem().toString());436 return Utils.removeWhiteSpaces(cb.getEditorItemAsString()); 437 437 } 438 438 -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Text.java
r18254 r18313 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.util.ArrayList;7 6 import java.awt.Color; 8 7 import java.awt.Component; … … 11 10 import java.text.NumberFormat; 12 11 import java.text.ParseException; 12 import java.util.ArrayList; 13 13 import java.util.Collection; 14 14 import java.util.Collections; … … 223 223 private static String getValue(Component comp) { 224 224 if (comp instanceof JosmComboBox) { 225 return ((JosmComboBox<?>) comp).getEditor ().getItem().toString();225 return ((JosmComboBox<?>) comp).getEditorItemAsString(); 226 226 } else if (comp instanceof JosmTextField) { 227 227 return ((JosmTextField) comp).getText(); -
trunk/src/org/openstreetmap/josm/gui/widgets/HistoryComboBox.java
r18305 r18313 29 29 */ 30 30 public void addCurrentItemToHistory() { 31 String newItem = getModel().addTopElement(getEditor().getItem().toString()); 32 getModel().setSelectedItem(newItem); 31 String item = getEditorItemAsString(); 32 if (item != null) { 33 getModel().setSelectedItem(getModel().addTopElement(item)); 34 } 33 35 } 34 36 } -
trunk/src/org/openstreetmap/josm/gui/widgets/JosmComboBox.java
r18280 r18313 170 170 public JosmTextField getEditorComponent() { 171 171 return (JosmTextField) (editor == null ? null : editor.getEditorComponent()); 172 } 173 174 /** 175 * Returns the string representation of current edited item, or null. 176 * @return the string representation of current edited item, or null 177 * @since 18313 178 */ 179 public String getEditorItemAsString() { 180 return editor != null && editor.getItem() != null ? editor.getItem().toString() : null; 172 181 } 173 182
Note:
See TracChangeset
for help on using the changeset viewer.