Eclipse Community Forums
Forum Search:

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

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 03:52 Go to previous message
Mickael Istria is currently offline Mickael Istria
Messages: 745
Registered: July 2009
Location: Grenoble, France
Senior Member
Hello,

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.

Regards,
--
Mickael Istria - BonitaSoft S.A.
http://www.bonitasoft.com/products/downloads.php
Previous Topic:Source code for Plug-in Examples
Next Topic:Finding subtypes
Goto Forum:
  


Current Time: Mon Sep 01 10:02:56 EDT 2014

Powered by FUDForum. Page generated in 0.09328 seconds