Changeset 14338 in osm for applications/editors/josm
- Timestamp:
- 2009-03-29T20:01:34+02:00 (16 years ago)
- Location:
- applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/TagEditorDialog.java
r14323 r14338 173 173 aclViewer = new AutoCompletionListViewer(autoCompletionList); 174 174 tagEditor.setAutoCompletionList(autoCompletionList); 175 tagEditor.setAutoCompletionCache(acCache); 175 176 aclViewer.addAutoCompletionListListener(tagEditor); 176 177 … … 305 306 */ 306 307 public void startEditSession() { 307 model.initFromJOSMSelection(); 308 model.clearAppliedPresets(); 309 model.initFromJOSMSelection(); 308 310 acCache.initFromJOSMDataset(); 309 311 getModel().ensureOneTag(); -
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/PresetManager.java
r14325 r14338 85 85 Item item= (Item)presets.getSelectedItem(); 86 86 if (item != null && model !=null) { 87 model.removeApplied Item(item);87 model.removeAppliedPreset(item); 88 88 } 89 89 } -
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TableCellEditor.java
r14325 r14338 128 128 } 129 129 130 logger.info("acCache=" + acCache); 130 131 for (String value : acCache.getValues(forKey)) { 131 132 autoCompletionList.add( … … 225 226 editor.setAutoCompletionList(autoCompletionList); 226 227 } 228 229 public void setAutoCompletionCache(AutoCompletionCache acCache) { 230 this.acCache = acCache; 231 } 227 232 228 233 -
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagEditor.java
r14325 r14338 159 159 tblTagEditor.setAutoCompletionList(autoCompletionList); 160 160 } 161 162 public void setAutoCompletionCache(AutoCompletionCache acCache) { 163 tblTagEditor.setAutoCompletionCache(acCache); 164 } 161 165 162 166 @Override -
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagEditorModel.java
r14325 r14338 457 457 } else { 458 458 TagModel tagModel = get(tag.getKey()); 459 tagModel.setValue(tag.getValue()); 459 // only overwrite an existing value if the preset 460 // proposes a value. I.e. don't overwrite 461 // existing values for tag 'name' with an empty string 462 // 463 if (tag.getValue() != null) { 464 tagModel.setValue(tag.getValue()); 465 } 460 466 } 461 467 } … … 491 497 } 492 498 493 public void removeApplied Item(Item item) {499 public void removeAppliedPreset(Item item) { 494 500 if (item == null) { 495 501 return; … … 520 526 } 521 527 528 public void clearAppliedPresets() { 529 appliedPresets.removeAllElements(); 530 fireTableDataChanged(); 531 } 532 522 533 public void highlightCurrentPreset() { 523 534 fireTableDataChanged(); -
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagTable.java
r14325 r14338 29 29 import javax.swing.table.TableModel; 30 30 31 import org.openstreetmap.josm.plugins.tageditor.ac.AutoCompletionCache; 31 32 import org.openstreetmap.josm.plugins.tageditor.ac.AutoCompletionList; 32 33 … … 402 403 } 403 404 405 public void setAutoCompletionCache(AutoCompletionCache acCache) { 406 if (acCache == null) { 407 logger.warning("argument acCache should not be null. Aborting."); 408 return; 409 } 410 if (editor != null) { 411 editor.setAutoCompletionCache(acCache); 412 } 413 } 414 404 415 public AutoCompletionList getAutoCompletionList() { 405 416 if (editor != null) {
Note:
See TracChangeset
for help on using the changeset viewer.