Author: vrubezhny
Date: 2008-04-30 11:37:11 -0400 (Wed, 30 Apr 2008)
New Revision: 7920
Modified:
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/JBIDE-2144 Different behavior of cursors after selection
value from proposal list using CA.
issue is fixed
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 2008-04-30
15:37:02 UTC (rev 7919)
+++
trunk/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)
@@ -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();