01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package org.terracotta.dso.editors.xmlbeans;
05:
06: import org.eclipse.swt.widgets.Text;
07:
08: import java.text.NumberFormat;
09: import java.text.ParseException;
10:
11: public class XmlIntegerField extends XmlStringField {
12: public XmlIntegerField(Text field) {
13: super (field);
14: }
15:
16: public void set() {
17: try {
18: int i = NumberFormat.getIntegerInstance().parse(getText())
19: .intValue();
20: setText(Integer.toString(i));
21: } catch (ParseException nfe) {/**/
22: }
23:
24: super.set();
25: }
26: }
|