1 13 package com.tonbeller.wcf.catedit; 14 15 import org.w3c.dom.Document ; 16 import org.w3c.dom.Element ; 17 18 import com.tonbeller.wcf.controller.RequestContext; 19 20 25 public class DefaultCategoryElementRenderer implements CategoryElementRenderer { 26 String elementName = "cat-category"; 27 28 31 public DefaultCategoryElementRenderer() { 32 super(); 33 } 34 35 38 public Element render(RequestContext context, Document factory, Category cat) { 39 Element elem = factory.createElement(elementName); 40 elem.setAttribute("name", cat.getName()); 41 elem.setAttribute("icon", cat.getIcon()); 42 return elem; 43 } 44 45 49 public String getElementName() { 50 return elementName; 51 } 52 53 57 public void setElementName(String elementName) { 58 this.elementName = elementName; 59 } 60 61 } 62 | Popular Tags |