Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Getting a java element from a right click menu on the java editor
Getting a java element from a right click menu on the java editor [message #184095] Fri, 23 January 2004 13:06 Go to next message
Eclipse UserFriend
Originally posted by: ximor_iksivich.lycos.co.uk

Hi,
I have added a viewerContribution in my plugin that targets the
CompilationUnitEditor in eclipse. What I want is something similar to the
'Open Declaration' menu that appears in the popup menu in the java editor
in that I want the IJaveElement that is present in the location where the
cursor/the menu is right clicked. Right now I am using getJavaElement(int
offset) but this only work if you make a selection to get the offset first.

I have noticed that there is no such requirement for the 'open
declaration' menu option. So I would be happy if someone can tell me how
to do this. I tried to find the implementation of the 'Open Declaration'
menu option but couldnt. Even a link to the code would do.

Thanks,
Ximor.
Re: Getting a java element from a right click menu on the java editor [message #184801 is a reply to message #184095] Mon, 26 January 2004 05:28 Go to previous message
Eclipse UserFriend
Originally posted by: daniel.megert.gmx.net

Ximor wrote:

>Hi,
> I have added a viewerContribution in my plugin that targets the
>CompilationUnitEditor in eclipse. What I want is something similar to the
>'Open Declaration' menu that appears in the popup menu in the java editor
>in that I want the IJaveElement that is present in the location where the
>cursor/the menu is right clicked. Right now I am using getJavaElement(int
>offset) but this only work if you make a selection to get the offset first.
>
>I have noticed that there is no such requirement for the 'open
>declaration' menu option. So I would be happy if someone can tell me how
>to do this. I tried to find the implementation of the 'Open Declaration'
>menu option but couldnt. Even a link to the code would do.
>
>
org.eclipse.jdt.ui.actions.OpenAction

Dani

>Thanks,
>Ximor.
>
>
>
Previous Topic:Re: How to Resize StatusLineContributionItem?
Next Topic:Getting access to cursor methods.
Goto Forum:
  


Current Time: Tue Jul 22 16:54:45 EDT 2025

Powered by FUDForum. Page generated in 0.05388 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top