Author: akazakov
Date: 2007-07-23 07:13:29 -0400 (Mon, 23 Jul 2007)
New Revision: 2590
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/SeamExpressionResolver.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
Log:
http://jira.jboss.com/jira/browse/EXIN-327 EL Validation
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-07-23
08:31:22 UTC (rev 2589)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2007-07-23
11:13:29 UTC (rev 2590)
@@ -111,7 +111,7 @@
}
}
}
-
+
// Here we have a list of vars for some part of expression
// OK. we'll proceed with members of these vars
if (areEqualExpressions(resolvedExpressionPart, tokens)) {
@@ -121,6 +121,8 @@
String prefixString = prefix.toString();
if(prefixString.length()<varName.length()) {
res.add(varName.substring(prefixString.length()));
+ } else if(returnEqualedVariablesOnly) {
+ res.add(varName);
}
}
return res;
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java 2007-07-23
08:31:22 UTC (rev 2589)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java 2007-07-23
11:13:29 UTC (rev 2590)
@@ -12,7 +12,6 @@
package org.jboss.tools.seam.internal.core.el;
import java.lang.reflect.Modifier;
-
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
@@ -33,6 +32,7 @@
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.ISeamXmlFactory;
import org.jboss.tools.seam.core.ScopeType;
+import org.jboss.tools.seam.core.SeamCorePlugin;
/**
* Utility class used to resolve Seam project variables and to get the methods/properties
and their presentation strings from type
@@ -163,6 +163,7 @@
}
}
} catch (JavaModelException e) {
+ SeamCorePlugin.getDefault().logError(e);
}
}
return methods;
@@ -186,7 +187,11 @@
"get".equals(m.getElementName()) ||
"set".equals(m.getElementName())) {
StringBuffer name = new StringBuffer(m.getElementName());
-
+
+ // Add method as 'foo'
+ methods.add(name.toString());
+
+ // Add method as 'foo(param1,param2)'
name.append('(');
String[] mParams = null;
mParams = m.getParameterNames();
@@ -195,11 +200,12 @@
name.append(mParams[j]);
}
name.append(')');
-
+
methods.add(name.toString());
}
}
} catch (JavaModelException e) {
+ SeamCorePlugin.getDefault().logError(e);
}
}
return methods;
@@ -225,6 +231,7 @@
}
}
} catch (JavaModelException e) {
+ SeamCorePlugin.getDefault().logError(e);
}
try {
@@ -236,6 +243,7 @@
}
}
} catch (JavaModelException e) {
+ SeamCorePlugin.getDefault().logError(e);
}
}
return properties;
@@ -257,15 +265,16 @@
if (Modifier.isPublic(m.getFlags()) &&
(m.getElementName().startsWith("get") &&
!"get".equals(m.getElementName())) ||
(m.getElementName().startsWith("set") &&
!"set".equals(m.getElementName()))) {
-
+
StringBuffer name = new StringBuffer(m.getElementName());
name.delete(0, 3);
name.setCharAt(0, Character.toLowerCase(name.charAt(0)));
-
+
properties.add(name.toString());
}
}
} catch (JavaModelException e) {
+ SeamCorePlugin.getDefault().logError(e);
}
try {
@@ -277,8 +286,9 @@
}
}
} catch (JavaModelException e) {
+ SeamCorePlugin.getDefault().logError(e);
}
}
return properties;
}
-}
+}
\ No newline at end of file
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2007-07-23
08:31:22 UTC (rev 2589)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2007-07-23
11:13:29 UTC (rev 2590)
@@ -252,7 +252,7 @@
if (result == null || result.size() == 0)
return NO_PROPOSALS;
- return (ICompletionProposal[]) result.toArray(new
ICompletionProposal[uniqueSuggestions.size()]);
+ return (ICompletionProposal[]) result.toArray(new
ICompletionProposal[result.size()]);
} catch (BadLocationException x) {
return NO_PROPOSALS;
} catch (StringIndexOutOfBoundsException e) {