webwork/src/main/webwork/util/editor DateFormatEditor.java,NONE,1.1

[email protected] Sun, 23 Jun 2002 16:51:51 -0700
Newsgroups gmane.comp.java.webwork.cvs
Message-ID <[email protected]>
Update of /cvsroot/webwork/webwork/src/main/webwork/util/editor
In directory usw-pr-cvs1:/tmp/cvs-serv29823

Added Files:
	DateFormatEditor.java 
Log Message:
new

--- NEW FILE: DateFormatEditor.java ---
/*
 * WebWork, Web Application Framework
 *
 * Distributable under Apache license.
 * See terms of license at opensource.org
 */
package webwork.util.editor;

import webwork.action.ValidationEditorSupport;
import webwork.action.ActionContext;
import webwork.util.DateFormatter;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Locale;

/**
 *	@see java.beans.PropertyEditorSupport
 *	@see ValidationEditorSupport
 *	@author Matt Baldree ([email protected])
 *	@version $Revision: 1.1 $
 */
public class DateFormatEditor extends ValidationEditorSupport {

   public void setAsText(String txt) {
      try {
         setValue(new SimpleDateFormat(txt));
      } catch (Exception e) {
         throw new IllegalArgumentException("Unable to set value for " + txt);
      }
   }
}





-------------------------------------------------------
Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/