Changeset 7863 in josm for trunk/src/org
- Timestamp:
- 2014-12-20T22:08:29+01:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java
r7632 r7863 247 247 } 248 248 super.setSelectedItem(new AutoCompletionListItem(s, AutoCompletionItemPriority.UNKNOWN)); 249 } else 250 throw new IllegalArgumentException(); 249 } else { 250 throw new IllegalArgumentException("Unsupported item: "+item); 251 } 251 252 } 252 253 -
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionListItem.java
r6437 r7863 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.gui.tagging.ac; 3 4 import org.openstreetmap.josm.tools.CheckParameterUtil; 3 5 4 6 /** … … 79 81 */ 80 82 public void setValue(String value) { 81 if (value == null) 82 throw new IllegalArgumentException("argument 'value' must not be null"); 83 CheckParameterUtil.ensureParameterNotNull(value, "value"); 83 84 this.value = value; 84 85 } … … 108 109 if (obj == null) 109 110 return false; 111 if (obj instanceof String) 112 return obj.equals(value); 110 113 if (getClass() != obj.getClass()) 111 114 return false; -
trunk/src/org/openstreetmap/josm/gui/widgets/JosmComboBox.java
r7015 r7863 160 160 JList<E> list = getList(); 161 161 if (list != null) { 162 if ( list.getPrototypeCellValue() != prototype) {162 if (!prototype.equals(list.getPrototypeCellValue())) { 163 163 list.setPrototypeCellValue(prototype); 164 164 } … … 197 197 198 198 private void enableMenu() { 199 if (launcher == null) { 200 if (editor != null) { 201 Component editorComponent = editor.getEditorComponent(); 202 if (editorComponent instanceof JTextComponent) { 203 component = (JTextComponent) editorComponent; 204 component.addMouseListener(this); 205 launcher = TextContextualPopupMenu.enableMenuFor(component); 206 } 199 if (launcher == null && editor != null) { 200 Component editorComponent = editor.getEditorComponent(); 201 if (editorComponent instanceof JTextComponent) { 202 component = (JTextComponent) editorComponent; 203 component.addMouseListener(this); 204 launcher = TextContextualPopupMenu.enableMenuFor(component); 207 205 } 208 206 } … … 229 227 230 228 private void processEvent(MouseEvent e) { 231 if (launcher != null && !e.isPopupTrigger()) { 232 if (launcher.getMenu().isShowing()) { 233 launcher.getMenu().setVisible(false); 234 } 229 if (launcher != null && !e.isPopupTrigger() && launcher.getMenu().isShowing()) { 230 launcher.getMenu().setVisible(false); 235 231 } 236 232 }
Note:
See TracChangeset
for help on using the changeset viewer.