01: /*
02: * SwingML Copyright (C) 2002 Robert J. Morris.
03: *
04: * This library is free software; you can redistribute it and/or modify it under
05: * the terms of the GNU Lesser General Public License as published by the Free
06: * Software Foundation; either version 2 of the License, or (at your option) any
07: * later version.
08: *
09: * This library is distributed in the hope that it will be useful, but WITHOUT
10: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11: * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12: * details.
13: *
14: * You should have received a copy of the GNU Lesser General Public License
15: * along with this library; if not, write to the Free Software Foundation, Inc.,
16: * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17: *
18: * Authors: Robert J. Morris <robertj@morris.net>
19: *
20: */
21:
22: package org.swingml.model;
23:
24: import org.swingml.*;
25:
26: public class DataStoreModel extends SwingMLModel {
27:
28: private String value = null;
29:
30: public DataStoreModel() {
31: super ();
32: }
33:
34: public String getText() {
35: String result = super .getText();
36:
37: if (result == null) {
38: result = getValue();
39: }
40:
41: return result;
42: }
43:
44: public String getValue() {
45: return this .value;
46: }
47:
48: public void setValue(String aValue) {
49: if (aValue != null) {
50: aValue = aValue.trim();
51: }
52: this.value = aValue;
53: }
54: }
|