KickJava   Java API By Example, From Geeks To Geeks.

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


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 java.io.IOException JavaDoc;
8 import java.io.Writer JavaDoc;
9 import java.util.ResourceBundle JavaDoc;
10 import org.exoplatform.text.template.DataHandler;
11 import org.exoplatform.text.template.DataHandlerManager;
12
13 /**
14  * @author Tuan Nguyen (tuan08@users.sourceforge.net)
15  * @since Feb 1, 2005
16  * @version $Id$
17  */

18 public class Span extends Text {
19   public Span(String JavaDoc value) {
20     super(value);
21   }
22   
23   public void render(DataHandlerManager manager,
24                      ResourceBundle JavaDoc res, Writer JavaDoc w) throws IOException JavaDoc {
25     if(cssClass_ == null) {
26       w.write("<span>") ;
27     } else {
28       w.write("<span class='") ; w.write(cssClass_); w.write("'>") ;
29     }
30     DataHandler dh = manager.getDataHandler(dataHandlerType_);
31     w.write(resolveValueAsString(data_ ,dh, res)) ;
32     w.write("</span>") ;
33   }
34 }
Popular Tags