Author: scabanovich
Date: 2009-04-10 06:17:18 -0400 (Fri, 10 Apr 2009)
New Revision: 14656
Modified:
branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLHelper.java
branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ASTVisitorImpl.java
Log:
JBIDE-4144
Modified:
branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLHelper.java
===================================================================
---
branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLHelper.java 2009-04-10
10:13:21 UTC (rev 14655)
+++
branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLHelper.java 2009-04-10
10:17:18 UTC (rev 14656)
@@ -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:
branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ASTVisitorImpl.java
===================================================================
---
branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ASTVisitorImpl.java 2009-04-10
10:13:21 UTC (rev 14655)
+++
branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ASTVisitorImpl.java 2009-04-10
10:17:18 UTC (rev 14656)
@@ -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;