[jbosstools-commits] JBoss Tools SVN: r30881 - branches/jbosstools-3.2.x/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Wed Apr 27 13:35:35 EDT 2011


Author: scabanovich
Date: 2011-04-27 13:35:35 -0400 (Wed, 27 Apr 2011)
New Revision: 30881

Modified:
   branches/jbosstools-3.2.x/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FileUtil.java
Log:
JBIDE-8275
https://issues.jboss.org/browse/JBIDE-8275

Modified: branches/jbosstools-3.2.x/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FileUtil.java
===================================================================
--- branches/jbosstools-3.2.x/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FileUtil.java	2011-04-27 17:26:08 UTC (rev 30880)
+++ branches/jbosstools-3.2.x/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FileUtil.java	2011-04-27 17:35:35 UTC (rev 30881)
@@ -44,6 +44,7 @@
 import org.eclipse.jdt.core.search.SearchPattern;
 import org.eclipse.jdt.core.search.SearchRequestor;
 import org.eclipse.jdt.internal.core.JarPackageFragmentRoot;
+import org.eclipse.jdt.internal.core.JavaElement;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IFileEditorInput;
 import org.eclipse.ui.IWorkbenchPage;
@@ -176,6 +177,14 @@
 					        result = temporaryFile.getAbsolutePath();
 						}
 					}
+				} else if (fragmentRoot instanceof JavaElement) {
+					IResource resource = ((JavaElement)fragmentRoot).resource();
+					if(resource instanceof IContainer && resource.exists()) {
+						IFile f = ((IContainer)resource).getFile(new Path(classPathResource));
+						if(f != null && f.exists()) {
+							result = f.getLocation().toFile().getAbsolutePath();
+						}
+					}
 				}
 			}
 		} catch (JavaModelException e) {



More information about the jbosstools-commits mailing list