Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » IPackageFragment not open when trying to get IPackageFragment with pacakge name(eclipse plugin development)
IPackageFragment not open when trying to get IPackageFragment with pacakge name [message #1404180] Wed, 30 July 2014 09:28
sak pat is currently offline sak patFriend
Messages: 1
Registered: July 2014
Junior Member
With below code i am trying to get IPackageFragment element for a given package name. But toString() of the IPackageFragment returned is com.abc.def (not open). Because of this when I try to access methods of all classes in this package I get JavaModelException.

Note: I can open and view the java files in this package in eclipse. Could anyone please tell what is wrong with this package.

private IPackageFragment getPackage(String name)
throws Exception
{
IPackageFragmentRoot[] roots = project.getAllPackageFragmentRoots();
for (int ii = 0; ii < roots.length; ii++){
IPackageFragment fragment = roots[ii].getPackageFragment(name);
if(fragment != null && fragment.exists()){
return fragment;
}
}
return null;
}
Previous Topic:Installing features during runtime
Next Topic:Mirroring Pieces of the Kepler Site without .blobstore
Goto Forum:
  


Current Time: Fri Apr 19 11:56:12 GMT 2024

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

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

Back to the top