I am currently developing a plugin for Eclipse that analyzes dependencies and references of Java and plugin projects in the Workspace.
However I cannot for the life of me find a way to get the name of a referenced project or library found in the Classpath Entries.
Here’s what I have (excerpt from a longer method):
IJavaProject j= JavaCore.create(project); //project is an IProject
try {
IClasspathEntry[] classpath= j.getRawClasspath();
// Get required Libraries and Projects
for (IClasspathEntry entry : classpath) {
switch (entry.getEntryKind()) {
case IClasspathEntry.CPE_LIBRARY: {
//Retrieve name of the Library
break;
}
case IClasspathEntry.CPE_PROJECT: {
//Retrieve name of the Project
break;
}
}
} catch [...]
Does anyone have an idea how to get the names at the marked positions, or a better way to retrieve them?
After consulting with someone else, I have finally found the solution: