public boolean verify(JComponent input) {
if (input instanceof DataField && !this.getAllowIncompleteFields()){
DataField df = (DataField)input;
AbstractFormatter formatter = df.getFormatter();
if (formatter != null) {
// attempt to apply the mask to the text ....
String text = df.getText();
try {
formatter.stringToValue(text);
df.thisFieldIsInError = false;
return true;
}
catch (ParseException pe) {
// the text did not match the mask .... lets see if the text is really empty
if (df.firstKey) {
df.thisFieldIsInError = false;
return true;
}
else if (this.allowsEmptyMasks) {
try {
String mask = formatter.valueToString(null);
if (mask.equals(text)) {
// the mask is empty ... this is OK ... make sure that the datafield is really empty
df.clearValue();
df.thisFieldIsInError = false;