Bug 469610 - Remove "Team" menu from the rulers in the textual editors
Summary: Remove "Team" menu from the rulers in the textual editors
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 4.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.5   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday, helpwanted
Depends on:
Blocks:
 
Reported: 2015-06-08 07:38 EDT by Lars Vogel CLA
Modified: 2016-09-20 00:51 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2015-06-08 07:38:25 EDT
I'm not 100 % what our guidelines are for putting something in the right-click menu of an editor but Team feels definitely misplaced.
Comment 1 Dani Megert CLA 2015-06-09 08:12:54 EDT
(In reply to Lars Vogel from comment #0)
> I'm not 100 % what our guidelines are for putting something in the
> right-click menu of an editor but Team feels definitely misplaced.

I agree, but this comes from EGit (I don't see it when using CVS).

Note that it appears in the left and the right ruler.
Comment 2 Lars Vogel CLA 2015-06-09 13:26:45 EDT
Matthias, can you remove the EGit Team entries from the ruler?
Comment 3 Andrey Loskutov CLA 2015-06-09 15:00:46 EDT
The code looks OK, to fix this bug one must restrict the menu NOT to show in particular popup, because currently it should be added to every popup with "additions" group:

<menuContribution locationURI="popup:org.eclipse.ui.popup.any?after=additions">
   <menu id="team.main" label="%TeamMenu.label">

It would be nice to add some restrictions, like:
            <visibleWhen>
               <not>
                  <equals
                        value="#AbstractTextEditorRulerContext">
                  </equals>
               </not>
            </visibleWhen>

but how one can check in which context menu the entry is shown? Ideas?

Or should we restrict egit menu only to be shown in few known "explorers"? I was not involved in the original design decisions and it would be nice to know why the menu was contributed to every "additions" popup.
Comment 4 Dani Megert CLA 2015-06-09 15:27:17 EDT
(In reply to Andrey Loskutov from comment #3)
> but how one can check in which context menu the entry is shown? Ideas?

Look at the Eclipse CVS plug-in which does it correctly.
Comment 5 Dani Megert CLA 2015-08-12 11:25:11 EDT
The correct approach would be to use

   <extension
         point="org.eclipse.ui.popupMenus">
      <objectContribution

which makes sure the menu (only) appears when the selection contains the targeted object(s).
Comment 6 Lars Vogel CLA 2016-09-19 08:57:49 EDT
Adding Thomas, how fixed a similar issue in EGerrit, via https://git.eclipse.org/r/#/c/81244/
Comment 7 Thomas Wolf CLA 2016-09-19 17:51:50 EDT
(In reply to Lars Vogel from comment #6)
> Adding Thomas, how fixed a similar issue in EGerrit, via
> https://git.eclipse.org/r/#/c/81244/

That was a completely different case :-)

Re comment #5: I'm not fond at all of using officially deprecated extension points. (And they've been deprecated for quite some while already.)

Anyway: in this case EGit *does* contribute its items only when the edited file as determined from the IEditorInput is indeed in a git repository. So it does already make sure "the menu (only) appears when the selection contains the targeted object(s)."

I think Andrey had the right idea: exclude it specifically for the "#AbstractTextEditorRulerContext" menu id. The menu id can be tested using <with variable="activeMenu">.
Comment 8 Eclipse Genie CLA 2016-09-19 17:53:48 EDT
New Gerrit change created: https://git.eclipse.org/r/81395
Comment 9 Eclipse Genie CLA 2016-09-20 00:51:18 EDT
Gerrit change https://git.eclipse.org/r/81395 was merged to [stable-4.5].
Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=d4a9be808decaee72119ba6f0d21f6f0c8c6cf54