How to check an IJavaProject to see if it is an EAR? [message #127976] |
Tue, 16 December 2003 19:33 |
Eclipse User |
|
|
|
Originally posted by: mwhitt.us.ibm.com
I am migrating a plug-in from 1.2.0 to 1.2.1. I need to grab a specified
class.
Currently I get the Workspace root, get all projects, iterate thru the
projects, creating each one and calling findType passing it the class
name. In 1.2.0 when this was called on an EAR it just returned null. In
1.2.1 when this method is called on an EAR it throws a JavaModelException.
Why? Here is the code ....
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IProject[] projects = root.getProjects();
IType type = null;
try {
for (int i = 0; i < projects.length; i++){
IJavaProject jproject= JavaCore.creat(projects[i]);
type = jproject.findType(name);
if (type != null) {
return type;
}
}
}
How can I check to see if the project is an EAR so I don't make this call
to it? Or does anybody know a better way to get a handle on a class?
Thanks
|
|
|
Powered by
FUDForum. Page generated in 0.05055 seconds