Community
Participate
Working Groups
I20060315-1200 I keep trying to run the "Show Annotation" action from the annotation ruler context menu. Since the action now directly affects the annotation ruler, I think it should also appear in that context menu.
*** Bug 133510 has been marked as a duplicate of this bug. ***
Any chance to include this into 3.2?
Tom, can 3rd parties contribute menu items to the annotation ruler?
(In reply to comment #3) > Tom, can 3rd parties contribute menu items to the annotation ruler? The ruler context menu is not specific per column, rather there is just a single context menu for the entire ruler. 3rd parties can contribute to the ruler context menu by contributing a viewerContribution to the org.eclipse.ui.popupMenus extension point - however, there is a caveat: Such contributions only work for a concrete instance of an editor (e.g. the Java editor), not on all text editors. The problem is really that a context menu can be registered for extension under only one ID - but in our case, we'd want to get generic (for all text editors) contributions as well as editor specific contributions... You could use ITextEditorExtension::addRulerContextMenuListener which would inform you about the context menu being shown, and which would give you the chance to add a menu entry. However, for this to work you would need to register your menu listener on every text editor, which you may not want to track... -- I see this is a problem - the other side of it is that it is a bad idea IMO for text to add menu entries (and actions and commands) for team-related functionality such as annotate. Ideally, a similar mechanism should exist as for the context menu, where you contribute objectContributions that go via IAdaptable...
Based on Tom's comment, I don't think this is a good candidate for 3.2. To do this right, there would need to be some way for the QuickDiff provider to contribute a menu to the bar. I have logged bug 134526 to request this ability.
*** Bug 180991 has been marked as a duplicate of this bug. ***
Time permitting for 3.3.
The required support for this was not put in place for 3.3 so we'll need to defer this.
Dependent bug 134526 is now almost there. What we need from CVS is a property tester for the action enablement in plugin.xml. It looks like there's already something in progress (commented out in /org.eclipse.team.cvs.ui/plugin.xml). This would test the editor input (access to editor input is the last remaining issue in Platform UI bug 134526).
Here's my current code which adds the action to all editors but unfortunately also in the case where the editor is open a non-shared file: <extension point="org.eclipse.ui.menus"> <menuContribution locationURI="popup:#AbstractTextEditorRulerContext?after=QuickDiff.Toggle"> <command commandId="org.eclipse.team.cvs.ui.showAnnotation" style="push"> </command> </menuContribution> </extension>
(In reply to comment #10) When Show Annotation from the vertical ruler popup is called the first time, it starts to work as expected. It means that the next time when the popup is shown, the item is enabled only for shared files. This happens because before the first call, the show annotation delegate is not instantiated and its #isEnabled method is not consulted. I would like to see an option to force using #isEnable always, so far we have to create a tester that duplicates ShowAnnotationAction#isEnabled code.
Created attachment 133517 [details] Patch_v01
Patch_v01 released to HEAD.
Verified in I20090429-0100. Minor issue: the menu has no mnemonic (see bug 274264).