Author: scabanovich
Date: 2008-09-30 05:58:19 -0400 (Tue, 30 Sep 2008)
New Revision: 10554
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELUtil.java
Log:
JBIDE-1497.
Minor improvements
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELUtil.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELUtil.java 2008-09-30
09:19:15 UTC (rev 10553)
+++
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELUtil.java 2008-09-30
09:58:19 UTC (rev 10554)
@@ -12,8 +12,25 @@
import java.util.List;
+import org.jboss.tools.common.el.core.parser.LexicalToken;
+
public class ELUtil {
+ public static ELInstance findInstance(ELModel model, int offset) {
+ if(model == null) return null;
+ List<ELInstance> is = model.getInstances();
+ for (ELInstance i: is) {
+ if(i.getStartPosition() >= offset) continue;
+ LexicalToken c = i.getCloseInstanceToken();
+ if(c != null) {
+ if(c.getStart() >= offset) return i;
+ } else {
+ if(i.getEndPosition() >= offset) return i;
+ }
+ }
+ return null;
+ }
+
public static ELInvocationExpression findExpression(ELModel model, int offset) {
ELInvocationExpression result = null;
int off = -1;
Show replies by date