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.SDimension;
17: import org.wings.STable;
18: import org.wings.template.propertymanagers.SComponentPropertyManager;
19:
20: import java.awt.*;
21:
22: /**
23: * @author <a href="mailto:haaf@mercatis.de">Armin Haaf</a>
24: */
25: public class STablePropertyManager extends SComponentPropertyManager {
26: static final Class[] classes = { STable.class };
27:
28: public STablePropertyManager() {
29: }
30:
31: public void setProperty(SComponent comp, String name, String value) {
32: STable t = (STable) comp;
33: if (name.equals("GRID"))
34: t.setShowGrid(Boolean.valueOf(value).booleanValue());
35: else if (name.equals("CELLSPACING"))
36: t.setIntercellSpacing(new SDimension(value, value));
37: else if (name.equals("CELLPADDING"))
38: t.setIntercellPadding(new SDimension(value, value));
39: else if (name.equals("SELECTION_FOREGROUND"))
40: t.setSelectionForeground(Color.decode(value));
41: else if (name.equals("SELECTION_BACKGROUND"))
42: t.setSelectionBackground(Color.decode(value));
43: else
44: super .setProperty(comp, name, value);
45: }
46:
47: public Class[] getSupportedClasses() {
48: return classes;
49: }
50: }
|