Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » How to check an IJavaProject to see if it is an EAR?
How to check an IJavaProject to see if it is an EAR? [message #127976] Tue, 16 December 2003 19:33
Eclipse UserFriend
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
Previous Topic:Define new Ant tasks in 3.0M5
Next Topic:Close All Editor Windows?
Goto Forum:
  


Current Time: Thu May 08 23:16:58 EDT 2025

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

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

Back to the top