Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Finding subtypes
Finding subtypes [message #507882] Fri, 15 January 2010 00:40 Go to next message
Michal Olejnik is currently offline Michal OlejnikFriend
Messages: 13
Registered: July 2009
Junior Member

I would like to know if there is any way to find all subtypes of particular class from my plug-in. I have an IJavaElement which represents this class and ideally I would like to find all its subtypes represented also as IJavaElements, though even their qualified names could be sufficient..

If anyone knows solution to my problem I'd be very grateful for helping me.

Thanks in advance and best regards.
Michal Olejnik
Re: Finding subtypes [message #507932 is a reply to message #507882] Fri, 15 January 2010 08:52 Go to previous message
Mickael Istria, away until January 8th is currently offline Mickael Istria, away until January 8thFriend
Messages: 827
Registered: July 2009
Location: Grenoble, France
Senior Member


You will need your (runtime workspace) project to be a Java Project and use JDT API to list subtypes.
The code to use is parentType.newTypeHierarchy(project,null).getAllSubtypes(par entType).

I cross-posted this answer to JDT newsgroup/forum, which is more accurate for your question.

Mickael Istria - BonitaSoft S.A.
Previous Topic:Source code for Plug-in Examples
Next Topic:Plugin Development in Eclipse 3.0
Goto Forum:

Current Time: Sat Mar 24 14:11:19 GMT 2018

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

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