01: package org.wings.text;
02:
03: import javax.swing.*;
04: import java.text.ParseException;
05:
06: /**
07: * Created by IntelliJ IDEA.
08: * User: hengels
09: * Date: Jul 17, 2006
10: * Time: 8:50:36 PM
11: * To change this template use File | Settings | File Templates.
12: */
13: public class SwingFormatter extends SAbstractFormatter {
14: JFormattedTextField.AbstractFormatter formatter;
15:
16: public SwingFormatter(
17: JFormattedTextField.AbstractFormatter formatter) {
18: this .formatter = formatter;
19: }
20:
21: public Object stringToValue(String text) throws ParseException {
22: return formatter.stringToValue(text);
23: }
24:
25: public String valueToString(Object value) throws ParseException {
26: return formatter.valueToString(value);
27: }
28: }
|