01: /*
02: #IFNDEF ALT_LICENSE
03: ThinWire(R) RIA Ajax Framework
04: Copyright (C) 2003-2007 Custom Credit Systems
05:
06: This library is free software; you can redistribute it and/or modify it under
07: the terms of the GNU Lesser General Public License as published by the Free
08: Software Foundation; either version 2.1 of the License, or (at your option) any
09: later version.
10:
11: This library is distributed in the hope that it will be useful, but WITHOUT ANY
12: WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13: PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14:
15: You should have received a copy of the GNU Lesser General Public License along
16: with this library; if not, write to the Free Software Foundation, Inc., 59
17: Temple Place, Suite 330, Boston, MA 02111-1307 USA
18:
19: Users who would rather have a commercial license, warranty or support should
20: contact the following company who invented, built and supports the technology:
21:
22: Custom Credit Systems, Richardson, TX 75081, USA.
23: email: info@thinwire.com ph: +1 (888) 644-6405
24: http://www.thinwire.com
25: #ENDIF
26: [ v1.2_RC2 ]
27: */
28: package thinwire.ui;
29:
30: /**
31: * @author Joshua J. Gertzen
32: */
33: public interface MaskEditorComponent extends EditorComponent {
34: public static final String PROPERTY_EDIT_MASK = "editMask";
35: public static final String PROPERTY_FORMAT_TEXT = "formatText";
36:
37: /**
38: * Get this TextField's edit mask
39: * @return the edit mask
40: */
41: public String getEditMask();
42:
43: /**
44: * This method accepts an edit mask as a String and applies it to the text field.
45: * @param editMask
46: */
47: public void setEditMask(String editMask);
48:
49: /**
50: * Determines whether the text returned by getText() is formatted.
51: * @return true if the text is formatted, false otherwise. Default is true.
52: */
53: public boolean isFormatText();
54:
55: /**
56: * Sets whether the text returned by getText() is formatted.
57: * If an editMask is specified that contains with format charcters, such as ###,###,###.## and
58: * this property is set to false, then the value returned by getText will not contain the the
59: * commas from the editMask. i.e. If the value in the field is 123,456.78 then 123456.78 would
60: * be returned. Whereas, if this property is set to true then 123,456.78 would be returned.
61: * Another example would be with a mask of MM/dd/yyyy, value of 11/21/1978. With this set to false
62: * you would get the value 11211978 by calling getText(), with it set to true, you'd get 11/21/1978.
63: * @param formatText true if you want the text formattted, false otherwise. Default is true.
64: */
65: public void setFormatText(boolean formatText);
66: }
|