Author: scabanovich
Date: 2010-11-18 07:26:50 -0500 (Thu, 18 Nov 2010)
New Revision: 26705
Modified:
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamBeanHyperlinkPartitioner.java
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamComponentHyperlinkDetector.java
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlinkDetector.java
Log:
JBIDE-7616
https://jira.jboss.org/browse/JBIDE-7616
Modified:
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamBeanHyperlinkPartitioner.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamBeanHyperlinkPartitioner.java 2010-11-18
12:23:57 UTC (rev 26704)
+++
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamBeanHyperlinkPartitioner.java 2010-11-18
12:26:50 UTC (rev 26705)
@@ -405,7 +405,7 @@
if (propertyName == null)
return null;
- ScopeType scope = SeamELCompletionEngine.getScope(seamProject, file);
+// ScopeType scope = SeamELCompletionEngine.getScope(seamProject, file);
ELInvocationExpression expr = (ELInvocationExpression)exp;
@@ -414,7 +414,7 @@
if (expr.getLeft() != null) {
while (left != null) {
List<ISeamContextVariable> resolvedVars = new
ArrayList<ISeamContextVariable>();
- resolvedVars = engine.resolveVariables(seamProject, scope, left,
+ resolvedVars = engine.resolveVariables(seamProject, file, left,
left == expr, true);
if (resolvedVars != null && !resolvedVars.isEmpty()) {
map.put(left, resolvedVars);
Modified:
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamComponentHyperlinkDetector.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamComponentHyperlinkDetector.java 2010-11-18
12:23:57 UTC (rev 26704)
+++
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamComponentHyperlinkDetector.java 2010-11-18
12:26:50 UTC (rev 26705)
@@ -38,9 +38,11 @@
import org.jboss.tools.seam.core.ISeamComponentDeclaration;
import org.jboss.tools.seam.core.ISeamContextShortVariable;
import org.jboss.tools.seam.core.ISeamContextVariable;
+import org.jboss.tools.seam.core.ISeamJavaComponentDeclaration;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.ISeamXmlFactory;
import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.internal.core.SeamJavaComponentDeclaration;
import org.jboss.tools.seam.internal.core.el.SeamELCompletionEngine;
import org.jboss.tools.seam.text.ext.SeamExtPlugin;
@@ -133,7 +135,19 @@
if (nameToSearch == null && nameToSearch.trim().length() == 0)
continue;
- Set<ISeamContextVariable> vars = seamProject.getVariables(true);
+ ISeamJavaComponentDeclaration declaration = null;
+
+ if(file != null) {
+ Set<ISeamComponent> cs =
seamProject.getComponentsByPath(file.getFullPath());
+ for (ISeamComponent c: cs) {
+ ISeamJavaComponentDeclaration d = c.getJavaDeclaration();
+ if(d != null && file.getFullPath().equals(d.getSourcePath()) &&
!((SeamJavaComponentDeclaration)d).getImports().isEmpty()) {
+ declaration = d;
+ }
+ }
+
+ }
+ Set<ISeamContextVariable> vars = seamProject.getVariables(declaration);
if (vars != null) {
for (ISeamContextVariable var : vars) {
if (nameToSearch.equals(var.getName())){
Modified:
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlinkDetector.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlinkDetector.java 2010-11-18
12:23:57 UTC (rev 26704)
+++
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlinkDetector.java 2010-11-18
12:26:50 UTC (rev 26705)
@@ -172,7 +172,7 @@
if (propertyName == null)
return null;
- ScopeType scope = SeamELCompletionEngine.getScope(seamProject, file);
+// ScopeType scope = SeamELCompletionEngine.getScope(seamProject, file);
ELInvocationExpression expr = (ELInvocationExpression)exp;
@@ -181,7 +181,7 @@
if (expr.getLeft() != null) {
while (left != null) {
List<ISeamContextVariable> resolvedVars = new
ArrayList<ISeamContextVariable>();
- resolvedVars = engine.resolveVariables(seamProject, scope, left,
+ resolvedVars = engine.resolveVariables(seamProject, file, left,
left == expr, true);
if (resolvedVars != null && !resolvedVars.isEmpty()) {
map.put(left, resolvedVars);