KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > faces > core > renderer > html > BorderDecorator


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.faces.core.renderer.html;
6
7 import java.io.IOException JavaDoc ;
8 import javax.faces.component.UIComponent ;
9 import javax.faces.context.FacesContext ;
10 import javax.faces.context.ResponseWriter;
11 /**
12  * @author Tuan Nguyen (tuan08@users.sourceforge.net)
13  * @since Oct 26, 2004
14  * @version $Id: BorderDecorator.java,v 1.1 2004/10/27 02:52:15 tuan08 Exp $
15  */

16 public class BorderDecorator extends Decorator {
17   
18   public BorderDecorator(String JavaDoc cssClass) {
19     super(cssClass) ;
20   }
21   
22   public void decorate(FacesContext context, UIComponent uiComponent) throws IOException JavaDoc {
23     ResponseWriter w = context.getResponseWriter() ;
24     w.write("<table class='") ;w.write(cssClass_); w.write("'>") ;
25     w. write("<tr>");
26     w. write("<td class='top-left'>"); w.write("<img SRC='/skin/blank.gif'/>"); w.write("</td>");
27     w. write("<td class='top-middle'>"); w.write("<img SRC='/skin/blank.gif'/>"); w.write("</td>");
28     w. write("<td class='top-right'>"); w.write("<img SRC='/skin/blank.gif'/>"); w.write("</td>");
29     w. write("</tr>");
30     
31     w. write("<tr>");
32     w. write("<td class='middle-left'>"); w.write("<img SRC='/skin/blank.gif'/>"); w.write("</td>");
33     w. write("<td>");
34     render(context, uiComponent) ;
35     w. write("</td>");
36     w. write("<td class='middle-right'>"); w.write("<img SRC='/skin/blank.gif'/>"); w.write("</td>");
37     w. write("</tr>");
38     
39     w. write("<tr>");
40     w. write("<td class='bottom-left'>"); w.write("<img SRC='/skin/blank.gif'/>"); w.write("</td>");
41     w. write("<td class='bottom-middle'>"); w.write("<img SRC='/skin/blank.gif'/>"); w.write("</td>");
42     w. write("<td class='bottom-right'>"); w.write("<img SRC='/skin/blank.gif'/>"); w.write("</td>");
43     w. write("</tr>");
44     w.write("</table>") ;
45   }
46 }
Popular Tags