KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > wings > template > STablePropertyManager


1 /*
2  * $Id: STablePropertyManager.java,v 1.3 2004/12/01 07:54:28 hengels Exp $
3  * Copyright 2000,2005 wingS development team.
4  *
5  * This file is part of wingS (http://www.j-wings.org).
6  *
7  * wingS is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU Lesser General Public License
9  * as published by the Free Software Foundation; either version 2.1
10  * of the License, or (at your option) any later version.
11  *
12  * Please see COPYING for the complete licence.
13  */

14 package org.wings.template;
15
16 import org.wings.SComponent;
17 import org.wings.SDimension;
18 import org.wings.STable;
19
20 import java.awt.*;
21
22 /**
23  * @author <a HREF="mailto:haaf@mercatis.de">Armin Haaf</a>
24  * @version $Revision: 1.3 $
25  */

26 public class STablePropertyManager
27         extends SComponentPropertyManager {
28     static final Class JavaDoc[] classes = {STable.class};
29
30     public STablePropertyManager() {
31     }
32
33     public void setProperty(SComponent comp, String JavaDoc name, String JavaDoc value) {
34         STable t = (STable) comp;
35         if (name.equals("GRID"))
36             t.setShowGrid(Boolean.valueOf(value).booleanValue());
37         else if (name.equals("CELLSPACING"))
38             t.setIntercellSpacing(new SDimension(value, value));
39         else if (name.equals("CELLPADDING"))
40             t.setIntercellPadding(new SDimension(value, value));
41         else if (name.equals("SELECTION_FOREGROUND"))
42             t.setSelectionForeground(Color.decode(value));
43         else if (name.equals("SELECTION_BACKGROUND"))
44             t.setSelectionBackground(Color.decode(value));
45         else
46             super.setProperty(comp, name, value);
47     }
48
49     public Class JavaDoc[] getSupportedClasses() {
50         return classes;
51     }
52 }
53
54
55
Popular Tags