Author: scabanovich
Date: 2009-04-02 11:43:03 -0400 (Thu, 02 Apr 2009)
New Revision: 14463
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaAdapter.java
Log:
JBIDE-997
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaAdapter.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaAdapter.java 2009-04-02
15:25:10 UTC (rev 14462)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaAdapter.java 2009-04-02
15:43:03 UTC (rev 14463)
@@ -13,6 +13,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.ElementChangedEvent;
import org.eclipse.jdt.core.IElementChangedListener;
@@ -96,7 +97,17 @@
packageFragmentRoot = javaProject == null ? null :
javaProject.getPackageFragmentRoot(javaProject.getResource());
try {
- javaElement = javaProject == null ? null : javaProject.findElement(new
Path(fullClassName));
+ if(javaProject == null) {
+ javaElement = null;
+ } else {
+ javaElement = javaProject.findElement(new Path(fullClassName));
+ if(javaElement == null) {
+ javaElement = javaProject.findType(name);
+ }
+ if(javaElement == null) {
+ javaElement = javaProject.findType(name, new NullProgressMonitor());
+ }
+ }
} catch (JavaModelException e) {
javaElement = null;
// no validation here
Show replies by date