Changeset 4109 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2011-06-01T20:57:34+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r4107 r4109 364 364 } 365 365 366 private static String lastAddKey = null; 367 private static String lastAddValue = null; 366 368 /** 367 369 * Open the add selection dialog and add a new key/value to the table (and … … 380 382 List<AutoCompletionListItem> keyList = autocomplete.getKeys(); 381 383 384 AutoCompletionListItem itemToSelect = null; 382 385 // remove the object's tag keys from the list 383 386 Iterator<AutoCompletionListItem> iter = keyList.iterator(); 384 387 while (iter.hasNext()) { 385 388 AutoCompletionListItem item = iter.next(); 389 if (item.getValue().equals(lastAddKey)) { 390 itemToSelect = item; 391 } 386 392 for (int i = 0; i < propertyData.getRowCount(); ++i) { 387 393 if (item.getValue().equals(propertyData.getValueAt(i, 0))) { 394 if (itemToSelect == item) 395 itemToSelect = null; 388 396 iter.remove(); 389 397 break; … … 404 412 values.setEditable(true); 405 413 p2.add(values, BorderLayout.CENTER); 414 if (itemToSelect != null) { 415 keys.setSelectedItem(itemToSelect); 416 values.setSelectedItem(lastAddValue); 417 } 406 418 407 419 FocusAdapter focus = addFocusAdapter(-1, keys, values, autocomplete); … … 425 437 if (value.equals("")) 426 438 return; 439 lastAddKey = key; 440 lastAddValue = value; 427 441 Main.main.undoRedo.add(new ChangePropertyCommand(sel, key, value)); 428 442 btnAdd.requestFocusInWindow();
Note:
See TracChangeset
for help on using the changeset viewer.