aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Stocker2011-07-27 18:54:49 -0400
committerMatthias Sohn2011-07-27 18:54:49 -0400
commit20c95604c253c4607472c39af4f030d82aaaf1be (patch)
tree8c8e3dee39d7e950262d021a296fecf319d79805
parentbfecbe84cdd975c90e9d088d6b76d199af7694f7 (diff)
downloadegit-20c95604c253c4607472c39af4f030d82aaaf1be.zip
egit-20c95604c253c4607472c39af4f030d82aaaf1be.tar.gz
egit-20c95604c253c4607472c39af4f030d82aaaf1be.tar.xz
[historyView] Preserve commit selection on filter change
When switching between filter types (resource, project, repo), the selected commit is now preserved. Before this, the selection was lost each time, making it difficult to inspect a specific commit. Bug: 324736 Change-Id: I862254de4442542aeab6185deb60b643ef997f3d Signed-off-by: Robin Stocker <robin@nibor.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitGraphTable.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitGraphTable.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitGraphTable.java
index ec8fadc..ded2be5 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitGraphTable.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitGraphTable.java
@@ -181,8 +181,16 @@ class CommitGraphTable {
copy = createStandardAction(ActionFactory.COPY);
+ table.setUseHashlookup(true);
+
table.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
+ ISelection s = event.getSelection();
+ if (s.isEmpty() || !(s instanceof IStructuredSelection))
+ return;
+ final IStructuredSelection iss = (IStructuredSelection) s;
+ commitToShow = (PlotCommit<?>) iss.getFirstElement();
+
copy.setEnabled(canDoCopy());
}
});
@@ -253,7 +261,7 @@ class CommitGraphTable {
table.getTable().addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
- if ( allCommits != null)
+ if (allCommits != null)
allCommits.dispose();
if (renderer != null)
renderer.dispose();
@@ -394,7 +402,6 @@ class CommitGraphTable {
table.setInput(asArray);
if (asArray != null && asArray.length > 0) {
if (oldList != list) {
- selectCommit(asArray[0]);
initCommitsMap();
}
} else {