Changeset 4525 in josm


Ignore:
Timestamp:
2011-10-19T03:08:48+02:00 (13 years ago)
Author:
Don-vip
Message:

fix #6899 - The visual selection of the "current version" in the history dialog is cleared when the "target primitive" is edited.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/history/VersionTable.java

    r4498 r4525  
    1616import javax.swing.event.ListSelectionEvent;
    1717import javax.swing.event.ListSelectionListener;
     18import javax.swing.event.TableModelEvent;
    1819
    1920import org.openstreetmap.josm.actions.AbstractInfoAction;
     
    8283    public void update(Observable o, Object arg) {
    8384        repaint();
     85    }
     86
     87    /* (non-Javadoc)
     88     * @see javax.swing.JTable#tableChanged(javax.swing.event.TableModelEvent)
     89     */
     90    @Override
     91    public void tableChanged(TableModelEvent e) {
     92        int selectedRow = getSelectedRow();
     93        super.tableChanged(e);
     94        // Restore list selection (fix #6899)
     95        if (selectedRow > -1 && selectedRow < getRowCount()) {
     96            getSelectionModel().setSelectionInterval(0, selectedRow);
     97        }
    8498    }
    8599
Note: See TracChangeset for help on using the changeset viewer.