KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > text > template > xhtml > Properties


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

5 package org.exoplatform.text.template.xhtml;
6
7 import org.exoplatform.text.template.ObjectFormater ;
8 /**
9  * @author Tuan Nguyen (tuan08@users.sourceforge.net)
10  * @since Feb 3, 2005
11  * @version $Id$
12  */

13 public class Properties extends Table {
14   public Properties() {
15     setCssClass("UIProperties") ;
16   }
17   
18   public Properties addHeader(String JavaDoc header) {
19     add(new Row().
20         add(new HeaderCell(header).addArribute("colspan", "2"))) ;
21     return this ;
22   }
23   
24   public Properties add(String JavaDoc label, String JavaDoc value) {
25     add(new Row().
26         add(new Cell(label).setCssClass("key")).add(new Cell(value).setCssClass("value"))) ;
27     return this ;
28   }
29   
30   public Properties add(String JavaDoc label, String JavaDoc value, ObjectFormater formater) {
31     add(new Row().
32         add(new Cell(label).setCssClass("key")).
33         add(new Cell(value).setCssClass("value").setFomater(formater))) ;
34     return this ;
35   }
36   
37   public Properties add(Element label, Element value) {
38     add(new Row().add(label.setCssClass("key")).add(value.setCssClass("value"))) ;
39     return this ;
40   }
41 }
Popular Tags