Author: dazarov
Date: 2011-10-17 16:20:41 -0400 (Mon, 17 Oct 2011)
New Revision: 35737
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/GenericInjectedPointHyperlinkDetector.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/SeamConfigInjectedPointHyperlinkDetector.java
Log:
Updated in order to work with binary files
https://issues.jboss.org/browse/JBIDE-9764
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/GenericInjectedPointHyperlinkDetector.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/GenericInjectedPointHyperlinkDetector.java 2011-10-17
19:39:03 UTC (rev 35736)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/GenericInjectedPointHyperlinkDetector.java 2011-10-17
20:20:41 UTC (rev 35737)
@@ -15,8 +15,8 @@
import java.util.List;
import java.util.Set;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.ICodeAssist;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IField;
@@ -43,7 +43,6 @@
import org.jboss.tools.cdi.core.IInjectionPoint;
import org.jboss.tools.cdi.core.IInjectionPointField;
import org.jboss.tools.cdi.core.IInjectionPointParameter;
-import org.jboss.tools.cdi.seam.solder.core.CDISeamSolderConstants;
import org.jboss.tools.cdi.seam.solder.core.generic.GenericClassBean;
import org.jboss.tools.cdi.text.ext.CDIExtensionsPlugin;
@@ -67,27 +66,19 @@
if (input == null)
return null;
- if (input.getResource() == null || input.getResource().getProject() == null)
- return null;
-
document= textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
IRegion wordRegion= JavaWordFinder.findWord(document, offset);
if (wordRegion == null)
return null;
- IFile file = null;
+ IProject project = null;
- try {
- IResource resource = input.getCorrespondingResource();
- if (resource instanceof IFile)
- file = (IFile) resource;
- } catch (JavaModelException e) {
- CDIExtensionsPlugin.log(e);
- }
+ project = input.getJavaProject().getProject();
- if(file == null)
+ if(project == null)
return null;
- CDICoreNature cdiNature = CDIUtil.getCDINatureWithProgress(file.getProject());
+
+ CDICoreNature cdiNature = CDIUtil.getCDINatureWithProgress(project);
if(cdiNature == null)
return null;
@@ -113,7 +104,7 @@
}
}
- findInjectedBeans(cdiNature, elements[0], position, file, hyperlinks);
+ findInjectedBeans(cdiNature, elements[0], position, input.getPath(), hyperlinks);
if (hyperlinks != null && !hyperlinks.isEmpty()) {
return (IHyperlink[])hyperlinks.toArray(new IHyperlink[hyperlinks.size()]);
@@ -124,14 +115,14 @@
return null;
}
- protected void findInjectedBeans(CDICoreNature nature, IJavaElement element, int offset,
IFile file, ArrayList<IHyperlink> hyperlinks){
+ protected void findInjectedBeans(CDICoreNature nature, IJavaElement element, int offset,
IPath path, ArrayList<IHyperlink> hyperlinks){
ICDIProject cdiProject = nature.getDelegate();
if(cdiProject == null) {
return;
}
- Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
+ Set<IBean> beans = cdiProject.getBeans(path);
Set<IInjectionPoint> injectionPoints = findInjectionPoints(beans, element,
offset);
if(injectionPoints.isEmpty()) {
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/SeamConfigInjectedPointHyperlinkDetector.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/SeamConfigInjectedPointHyperlinkDetector.java 2011-10-17
19:39:03 UTC (rev 35736)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/SeamConfigInjectedPointHyperlinkDetector.java 2011-10-17
20:20:41 UTC (rev 35737)
@@ -15,7 +15,7 @@
import java.util.List;
import java.util.Set;
-import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jface.text.hyperlink.IHyperlink;
import org.jboss.tools.cdi.core.CDICoreNature;
@@ -30,14 +30,14 @@
public class SeamConfigInjectedPointHyperlinkDetector extends
GenericInjectedPointHyperlinkDetector {
- protected void findInjectedBeans(CDICoreNature nature, IJavaElement element, int offset,
IFile file, ArrayList<IHyperlink> hyperlinks){
+ protected void findInjectedBeans(CDICoreNature nature, IJavaElement element, int offset,
IPath path, ArrayList<IHyperlink> hyperlinks){
ICDIProject cdiProject = nature.getDelegate();
if(cdiProject == null) {
return;
}
- Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
+ Set<IBean> beans = cdiProject.getBeans(path);
Set<IInjectionPoint> injectionPoints =
GenericInjectedPointHyperlinkDetector.findInjectionPoints(beans, element, offset);
if(injectionPoints.isEmpty()) {