Author: scabanovich
Date: 2009-04-10 06:06:23 -0400 (Fri, 10 Apr 2009)
New Revision: 14651
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLHelper.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ASTVisitorImpl.java
Log:
JBIDE-4144
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLHelper.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLHelper.java 2009-04-10
10:05:09 UTC (rev 14650)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLHelper.java 2009-04-10
10:06:23 UTC (rev 14651)
@@ -5,6 +5,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IMethod;
@@ -142,7 +143,14 @@
IJavaProject jp = JavaCore.create(project);
if(jp != null) {
try {
- return jp.findType(name);
+ IType type = jp.findType(name.replace('$', '.'));
+ if(type == null && name.indexOf('$') >= 0) {
+ int ii = name.lastIndexOf('.');
+ String pack = (ii < 0) ? "" : name.substring(0, ii);
+ String cls = name.substring(ii + 1);
+ type = jp.findType(pack, cls.replace('$', '.'), new
NullProgressMonitor());
+ }
+ return type;
} catch (JavaModelException e) {
//ignore
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ASTVisitorImpl.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ASTVisitorImpl.java 2009-04-10
10:05:09 UTC (rev 14650)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ASTVisitorImpl.java 2009-04-10
10:06:23 UTC (rev 14651)
@@ -19,8 +19,11 @@
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.dom.ASTVisitor;
+import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
import org.eclipse.jdt.core.dom.Annotation;
+import org.eclipse.jdt.core.dom.AnnotationTypeDeclaration;
import org.eclipse.jdt.core.dom.Block;
+import org.eclipse.jdt.core.dom.EnumDeclaration;
import org.eclipse.jdt.core.dom.FieldDeclaration;
import org.eclipse.jdt.core.dom.MarkerAnnotation;
import org.eclipse.jdt.core.dom.MethodDeclaration;
@@ -47,7 +50,7 @@
public IType type;
int innerLock = 0;
- public AnnotatedASTNode<TypeDeclaration> annotatedType = null;
+ public AnnotatedASTNode<AbstractTypeDeclaration> annotatedType = null;
public Set<AnnotatedASTNode<FieldDeclaration>> annotatedFields = new
HashSet<AnnotatedASTNode<FieldDeclaration>>();
public Set<AnnotatedASTNode<MethodDeclaration>> annotatedMethods = new
HashSet<AnnotatedASTNode<MethodDeclaration>>();
@@ -85,7 +88,7 @@
public boolean hasSeamComponent() {
return root.hasSeamComponent();
}
-
+
public boolean visit(SingleMemberAnnotation node) {
if(current.innerLock > 0) return false;
String type = resolveType(node);
@@ -142,6 +145,18 @@
}
public boolean visit(TypeDeclaration node) {
+ return _visit(node);
+ }
+
+ public boolean visit(EnumDeclaration node) {
+ return _visit(node);
+ }
+
+ public boolean visit(AnnotationTypeDeclaration node) {
+ return _visit(node);
+ }
+
+ private boolean _visit(AbstractTypeDeclaration node) {
if(current == null) {
String n = node.getName().getFullyQualifiedName();
if(n != null && n.indexOf('.') < 0) n =
EclipseJavaUtil.resolveType(root.type, n);
@@ -150,7 +165,7 @@
current = root;
}
if(current.annotatedType == null) {
- current.annotatedType = new AnnotatedASTNode<TypeDeclaration>(node);
+ current.annotatedType = new AnnotatedASTNode<AbstractTypeDeclaration>(node);
current.currentAnnotatedNode = current.annotatedType;
} else {
String n = node.getName().getFullyQualifiedName();
@@ -182,14 +197,23 @@
d.parent = current;
current.children.add(d);
current = d;
- current.annotatedType = new AnnotatedASTNode<TypeDeclaration>(node);
+ current.annotatedType = new AnnotatedASTNode<AbstractTypeDeclaration>(node);
current.currentAnnotatedNode = current.annotatedType;
}
}
return true;
}
-
+
public void endVisit(TypeDeclaration node) {
+ _endVisit(node);
+ }
+ public void endVisit(AnnotationTypeDeclaration node) {
+ _endVisit(node);
+ }
+ public void endVisit(EnumDeclaration node) {
+ _endVisit(node);
+ }
+ public void _endVisit(AbstractTypeDeclaration node) {
if(current == null) return;
if(current.currentAnnotatedNode != null && current.currentAnnotatedNode.node ==
node) {
current.currentAnnotatedNode = null;