Bug 268959 - [rulers] Enable more than one ruler action if multiple java annotations exist
Summary: [rulers] Enable more than one ruler action if multiple java annotations exist
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.4.2   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-17 08:34 EDT by Stephan Herrmann CLA
Modified: 2019-09-06 16:03 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Herrmann CLA 2009-03-17 08:34:04 EDT
Build ID: M20090211-1700

The vertical ruler (LHS) of the JavaEditor supports some actions on annotations
via a context menu. When multiple annotations share the same source line, only
the top layer is shown and only this annotation's action is offered in the
context menu. 

Hovering the annotation correctly displays labels from annotations in lower
layers, so it would be great if these actions are enabled, too.

For an example write this line into any class:
  	public String toString() { return 13; }
Only the error marker will show, but hover will also say:
	overrides java.lang.Object.toString
So, way isn't "Open super implementation" enabled?

The technical reason seems to lie in class JavaSelectAnnotationRulerAction 
which only handles the top-most annotation (field fAnnotation).

Can't this field be changed to a list or array to support the actions of all
java annotations, or do those collide not only here? How about the shortcut
Ctrl-1? It seems to be bound to the top-most action (whichever that is), but
OTOH Ctrl-1 for "Open super implementation" doesn't seem to work anyway, 
does it? Multiple menu entries for multiple annotations would be perfect.
Comment 1 Dani Megert CLA 2009-03-18 03:36:40 EDT
Only quick assist/fix is handled specially, otherwise the context menu is always the same and not filtered by the top annotation.
Comment 2 Dani Megert CLA 2009-03-18 03:41:51 EDT
Sorry, I got tricked by "context menu" in your original comment.

What you mean is the single-click action which is targeted to the top annotation.
Comment 3 Stephan Herrmann CLA 2009-03-18 04:29:57 EDT
I might be doing something stupid, but if the line of 
an overriding method has a quickfix I find NO way to
invoke the "Open super implementation" action.

I'm not so much surprised that there's only one
single-click action.

Plus: looking at the code, 
	JavaSelectAnnotationRulerAction.update()
first finds the top-most java annotation 
	(method findJavaAnnotation())
and from there the context menu is initialized ONLY for that
topmost annotation. Are you seeing something different?


The other thing might be a separate bug: I never found
a way to use Ctrl-1 for invoking "Open super implementation"
although that's the shortcut advertized in the context menu.
Could this one be plattform specific (I'm on linux-gtk)?
Comment 4 Dani Megert CLA 2009-03-18 04:36:43 EDT
>I might be doing something stupid, but if the line of 
>an overriding method has a quickfix I find NO way to
>invoke the "Open super implementation" action.
That's what I tried to say: those are handled by the Go To Annotation action hence only one wins and in case of problems, quick fix wins. However, there's a way to go to the super implementation: use roll-over hovers:
Java > Editor > Hovers > [] Expand vertical ruler icons upon hovering

>The other thing might be a separate bug: I
Right, see bug 66640.
Comment 5 Stephan Herrmann CLA 2009-03-18 05:08:59 EDT
(In reply to comment #4)
> there's a way to go to the super implementation: use roll-over hovers:
> Java > Editor > Hovers > [] Expand vertical ruler icons upon hovering

Thanks, one more of those hidden treasures ;-)

I would still prefer if Go To Annotation would expand to a sub-menu
if more than one annotation is found, but if presenting only one is by
design I won't take this to the Supreme Court :)
Comment 6 Markus Keller CLA 2009-03-18 06:27:20 EDT
> I find NO way to invoke the "Open super implementation" action.

For this concrete action, you can always use the main menu:
Navigate > Open Super Implementation. I've bound this to Shift+F3.
Comment 7 Eclipse Webmaster CLA 2019-09-06 16:03:50 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.

If you have further information on the current state of the bug, please add it. 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.