Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363567 - Navigate > Show In > Package Explorer doesn't work in commit viewer, History view, Git Staging view
Summary: Navigate > Show In > Package Explorer doesn't work in commit viewer, History ...
Status: VERIFIED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 1.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 2.2   Edit
Assignee: Robin Stocker CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 388434
Blocks:
  Show dependency tree
 
Reported: 2011-11-11 06:09 EST by Markus Keller CLA
Modified: 2012-11-26 11:27 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2011-11-11 06:09:50 EST
Navigate > Show In > Package Explorer doesn't work in commit viewer and in the History view. This should work for single and multi selections.

In the commit viewer, some views appear in the submenu, but the actions don't work. In the History view, no targets are available at all.
Comment 1 Markus Keller CLA 2012-01-12 05:31:50 EST
Also doesn't work in Git Staging view.
Comment 2 Robin Stocker CLA 2012-11-07 11:35:05 EST
Patch for history view and commit viewer:

https://git.eclipse.org/r/8569
Comment 3 Robin Stocker CLA 2012-11-12 16:21:05 EST
The pushed patch works well in Eclipse 3.7, but not at all in 4.2. I found bug 388434 for platform UI, which may be the cause.

Dani: You filed the above bug, can you confirm that this could also be the problem here?
Comment 4 Robin Stocker CLA 2012-11-12 16:33:30 EST
(In reply to comment #3)
> The pushed patch works well in Eclipse 3.7, but not at all in 4.2.

Correction: In 4.2, it disregards the selection of the ShowInContext but instead seems to show the current history page input. To reproduce:

1. Link the history view with the selection
2. Use the Package Explorer to show the history of org.eclipse.jgit
3. Select any commit and a file in the files section and then Show In > Navigator

Expected: Shows the selected file
Actual: Shows org.eclipse.jgit (the input)
Comment 5 Dani Megert CLA 2012-11-13 10:46:19 EST
(In reply to comment #3)
> The pushed patch works well in Eclipse 3.7, but not at all in 4.2. I found
> bug 388434 for platform UI, which may be the cause.
> 
> Dani: You filed the above bug, can you confirm that this could also be the
> problem here?

Yes and this is fixed in recent 4.x builds/streams and the fix works nicely. I've mentioned some minor issues in the change which are easy to correct.

I assume you will also do the Staging view then?

Once we've done all that, we should make one class for the ShowInMenu where we also fix the missing key binding (Ctrl+Shift+W by default). E.g. org.eclipse.jdt.ui.actions.OpenViewActionGroup.getShowInMenuLabel() shows how to do this.
Comment 6 Robin Stocker CLA 2012-11-13 15:54:56 EST
(In reply to comment #5)
> I assume you will also do the Staging view then?

Yes, I plan to (just wanted to keep the change small).

> Once we've done all that, we should make one class for the ShowInMenu where
> we also fix the missing key binding (Ctrl+Shift+W by default). E.g.
> org.eclipse.jdt.ui.actions.OpenViewActionGroup.getShowInMenuLabel() shows
> how to do this.

Ok, sounds good. For reference:

http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenViewActionGroup.java#n282
Comment 7 Robin Stocker CLA 2012-11-14 08:52:00 EST
Change for Staging view (only Navigate > Show In):

https://git.eclipse.org/r/8693
Comment 8 Dani Megert CLA 2012-11-15 05:42:17 EST
(In reply to comment #7)
> Change for Staging view (only Navigate > Show In):
> 
> https://git.eclipse.org/r/8693

Merged with http://git.eclipse.org/c/egit/egit.git/commit/?id=8c5e9e0320f0bbfdb0754b3f8bb98116b88d883b


While reviewing the change I noticed that in the History view one can't go to the Git Repositories view if the resource is not in the workspace. It would make sense to allow this (yes, unfortunately it will also allow to select the Package Explorer - like in the Staging view now - but that's better than not being able to go to the Repo view).

And I assume you will work on the Staging view's context menu too :-).
Comment 9 Robin Stocker CLA 2012-11-15 16:19:00 EST
(In reply to comment #8)
> While reviewing the change I noticed that in the History view one can't go
> to the Git Repositories view if the resource is not in the workspace. It
> would make sense to allow this (yes, unfortunately it will also allow to
> select the Package Explorer - like in the Staging view now - but that's
> better than not being able to go to the Repo view).

Good catch, and I agree. Here's the implementation for all three views:

https://git.eclipse.org/r/8725

> And I assume you will work on the Staging view's context menu too :-).

I was not sure whether we should extend the menu, but as it's only one entry, I think it's good to have. I just don't want the menu to end up like the one for commits in the history view, which is huge.

So, yes :).
Comment 10 Robin Stocker CLA 2012-11-15 16:37:43 EST
(In reply to comment #9)
> I just don't want the menu to end up like the one for commits in the history view, which is huge.

This change would reduce it somewhat: https://git.eclipse.org/r/8726
Comment 11 Robin Stocker CLA 2012-11-15 17:07:10 EST
Staging view context menu, including the key binding if there is one:

https://git.eclipse.org/r/8727
Comment 12 Matthias Sohn CLA 2012-11-16 18:17:34 EST
(In reply to comment #11)
> Staging view context menu, including the key binding if there is one:
> 
> https://git.eclipse.org/r/8727

merged as c2b729b9aa02fed299f25ebd4b62f2f0f16d033f
Comment 13 Robin Stocker CLA 2012-11-22 07:24:26 EST
Change to unify Show In menu creation and add the missing key binding:

https://git.eclipse.org/r/8813

This is the last change needed here, right?
Comment 14 Dani Megert CLA 2012-11-22 08:41:49 EST
(In reply to comment #12)
> (In reply to comment #11)
> > Staging view context menu, including the key binding if there is one:
> > 
> > https://git.eclipse.org/r/8727
> 
> merged as c2b729b9aa02fed299f25ebd4b62f2f0f16d033f

Verified in Verified in 2.2.0.201211220013.
Comment 15 Dani Megert CLA 2012-11-22 09:08:52 EST
(In reply to comment #13)
> Change to unify Show In menu creation and add the missing key binding:
> 
> https://git.eclipse.org/r/8813
> 
> This is the last change needed here, right?

Merged with http://git.eclipse.org/c/egit/egit.git/commit/?id=415284a5a872ed9e6405181af3645665a0e65a84
Comment 16 Dani Megert CLA 2012-11-26 08:59:02 EST
Verified in 2.2.0.201211260013.