- Timestamp:
- 2016-02-24T22:48:05+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/dialogs/properties
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r9833 r9877 45 45 import javax.swing.event.ListSelectionEvent; 46 46 import javax.swing.event.ListSelectionListener; 47 import javax.swing.event.RowSorterEvent; 48 import javax.swing.event.RowSorterListener; 47 49 import javax.swing.table.DefaultTableCellRenderer; 48 50 import javax.swing.table.DefaultTableModel; … … 309 311 tagTable.setRowSorter(tagRowSorter); 310 312 313 final RemoveHiddenSelection removeHiddenSelection = new RemoveHiddenSelection(); 314 tagTable.getSelectionModel().addListSelectionListener(removeHiddenSelection); 315 tagTable.getRowSorter().addRowSorterListener(removeHiddenSelection); 316 311 317 tagRowSorter.setComparator(0, AlphanumComparator.getInstance()); 312 318 tagRowSorter.setComparator(1, new Comparator<Object>() { … … 1417 1423 } 1418 1424 } 1425 1426 /** 1427 * Clears the row selection when it is filtered away by the row sorter. 1428 */ 1429 private class RemoveHiddenSelection implements ListSelectionListener, RowSorterListener { 1430 1431 void removeHiddenSelection() { 1432 try { 1433 tagTable.getRowSorter().convertRowIndexToModel(tagTable.getSelectedRow()); 1434 } catch (IndexOutOfBoundsException ignore) { 1435 Main.debug("Clearing tagTable selection, {0}", ignore.toString()); 1436 tagTable.clearSelection(); 1437 } 1438 } 1439 1440 @Override 1441 public void valueChanged(ListSelectionEvent event) { 1442 removeHiddenSelection(); 1443 } 1444 1445 @Override 1446 public void sorterChanged(RowSorterEvent e) { 1447 removeHiddenSelection(); 1448 } 1449 } 1419 1450 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
r9795 r9877 668 668 } 669 669 for (int i = 0; i < tagData.getRowCount(); ++i) { 670 if (item.getValue().equals( getDataKey(i))) {670 if (item.getValue().equals(tagData.getValueAt(i, 0) /* sic! do not use getDataKey*/)) { 671 671 if (itemToSelect == item) { 672 672 itemToSelect = null;
Note:
See TracChangeset
for help on using the changeset viewer.