package org.vaadin.textfieldformatter;

import com.vaadin.ui.AbstractTextField;

public class CustomStringBlockFormatter extends AbstractTextFieldFormatterExtension {

	public CustomStringBlockFormatter(AbstractTextField field, int[] blocks, String[] delimiters, ForceCase forceCase, boolean numericOnly) {
		super(field);
		getState().formatBlocks = blocks;
		getState().delimiters = delimiters;
		if (forceCase == ForceCase.UPPER) {
			getState().lowercase = false;
			getState().uppercase = true;			
		} else if (forceCase == ForceCase.LOWER) {
			getState().lowercase = true;
			getState().uppercase = false;
		}
		getState().numericOnly = numericOnly;
	}

	public CustomStringBlockFormatter(AbstractTextField field, int[] blocks, String[] delimiters, ForceCase forceCase) {
		this(field, blocks, delimiters, forceCase, false);
	}
	
	public CustomStringBlockFormatter(AbstractTextField field, int[] blocks, ForceCase forceCase) {
		this(field, blocks, null, forceCase);
	}
	
	public CustomStringBlockFormatter(AbstractTextField field, int[] blocks) {
		this(field, blocks, null, ForceCase.NONE);
	}
	
	public enum ForceCase {
		NONE,
		UPPER,
		LOWER
	}
}

@@ -161,16 +161,872 @@
 sion %7B%0A%0A
+%09/**%0A%09 * Creates an instance of CustomStringBlockFormatter%0A%09 * %0A%09 * @param field%0A%09 *            the AbstractTextField to create the extension for%0A%09 * @param blocks%0A%09 *            an array configuring the character blocks. The length of the array%0A%09 *            is the number of character blocks. The integers in the array are%0A%09 *            the length of the blocks.%0A%09 * @param delimiters%0A%09 *            the delimiter characters to be used between the character blocks%0A%09 * @param forceCase%0A%09 *            enumeration to control letter case of characters. One of%0A%09 *            ForceCase.NONE don't touch letter case. ForceCase.LOWER transform%0A%09 *            characters to lower case. ForceCase.UPPER transform characters to%0A%09 *            upper case.%0A%09 * @param numericOnly%0A%09 *            true for allowing numeric characters only. Defaults to false.%0A%09 */%0A
 %09public 
@@ -1132,17 +1132,20 @@
 rceCase,
- 
+%0A%09%09%09
 boolean 
@@ -1351,19 +1351,16 @@
  = true;
-%09%09%09
 %0A%09%09%7D els
@@ -1676,34 +1676,33 @@
 ase, false);%0A%09%7D%0A
-%09
 %0A
+
 %09public CustomSt
@@ -1821,26 +1821,25 @@
 ceCase);%0A%09%7D%0A
-%09
 %0A
+
 %09public Cust
@@ -1954,10 +1954,9 @@
 %0A%09%7D%0A
-%09
 %0A
+
 %09pub
@@ -1987,20 +1987,16 @@
 ONE,
-%0A%09%09
+ 
 UPPER,
-%0A%09%09
+ 
 LOWE

Add some javadoc