Author: akazakov
Date: 2007-11-05 14:33:29 -0500 (Mon, 05 Nov 2007)
New Revision: 4719
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1256
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2007-11-05
19:12:06 UTC (rev 4718)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2007-11-05
19:33:29 UTC (rev 4719)
@@ -11,10 +11,8 @@
package org.jboss.tools.seam.internal.core.validation;
import java.io.IOException;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
-import java.util.Map;
import java.util.Set;
import org.eclipse.core.resources.IFile;
@@ -25,7 +23,6 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.internal.ui.text.FastJavaPartitionScanner;
import org.eclipse.jdt.ui.text.IJavaPartitions;
import org.eclipse.jface.text.BadLocationException;
@@ -52,7 +49,6 @@
import org.jboss.tools.seam.internal.core.el.ELOperandToken;
import org.jboss.tools.seam.internal.core.el.ELToken;
import org.jboss.tools.seam.internal.core.el.SeamELCompletionEngine;
-import org.jboss.tools.seam.internal.core.el.SeamELOperandTokenizer;
import org.jboss.tools.seam.internal.core.el.SeamELTokenizer;
import org.jboss.tools.seam.internal.core.el.TypeInfoCollector;
@@ -277,14 +273,9 @@
position = 0;
}
-// Set<ISeamContextVariable> usedVariables = new
HashSet<ISeamContextVariable>();
-// Map<String, TypeInfoCollector.MethodInfo> unpairedGettersOrSetters = new
HashMap<String, TypeInfoCollector.MethodInfo>();
-
-// List<String> suggestions = engine.getCompletions(project, file, operand,
prefix, position, true, usedVariables, unpairedGettersOrSetters);
-
SeamELCompletionEngine.SeamELOperandResolveStatus status =
engine.resolveSeamELOperand(project, file, operand, prefix, position, true);
-
+
if(status.getUsedVariables().size()==0 && status.isError()) {
// Save resources with unknown variables names
validationContext.addUnnamedElResource(file.getFullPath());
@@ -314,18 +305,14 @@
return;
}
-// SeamELOperandTokenizer tokenizer = new SeamELOperandTokenizer(operand, position +
prefix.length());
-// List<ELOperandToken> tokens = tokenizer.getTokens();
List<ELOperandToken> tokens = status.getUnresolvedTokens();
-
+
for (ELOperandToken token : tokens) {
if((token.getType()==ELOperandToken.EL_NAME_TOKEN) ||
(token.getType()==ELOperandToken.EL_METHOD_TOKEN)) {
-// if(!isResolvedVar(token.getText(), usedVariables)) {
- varName = token.getText();
- offsetOfVarName = documnetOffset + operandToken.getStart() + token.getStart();
- lengthOfVarName = varName.length();
- break;
-// }
+ varName = token.getText();
+ offsetOfVarName = documnetOffset + operandToken.getStart() + token.getStart();
+ lengthOfVarName = varName.length();
+ break;
}
}
}
@@ -339,15 +326,6 @@
addError(INVALID_EXPRESSION_MESSAGE_ID, SeamPreferences.INVALID_EXPRESSION, new
String[]{varName}, lengthOfVarName, offsetOfVarName, file);
}
- private boolean isResolvedVar(String varName, Set<ISeamContextVariable>
usedVariables) {
- for (ISeamContextVariable seamContextVariable : usedVariables) {
- if(varName.equals(seamContextVariable.getName())) {
- return true;
- }
- }
- return false;
- }
-
public static class EL {
private String value;
private int length;