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 04:57 Go to next message
Christophe Bismuth is currently offline Christophe Bismuth
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 16: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 09:41 Go to previous messageGo to next message
shanky sohar is currently offline shanky sohar
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 10:37 Go to previous messageGo to next message
Christophe Bismuth is currently offline Christophe Bismuth
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 13:37 Go to previous messageGo to next message
Deepak Azad is currently offline Deepak Azad
Messages: 545
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 14:10 Go to previous messageGo to next message
Christophe Bismuth is currently offline Christophe Bismuth
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 14:48 Go to previous messageGo to next message
Deepak Azad is currently offline Deepak Azad
Messages: 545
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 16:18 Go to previous messageGo to next message
Christophe Bismuth is currently offline Christophe Bismuth
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 16:53 Go to previous messageGo to next message
Christophe Bismuth is currently offline Christophe Bismuth
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 16:54 Go to previous message
Christophe Bismuth is currently offline Christophe Bismuth
Messages: 67
Registered: July 2009
Location: Paris, France
Member

No Message Body

[Updated on: Thu, 20 January 2011 16: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: Wed Aug 27 21:18:41 EDT 2014

Powered by FUDForum. Page generated in 0.02395 seconds