1 13 package com.tonbeller.wcf.toolbar; 14 15 import org.w3c.dom.Element ; 16 17 import com.tonbeller.wcf.controller.RequestContext; 18 import com.tonbeller.wcf.utils.DomUtils; 19 20 24 public class ToolSeparator extends ToolBarComponentSupport { 25 int size; 26 27 public int getSize() { 28 return size; 29 } 30 31 public void setSize(int size) { 32 this.size = size; 33 } 34 35 public void initialize(RequestContext context, ToolBar owner) { 36 } 37 38 public void render(RequestContext context, Element parent) throws Exception { 39 Element sep = DomUtils.appendElement(parent, "tool-sep"); 40 if (size > 0) 41 sep.setAttribute("size", Integer.toString(size)); 42 else 43 sep.setAttribute("size", "1ex"); 44 } 45 46 public boolean isSeparator() { 47 return true; 48 } 49 50 } 51 | Popular Tags |