[vcs-log] avoid triggering calculating changes for changes browser when restoring selection is in progress

This commit is contained in:
Julia Beliaeva
2015-06-16 15:41:55 +03:00
parent db531b5f33
commit dc9cc16e05
2 changed files with 4 additions and 2 deletions
@@ -339,7 +339,8 @@ public class MainFrame extends JPanel implements TypeSafeDataProvider {
}
@Override
public void valueChanged(@Nullable ListSelectionEvent notUsed) {
public void valueChanged(@Nullable ListSelectionEvent event) {
if (event != null && event.getValueIsAdjusting()) return;
int rows = getGraphTable().getSelectedRowCount();
if (rows < 1 || rows > MAX_SELECTED_COMMITS) {
myChangesLoadingPane.stopLoading();
@@ -510,6 +510,7 @@ public class VcsLogGraphTable extends JBTable implements TypeSafeDataProvider, C
public void restore(@NotNull VisibleGraph<Integer> newVisibleGraph, boolean scrollToSelection) {
Pair<TIntHashSet, Integer> toSelectAndScroll = findRowsToSelectAndScroll(myTable.getGraphTableModel(), newVisibleGraph);
if (!toSelectAndScroll.first.isEmpty()) {
myTable.getSelectionModel().setValueIsAdjusting(true);
toSelectAndScroll.first.forEach(new TIntProcedure() {
@Override
public boolean execute(int row) {
@@ -517,7 +518,7 @@ public class VcsLogGraphTable extends JBTable implements TypeSafeDataProvider, C
return true;
}
});
myTable.getSelectionModel().setValueIsAdjusting(false);
}
if (scrollToSelection) {
if (myScrollToTop) {