Author: scabanovich
Date: 2011-04-15 21:11:58 -0400 (Fri, 15 Apr 2011)
New Revision: 30626
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationLiteral.java
Log:
JBIDE-8716
https://issues.jboss.org/browse/JBIDE-8716
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationLiteral.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationLiteral.java 2011-04-16
01:10:52 UTC (rev 30625)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationLiteral.java 2011-04-16
01:11:58 UTC (rev 30626)
@@ -15,6 +15,8 @@
import org.eclipse.jdt.core.IMemberValuePair;
import org.eclipse.jdt.core.ISourceRange;
import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.SourceRange;
+import org.eclipse.jdt.internal.core.MemberValuePair;
import org.jboss.tools.cdi.core.IJavaAnnotation;
public class AnnotationLiteral implements IJavaAnnotation {
@@ -33,6 +35,17 @@
this.annotationType = annotationType;
}
+ public AnnotationLiteral(IResource declaringResource, int offset, int length, Object
value, int valueType, IType annotationType) {
+ this.declaringResource = declaringResource;
+ this.range = new SourceRange(offset, length);
+ if(value != null) {
+ this.memberValues = new IMemberValuePair[]{
+ new MemberValuePair("value", value, valueType)
+ };
+ }
+ this.annotationType = annotationType;
+ }
+
public int getStartPosition() {
return range == null ? -1 : range.getOffset();
}