summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJordan Dukadinov2012-03-23 11:31:16 (EDT)
committerJordan Dukadinov2012-04-04 09:01:16 (EDT)
commit3d98056435f70140e11250ca3259c969189e0168 (patch)
tree61616a42c3cb2c1a2ab54d53b428e21ad490766c
parent0da33d8a5744983bf04a10ad000b6840863e3bc4 (diff)
downloadorg.eclipse.riena-3d98056435f70140e11250ca3259c969189e0168.zip
org.eclipse.riena-3d98056435f70140e11250ca3259c969189e0168.tar.gz
org.eclipse.riena-3d98056435f70140e11250ca3259c969189e0168.tar.bz2
resolved bug 374184 - Missing error marker when
combining ValidCharacters and MinLength validations
-rw-r--r--org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/TextRidget.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/TextRidget.java b/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/TextRidget.java
index 4a144ce..b07d966 100644
--- a/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/TextRidget.java
+++ b/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/TextRidget.java
@@ -457,14 +457,19 @@ public class TextRidget extends AbstractEditableRidget implements ITextRidget {
if (inputConverter != null) {
e.text = (String) inputConverter.convert(e.text);
}
- final String newText = getText(e);
+ final String oldText = getUIText();
+ final String newText = getText(oldText, e);
final IStatus status = checkOnEditRules(newText, new ValidationCallback(true));
final boolean doit = !(status.getCode() == ValidationRuleStatus.ERROR_BLOCK_WITH_FLASH);
+ if (!doit) {
+ // we preserve the old text so we also have to restore the validation status
+ // see Bug 374184
+ checkOnEditRules(oldText, new ValidationCallback(false));
+ }
e.doit = doit;
}
- private String getText(final VerifyEvent e) {
- final String oldText = getUIText();
+ private String getText(final String oldText, final VerifyEvent e) {
String newText;
// deletion
if (e.keyCode == 127 || e.keyCode == 8) {