From 259930857a2fef1f6304e552bd37c8caffc2b3b0 Mon Sep 17 00:00:00 2001 From: Julia Beliaeva Date: Tue, 24 Feb 2015 15:22:46 +0300 Subject: [PATCH] [vcs-log] minor: Selection explicitly depends on VcsLogGraphTable and therefore can be static --- .../vcs/log/ui/frame/VcsLogGraphTable.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/VcsLogGraphTable.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/VcsLogGraphTable.java index ab79d9af9be1..5f5aa460d640 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/VcsLogGraphTable.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/VcsLogGraphTable.java @@ -399,23 +399,25 @@ public class VcsLogGraphTable extends JBTable implements TypeSafeDataProvider, C @NotNull public Selection getSelection() { - return new Selection(); + return new Selection(this); } - public class Selection { + public static class Selection { private final TIntHashSet myCommits; + private final VcsLogGraphTable myTable; - public Selection() { - myCommits = getCommitsAtRows(myDataPack.getVisibleGraph(), getSelectedRows()); + public Selection(@NotNull VcsLogGraphTable table) { + myTable = table; + myCommits = getCommitsAtRows(myTable.myDataPack.getVisibleGraph(), myTable.getSelectedRows()); } public void restore(@NotNull VisibleGraph newVisibleGraph) { - TIntHashSet rowsToSelect = findNewRowsToSelect(getGraphTableModel(), newVisibleGraph, myCommits); + TIntHashSet rowsToSelect = findNewRowsToSelect(myTable.getGraphTableModel(), newVisibleGraph, myCommits); if (!rowsToSelect.isEmpty()) { rowsToSelect.forEach(new TIntProcedure() { @Override public boolean execute(int row) { - addRowSelectionInterval(row, row); + myTable.addRowSelectionInterval(row, row); return true; } });