Changeset 14856 in josm


Ignore:
Timestamp:
2019-03-09T14:41:04+01:00 (7 months ago)
Author:
GerdP
Message:

see #17412 if validator tree is rebuild, try to re-select the error row that was selected before.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java

    r14850 r14856  
    162162        sortErrors(errors);
    163163
     164        // Remember first selected tree row
     165        TreePath selPath = getSelectionPath();
     166        int selRow = selPath == null ? -1 : getRowForPath(selPath);
     167
    164168        // Remember the currently expanded rows
    165169        Set<Object> oldSelectedRows = new HashSet<>();
     
    270274        }
    271275
     276        if (selRow >= 0 && selRow < getRowCount()) {
     277            setSelectionRow(selRow);
     278            scrollRowToVisible(selRow);
     279        }
     280
    272281        invalidationListeners.fireEvent(Runnable::run);
    273282    }
Note: See TracChangeset for help on using the changeset viewer.