Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » How to get all the hierarchical type information?
How to get all the hierarchical type information? [message #999620] Sat, 12 January 2013 17:18
Sungmin Cho is currently offline Sungmin ChoFriend
Messages: 9
Registered: October 2012
Junior Member
I have class A, and class B that inherits B in eclipse workspace.

http://i.stack.imgur.com/WqgFH.png
http://i.stack.imgur.com/3fU0d.png

The issue that I have is that I got nothing when I tried to get the super types of type B using eclipse JDT API. This is the code:

IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
java.io.File workspaceDirectory = root.getLocation().toFile();

// 1. The name of the project in the workspace
IProgressMonitor pm = new NullProgressMonitor();
IProject orig = root.getProject(this.projectName);
orig.open(pm);
this.javaProject = JavaCore.create(orig);
orig.refreshLocal(IResource.DEPTH_INFINITE, pm);

// 2. Find the type
IType type = this.javaProject.findType("p.B"); <-- returns correct type info
ITypeHierarchy hier = type.newSupertypeHierarchy(new NullProgressMonitor());
IType[] types = hier.getAllSuperclasses(type);
System.out.println(types); <-- Returns []

What might be wrong?
Previous Topic:Why eclipse resource is "(not open)"?
Next Topic:RCP build very slow after platform change
Goto Forum:
  


Current Time: Sat Apr 27 01:58:19 GMT 2024

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

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

Back to the top