01: /*
02: * Copyright 2000,2005 wingS development team.
03: *
04: * This file is part of wingS (http://wingsframework.org).
05: *
06: * wingS is free software; you can redistribute it and/or modify
07: * it under the terms of the GNU Lesser General Public License
08: * as published by the Free Software Foundation; either version 2.1
09: * of the License, or (at your option) any later version.
10: *
11: * Please see COPYING for the complete licence.
12: */
13: package org.wings.template.propertymanagers;
14:
15: import org.wings.SComponent;
16: import org.wings.STextField;
17: import org.wings.template.propertymanagers.SComponentPropertyManager;
18:
19: /**
20: * @author <a href="mailto:haaf@mercatis.de">Armin Haaf</a>
21: */
22: public class STextFieldPropertyManager extends
23: SComponentPropertyManager {
24: static final Class[] classes = { STextField.class };
25:
26: public STextFieldPropertyManager() {
27: }
28:
29: public void setProperty(SComponent comp, String name, String value) {
30: STextField c = (STextField) comp;
31: if (name.equals("COLS"))
32: c.setColumns(Integer.parseInt(value));
33: else if (name.equals("SIZE"))
34: c.setColumns(Integer.parseInt(value));
35: else if (name.equals("MAXSIZE"))
36: c.setMaxColumns(Integer.parseInt(value));
37: else if (name.equals("MAXLENGTH"))
38: c.setMaxColumns(Integer.parseInt(value));
39: else
40: super .setProperty(comp, name, value);
41: }
42:
43: public Class[] getSupportedClasses() {
44: return classes;
45: }
46: }
|