Author: scabanovich
Date: 2012-01-10 17:12:02 -0500 (Tue, 10 Jan 2012)
New Revision: 37749
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemImpl.java
Log:
JBIDE-9420
https://issues.joss.org/browse/JBIDE-9420
For external class folders, take resource from ExternalPackageFragmentRoot object.
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemImpl.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemImpl.java 2012-01-10
22:08:44 UTC (rev 37748)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemImpl.java 2012-01-10
22:12:02 UTC (rev 37749)
@@ -17,6 +17,10 @@
import org.eclipse.core.resources.*;
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.runtime.*;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.internal.core.ExternalPackageFragmentRoot;
+import org.eclipse.jdt.internal.core.PackageFragmentRoot;
import org.jboss.tools.common.model.XModelObjectConstants;
import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.util.*;
@@ -105,6 +109,20 @@
ModelPlugin.getPluginLog().logError(e);
}
}
+
+ if(f == null) {
+ IJavaProject jp = EclipseResourceUtil.getJavaProject(getProject());
+ if(jp != null) {
+ IPackageFragmentRoot p = jp.getPackageFragmentRoot(thloc);
+ if(p instanceof ExternalPackageFragmentRoot && p.exists()) {
+ IResource r = ((PackageFragmentRoot)p).resource();
+ if(r instanceof IContainer) {
+ f = (IContainer)r;
+ }
+ }
+ }
+ }
+
resource = f;
if(resource == null) {