mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[vcs-log] avoid triggering calculating changes for changes browser when restoring selection is in progress
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user