Author: dazarov
Date: 2010-01-27 10:07:45 -0500 (Wed, 27 Jan 2010)
New Revision: 19958
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3125
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java 2010-01-27
13:40:22 UTC (rev 19957)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java 2010-01-27
15:07:45 UTC (rev 19958)
@@ -28,6 +28,10 @@
* @author Alexey Kazakov
*/
public class CDIUtil {
+ /**
+ * CDI Inject annotation's name
+ */
+ public final static String INJECT_ANNOTATION_NAME = "Inject"; //$NON-NLS-1$
/**
* Adds CDI and KB builders to the project.
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java 2010-01-27
13:40:22 UTC (rev 19957)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java 2010-01-27
15:07:45 UTC (rev 19958)
@@ -40,7 +40,7 @@
import org.jboss.tools.cdi.core.IInjectionPoint;
public class InjectedPointHyperlinkDetector extends AbstractHyperlinkDetector{
- private final static String INJECT_ANNOTATION_NAME = "Inject"; //$NON-NLS-1$
+
public IHyperlink[] detectHyperlinks(ITextViewer textViewer,
IRegion region, boolean canShowMultipleHyperlinks) {
@@ -98,7 +98,7 @@
for (IJavaElement element : elements) {
if(element instanceof IType){
- if(INJECT_ANNOTATION_NAME.equals(element.getElementName())){
+ if(CDIUtil.INJECT_ANNOTATION_NAME.equals(element.getElementName())){
ICompilationUnit cUnit = (ICompilationUnit)input;
element = cUnit.getElementAt(wordRegion.getOffset());
if(element == null)
@@ -109,7 +109,7 @@
if (element instanceof IAnnotatable) {
IAnnotatable annotatable = (IAnnotatable)element;
- IAnnotation annotation = annotatable.getAnnotation(INJECT_ANNOTATION_NAME);
+ IAnnotation annotation = annotatable.getAnnotation(CDIUtil.INJECT_ANNOTATION_NAME);
if (annotation == null)
continue;
IInjectionPoint injectionPoint = CDIUtil.findInjectionPoint(beans, element);
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java 2010-01-27
13:40:22 UTC (rev 19957)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java 2010-01-27
15:07:45 UTC (rev 19958)
@@ -76,7 +76,7 @@
if (element instanceof IAnnotatable) {
IAnnotatable annotatable = (IAnnotatable)element;
- IAnnotation annotation = annotatable.getAnnotation("Injected");
//$NON-NLS-1$
+ IAnnotation annotation = annotatable.getAnnotation(CDIUtil.INJECT_ANNOTATION_NAME);
if (annotation == null)
return;
IInjectionPoint injectionPoint = CDIUtil.findInjectionPoint(beans, element);