[Schmitzm-commits] r1644 - in trunk/schmitzm-core/src/main: java/de/schmitzm/swing resources/de/schmitzm/swing/resource/icons/small

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Jul 21 22:56:50 CEST 2011


Author: mojays
Date: 2011-07-21 22:56:49 +0200 (Thu, 21 Jul 2011)
New Revision: 1644

Added:
   trunk/schmitzm-core/src/main/resources/de/schmitzm/swing/resource/icons/small/email_link.png
Modified:
   trunk/schmitzm-core/src/main/java/de/schmitzm/swing/LimitedDocument.java
Log:
LimitedDocument: New style for simple strings (only A-Z,a-z,'_','-','0-9')
Added some general icons.


Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/swing/LimitedDocument.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/swing/LimitedDocument.java	2011-07-21 17:40:36 UTC (rev 1643)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/swing/LimitedDocument.java	2011-07-21 20:56:49 UTC (rev 1644)
@@ -29,6 +29,10 @@
   /** 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. */
+  public static final int STYLE_BASIC_STRING = 6;
+
   /** Holds the conversion style for the document. */
   protected int style = STYLE_CASESENSITIVE;
   /** Holds the character limit for the document. */
@@ -133,6 +137,12 @@
         if ( str.indexOf('.') != str.lastIndexOf('.') )
           return;
         break;
+      case STYLE_BASIC_STRING:
+        String complStr = getText(0, getLength()) + str;
+//        if ( !complStr.matches("[[\\w-]&&\\D]+[\\w-]*") )
+        if ( !complStr.matches("[\\w-&&\\D]+[\\w-]*") )
+          return;
+        break;
       case STYLE_DOTTED_DATE:
         String completeStr = getText(0, getLength()) + str;
         if ( !completeStr.matches("(\\d{1,4}|$)(\\.|$)(\\d{1,2}|$)(\\.|$)(\\d{1,4}|$)") )

Added: trunk/schmitzm-core/src/main/resources/de/schmitzm/swing/resource/icons/small/email_link.png
===================================================================
(Binary files differ)


Property changes on: trunk/schmitzm-core/src/main/resources/de/schmitzm/swing/resource/icons/small/email_link.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream



More information about the Schmitzm-commits mailing list