Author: vrubezhny
Date: 2008-04-30 11:42:25 -0400 (Wed, 30 Apr 2008)
New Revision: 7921
Modified:
branches/jbosstools-2.1.x/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-2144 Different behavior of cursors after selection
value from proposal list using CA.
issue is fixed
Modified:
branches/jbosstools-2.1.x/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
===================================================================
---
branches/jbosstools-2.1.x/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2008-04-30
15:37:11 UTC (rev 7920)
+++
branches/jbosstools-2.1.x/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2008-04-30
15:42:25 UTC (rev 7921)
@@ -77,7 +77,7 @@
private final String fPrefix;
private final String fNewPrefix;
private final int fOffset;
- private final int fNewPosition;
+ private int fNewPosition;
public Proposal(String string, String prefix, int offset) {
this(string, prefix, offset, offset + string.length());
@@ -177,6 +177,10 @@
*/
public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
apply(viewer.getDocument(), trigger, offset);
+
+ if (fString != null && fString.endsWith("}")) {
+ fNewPosition -= 1;
+ }
}
/*
@@ -230,6 +234,14 @@
public boolean isAutoInsertable() {
return false;
}
+
+ /**
+ * Return cursor position of proposal replacement string.
+ */
+ public int getCursorPosition() {
+ return fNewPosition;
+ }
+
}
private final SeamELCompletionEngine fEngine= new SeamELCompletionEngine();