Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » how can I get method or type name?
how can I get method or type name? [message #184319] Fri, 23 January 2004 18:32 Go to next message
Eclipse UserFriend
Originally posted by: pavel_nospam_.sumix.com

Hi,

I'm trying to write a simple eclipse plugin and have some troubles.
In java editor how can I get IMethod or IType under cursor? Moreover I
need to get IMethod if cursor in the some line with method declaration or
inside a method. The same for class I need to get IType for a class when
cursor inside a class but outside a method.

Sorry for my English ;)
Re: how can I get method or type name? [message #184328 is a reply to message #184319] Fri, 23 January 2004 18:37 Go to previous message
Eclipse UserFriend
Originally posted by: pavel_nospam_.sumix.com

I've forgot to tell you now I can get IJavaElement if cursor is over the
class or method name.
I got this code form RenameJavaElementAction class.
Something like:
private IJavaElement getJavaElement() {
IJavaElement[] elements= SelectionConverter.codeResolveHandled(fEditor,
getShell(),
RefactoringMessages.getString("RenameJavaElementAction.name "));
//$NON-NLS-1$
if (elements == null || elements.length != 1)
return null;
return elements[0];
}
Previous Topic:Configuration question
Next Topic:Learning Title width requirement
Goto Forum:
  


Current Time: Tue Jul 22 07:43:06 EDT 2025

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

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

Back to the top