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.

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(); workspaceDirectory = root.getLocation().toFile();

// 1. The name of the project in the workspace
IProgressMonitor pm = new NullProgressMonitor();
IProject orig = root.getProject(this.projectName);;
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 Jun 23 01:06:43 GMT 2018

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

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

Back to the top