Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 358936

Summary: Navigate > Show In > Package Explorer doesn't work in Git Repositories view
Product: [Technology] EGit Reporter: Markus Keller <markus.kell.r>
Component: UIAssignee: Robin Stocker <robin>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, remy.suen, robin
Version: 1.1   
Target Milestone: 2.3   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 383815    
Bug Blocks:    

Description Markus Keller CLA 2011-09-26 13:27:36 EDT
1.1.0.201109151100-r

Navigate > Show In > Package Explorer doesn't work in Git Repositories view. Same for other Show In targets like Navigator.

EGit should use the platform Show In support and provide a mapping for items in the "Working directory" to IResources if the item is already present in the workspace.
Comment 1 Dani Megert CLA 2012-08-30 05:28:21 EDT
(In reply to comment #0)
> EGit should use the platform Show In support and provide a mapping for items
> in the "Working directory" to IResources if the item is already present in
> the workspace.

We only need to be careful that things like Show In > Reflog, Show In > History and Show In > Properties still work the same with resources as input elements.
Comment 2 Robin Stocker CLA 2012-11-08 15:55:18 EST
Implementation pushed to review:

https://git.eclipse.org/r/8613
https://git.eclipse.org/r/8614

The tricky part was to also add a HistoryPageInput to the ShowInContext, so that showing history for multiple files still works.
Comment 3 Robin Stocker CLA 2012-11-11 18:06:49 EST
Blocked by bug 383815 in platform.ui, see comments on https://git.eclipse.org/r/8614.

The problem is that the <visibleWhen> in <dynamic> for the Show In menu is not evaluated in 4.2 (it works in 3.7), and so it is always shown regardless of the condition.

The problem can be shortened to this:

            <dynamic
                  class="org.eclipse.ui.ExtensionFactory:showInContribution"
                  id="org.eclipse.ui.menus.dynamicShowInMenu">
               <visibleWhen
                     checkEnabled="false">
                  <count value="!" />
               </visibleWhen>
            </dynamic>

With "!", the Show In menu should never be shown when there is a selection, but it is always shown (with "<No Applicable Views>" e.g. on the "Branches" node).
Comment 4 Robin Stocker CLA 2012-11-11 18:11:08 EST
A possible workaround may be to add the <dynamic> to a separate Show In <menu> and move the <visibleWhen> from <dynamic> up to the <menu>. Thoughts?
Comment 5 Robin Stocker CLA 2012-11-11 18:28:03 EST
(In reply to comment #4)
> A possible workaround may be to add the <dynamic> to a separate Show In
> <menu> and move the <visibleWhen> from <dynamic> up to the <menu>. Thoughts?

This works, see patch set 2.
Comment 6 Dani Megert CLA 2013-01-14 07:58:52 EST
Reviewed and merged:
https://git.eclipse.org/r/#/c/9373/
https://git.eclipse.org/r/#/c/8614/
Comment 7 Dani Megert CLA 2013-01-14 08:35:59 EST
One thing which is missing is 'Show In' on tags in the Repositories view. Filed bug 398075 to track that.
Comment 8 Dani Megert CLA 2013-01-15 06:38:55 EST
Verified in 2.3.0.201301150217.