[Schmitzm-commits] r1890 - trunk/schmitzm-core/src/main/java/de/schmitzm/swing
scm-commit at wald.intevation.org
scm-commit at wald.intevation.org
Thu Mar 8 10:43:59 CET 2012
Author: mojays
Date: 2012-03-08 10:43:58 +0100 (Thu, 08 Mar 2012)
New Revision: 1890
Modified:
trunk/schmitzm-core/src/main/java/de/schmitzm/swing/LimitedDocument.java
Log:
LimitedDocument: also allow "." for style STYLE_BASIC_STRING
Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/swing/LimitedDocument.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/swing/LimitedDocument.java 2012-03-03 20:43:12 UTC (rev 1889)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/swing/LimitedDocument.java 2012-03-08 09:43:58 UTC (rev 1890)
@@ -31,8 +31,8 @@
/** Document style to only accept number signs and up to two dots. */
public static final int STYLE_DOTTED_DATE = 5;
- /** Document style to only allow basic characters (A-Z, a-z, 0-9, '_', '-')
- * and no number as first sign. */
+ /** Document style to only allow basic characters (A-Z, a-z, 0-9, '_', '-', '.')
+ * and no number or dot as first sign. */
public static final int STYLE_BASIC_STRING = 6;
/** Holds the conversion style for the document. */
@@ -150,8 +150,9 @@
break;
case STYLE_BASIC_STRING:
// if ( !complStr.matches("[[\\w-]&&\\D]+[\\w-]*") )
- if ( !completeStr.matches("[\\w-&&\\D]+[\\w-]*") )
- return;
+// if ( !completeStr.matches("[\\w-&&\\D]+[\\w-]*") )
+ if ( !completeStr.matches("[\\w-&&\\D]+[\\w-|\\.]*") )
+ return;
break;
case STYLE_DOTTED_DATE:
if ( !completeStr.matches("(\\d{1,4}|$)(\\.|$)(\\d{1,2}|$)(\\.|$)(\\d{1,4}|$)") )
More information about the Schmitzm-commits
mailing list