Author: vrubezhny
Date: 2007-11-02 10:18:44 -0400 (Fri, 02 Nov 2007)
New Revision: 4661
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/TypeInfoCollector.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1203 EL autocompletion prompts static members
The static methods are excluded from valid proposals
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2007-11-02
14:18:35 UTC (rev 4660)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2007-11-02
14:18:44 UTC (rev 4661)
@@ -146,7 +146,7 @@
for (ISeamContextVariable var : resolvedVariables) {
String varName = var.getName();
String prefixString = prefix.toString();
- if(prefixString.length()<varName.length()) {
+ if(prefixString.length()<=varName.length()) {
res.add(varName.substring(prefixString.length()));
} else if(returnEqualedVariablesOnly) {
res.add(varName);
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/TypeInfoCollector.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/TypeInfoCollector.java 2007-11-02
14:18:35 UTC (rev 4660)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/TypeInfoCollector.java 2007-11-02
14:18:44 UTC (rev 4661)
@@ -72,8 +72,12 @@
}
public boolean isPublic() {
- return Modifier.isPublic(fModifiers) && !isJavaLangObject();
+ return Modifier.isPublic(fModifiers);
}
+
+ public boolean isStatic() {
+ return Modifier.isStatic(fModifiers);
+ }
public boolean isJavaLangObject() {
return "java.lang.Object".equals(getDeclaringTypeQualifiedName());
@@ -482,6 +486,7 @@
List<MemberInfo> methods = new ArrayList<MemberInfo>();
for (MethodInfo info : fMethods) {
if (info.isPublic() && !info.isConstructor()
+ && !info.isStatic() && !info.isJavaLangObject()
&& !info.isGetter() && !info.isSetter())
methods.add(info);
}
@@ -496,7 +501,6 @@
*/
public Set<String> getMethodPresentations() {
Set<String> methods = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
-// IMethod[] mthds = type.getMethods();
List<MemberInfo> mthds = getMethods();
for (MemberInfo info : mthds) {
if (!(info instanceof MethodInfo))
@@ -532,6 +536,7 @@
List<MemberInfo> properties = new ArrayList<MemberInfo>();
for (MethodInfo info : fMethods) {
if (info.isPublic() && !info.isConstructor()
+ && !info.isStatic() && !info.isJavaLangObject()
&& (info.isGetter() || info.isSetter()))
properties.add(info);
}