Bug 274691 - [Actions] 'Show Annotation' in change ruler and context menu stays when annotations shown
Summary: [Actions] 'Show Annotation' in change ruler and context menu stays when annot...
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: CVS (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: platform-cvs-inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
: 309287 361266 505939 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-05-01 15:56 EDT by Markus Keller CLA
Modified: 2021-07-29 17:23 EDT (History)
7 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 2009-05-01 15:56:44 EDT
I20090430-2300

The 'Show Annotation' action in the change ruler context menu stays even when annotations are already shown.

It should either be hidden or get a check mark like 'Show Quick Diff' and 'Show Line Numbers'. The checked action has to remove the annotation, of course.
Comment 1 Dani Megert CLA 2009-05-04 03:42:46 EDT
Same issue with the action from the Team> context menu and it is like that for years.
Comment 2 Markus Keller CLA 2009-05-04 06:01:40 EDT
> Same issue with the action from the Team> context menu [..]

The difference is the context. It's not a big deal in the Team submenu. But in the ruler context menu, it looks strange next to the other "Show ..." toggle actions.
Comment 3 Szymon Brandys CLA 2009-05-05 05:10:23 EDT
We should try to address it for 3.5.
Comment 4 Pawel Pogorzelski CLA 2009-05-06 18:28:42 EDT
Let me update the status of investigation on this bug.

The "Show Annotation" item in vertical ruler menu is contributed via org.eclipse.ui.menus extension point. In command/handlers world it can be toggled using IElementUpdater interface. I tried to add this interface to ShowAnnotationAction (which is a handler) with no success. This is because ShowAnnotationAction is also used in other places where it's contributed via legacy object/editor contribution facilities. This causes the compatibility layer (more specific ActionDelegateHandlerProxy) to be used between the command and the ShowAnnotaionAction. The compatibility layer used doesn't support IElementUpdater so it's impossible to toggle a vertical menu contribution via it.

What I found is that defining another command (say ShowAnnotation2) and providing a default handler for it solves the problem. However, seems like the handler used can't be ShowAnnotationAction. I had to create a new class that wraps ShowAnnotationAction and use it as a default handler for ShowAnnotation2 to make toggling work.

I didn't check whether it would be possible to contribute to vertical ruler using legacy infrastructure. I'll try give it a hit tomorrow unless someone tells me I'm totally wrong...

Probably another solution would be to eliminate object/editor contribution stuff via which Show Annotation is contributed in other places.
Comment 5 Dani Megert CLA 2009-05-07 02:47:31 EDT
Maybe Paul can help.
Comment 6 Pawel Pogorzelski CLA 2009-05-08 10:35:55 EDT
Markus, changing the style of "Show Annotation" item to be toggle would limit current capability. Right now selecting the action once again causes the annotation to be refetched.

To hide annotations you have to deselect "Show Quick Diff" or go to "Revisions > Hide Revision Information". Not very intuitive, I know.

The best solution would be to make "Show Annotation" operate in a toggle fashion and instead of "Revisions > Hide Revision Information" create "Revisions > Refresh Revision Information" item.
Comment 7 Markus Keller CLA 2009-05-08 11:23:15 EDT
(In reply to comment #6)
> Right now selecting the action once again causes the annotation to be refetched.

I see, but what are the use cases for this? AFAICS, this would only make a difference if you:
- show annotations
- synchronize with repository and get a new version for the file
- want to show annotations on the new HEAD

That's a rather rare case, so I would also prefer this:

> The best solution would be to make "Show Annotation" operate in a toggle
> fashion and instead of "Revisions > Hide Revision Information" create
> "Revisions > Refresh Revision Information" item.

The "Show Annotation" action in the Team menu and the command should also become toggles then (e.g. when I bind the command to Alt+Shift+A, the key binding would toggle as well).
Comment 8 Pawel Pogorzelski CLA 2009-05-08 11:31:00 EDT
(In reply to comment #7)
> The "Show Annotation" action in the Team menu and the command should also
> become toggles then (e.g. when I bind the command to Alt+Shift+A, the key
> binding would toggle as well).

Sure, that's what I meant.

Szymon, we would somehow change behaviour with such fix. Does the current stage allow this? I'm asking because this is an minor usability issue for me. Not sure what Markus feels about it though.
Comment 9 Dani Megert CLA 2009-05-08 11:52:58 EDT
Agree that this is a minor issue for which no risks should be taken a this point.
Comment 10 Markus Keller CLA 2009-05-08 12:06:30 EDT
> Agree that this is a minor issue for which no risks should be taken a this
> point.

Agree, too risky for 3.5. (And a smaller fix like turning only the context menu action into a toggle would also be strange, since it would then behave differently from the Team menu action.)
Comment 11 Szymon Brandys CLA 2009-05-08 12:23:44 EDT
(In reply to comment #10)
> > Agree that this is a minor issue...
> 
> Agree, too risky for 3.5...

Agree with previous two "Agree".

Comment 12 Tomasz Zarna CLA 2010-08-24 07:00:16 EDT
*** Bug 309287 has been marked as a duplicate of this bug. ***
Comment 13 Markus Keller CLA 2016-11-01 11:25:21 EDT
*** Bug 361266 has been marked as a duplicate of this bug. ***
Comment 14 Eclipse Genie CLA 2020-03-18 16:28:35 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 15 Thomas Wolf CLA 2021-07-29 17:23:55 EDT
*** Bug 505939 has been marked as a duplicate of this bug. ***