[stagingView] Fix selection after showing view initially
commitbac5bef0ccdae498729cd71a7372fe78147c8490
authorRobin Stocker <robin@nibor.org>
Thu, 19 Sep 2013 20:13:04 +0000 (19 22:13 +0200)
committerRobin Stocker <robin@nibor.org>
Thu, 19 Sep 2013 20:13:04 +0000 (19 22:13 +0200)
treee0948a3e3bfeea696b6c2f85244ad9e2cbd6c6f8
parent47cb869505e1134e196b843a68ebb6f4a19cefa0
[stagingView] Fix selection after showing view initially

How to reproduce:

1. Close the view
2. Select a file in a project connected to a repo
3. Show the staging view

Expected: The view is linked with the repo from step 2
Actual: It shows "No Repository Selected"

The problem was that getActivePart in the old code returned null in the
above case. Going via the active workbench window didn't change that.
What works is getting it via execution context.

Bug: 417310
Change-Id: Ib27b9683e52b62f885cb310ce9f177c021cafe94
Signed-off-by: Robin Stocker <robin@nibor.org>
org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIUtils.java
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/reflog/ReflogView.java
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java