Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 358936 - Navigate > Show In > Package Explorer doesn't work in Git Repositories view
Summary: Navigate > Show In > Package Explorer doesn't work in Git Repositories view
Status: VERIFIED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 1.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 2.3   Edit
Assignee: Robin Stocker CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 383815
Blocks:
  Show dependency tree
 
Reported: 2011-09-26 13:27 EDT by Markus Keller CLA
Modified: 2013-01-15 06:38 EST (History)
3 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-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.