Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » [SOLVED] How to create hierarchy search scope from a MethodDeclaration instance?
icon5.gif  [SOLVED] How to create hierarchy search scope from a MethodDeclaration instance? [message #649682] Thu, 20 January 2011 09:57 Go to next message
Christophe Bismuth is currently offline Christophe BismuthFriend
Messages: 67
Registered: July 2009
Location: Paris, France
Member

Hi,

Does anyone could give me a hint, please?
Binding can be resolved in my case.

Thanks,
Chris

[Updated on: Thu, 20 January 2011 21:55]

Report message to a moderator

Re: How to create hierarchy search scope from a MethodDeclaration instance? [message #649759 is a reply to message #649682] Thu, 20 January 2011 14:41 Go to previous messageGo to next message
shanky sohar is currently offline shanky soharFriend
Messages: 13
Registered: January 2011
Junior Member

Select the instance..

and go to
Search->References->(project,workspace,heararchy,workingSet)
Re: How to create hierarchy search scope from a MethodDeclaration instance? [message #649790 is a reply to message #649759] Thu, 20 January 2011 15:37 Go to previous messageGo to next message
Christophe Bismuth is currently offline Christophe BismuthFriend
Messages: 67
Registered: July 2009
Location: Paris, France
Member

Thank you Shanky, but I meant from the JDT API.
Re: How to create hierarchy search scope from a MethodDeclaration instance? [message #649863 is a reply to message #649682] Thu, 20 January 2011 18:37 Go to previous messageGo to next message
Deepak Azad is currently offline Deepak AzadFriend
Messages: 543
Registered: July 2009
Senior Member
On 1/20/2011 3:27 PM, Christophe Bismuth wrote:
> Hi,
>
> Does anyone could give me a hint, please?
> Binding can be resolved in my case.
>
> Thanks,
> Chris
Get the declaring class :IMethodBinding.getDeclaringClass(), this gives
you ITypeBinding. Then use IBinding.getJavaElement() to get to IType.
Re: How to create hierarchy search scope from a MethodDeclaration instance? [message #649866 is a reply to message #649863] Thu, 20 January 2011 19:10 Go to previous messageGo to next message
Christophe Bismuth is currently offline Christophe BismuthFriend
Messages: 67
Registered: July 2009
Location: Paris, France
Member

That's my point, thank you Deepak. Could you help me to get the IType from Java element, please?

Thanks,
Chris
Re: How to create hierarchy search scope from a MethodDeclaration instance? [message #649872 is a reply to message #649866] Thu, 20 January 2011 19:48 Go to previous messageGo to next message
Deepak Azad is currently offline Deepak AzadFriend
Messages: 543
Registered: July 2009
Senior Member
On 1/21/2011 12:40 AM, Christophe Bismuth wrote:
> That's my point, thank you Deepak. Could you help me to get the IType
> from Java element, please?
>
> Thanks,
> Chris
Please see type hierarchy of IType ;-)
Re: How to create hierarchy search scope from a MethodDeclaration instance? [message #649891 is a reply to message #649872] Thu, 20 January 2011 21:18 Go to previous messageGo to next message
Christophe Bismuth is currently offline Christophe BismuthFriend
Messages: 67
Registered: July 2009
Location: Paris, France
Member

Hey hey that's what I'm doing since yesterday evening ;o)
Have you got any idea? Rolling Eyes

Thanks,
Chris
Re: How to create hierarchy search scope from a MethodDeclaration instance? [message #649900 is a reply to message #649891] Thu, 20 January 2011 21:53 Go to previous messageGo to next message
Christophe Bismuth is currently offline Christophe BismuthFriend
Messages: 67
Registered: July 2009
Location: Paris, France
Member

Got it:

myMethodDeclaration.resolveBinding().getDeclaringClass().getJavaElement();


Result type is:

org.eclipse.jdt.internal.core.ResolvedSourceType


Thanks,
Chris
Re: How to create hierarchy search scope from a MethodDeclaration instance? [message #649901 is a reply to message #649682] Thu, 20 January 2011 21:54 Go to previous message
Christophe Bismuth is currently offline Christophe BismuthFriend
Messages: 67
Registered: July 2009
Location: Paris, France
Member

No Message Body

[Updated on: Thu, 20 January 2011 21:55]

Report message to a moderator

Previous Topic:Let Eclipse generate Implementation class skeleton for Interface?
Next Topic:No default values in IAnnotationBinding?
Goto Forum:
  


Current Time: Thu Mar 28 18:08:26 GMT 2024

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

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

Back to the top