KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > wcf > toolbar > ToolSeparator


1 /*
2  * ====================================================================
3  * This software is subject to the terms of the Common Public License
4  * Agreement, available at the following URL:
5  * http://www.opensource.org/licenses/cpl.html .
6  * Copyright (C) 2003-2004 TONBELLER AG.
7  * All Rights Reserved.
8  * You must accept the terms of that agreement to use this software.
9  * ====================================================================
10  *
11  *
12  */

13 package com.tonbeller.wcf.toolbar;
14
15 import org.w3c.dom.Element JavaDoc;
16
17 import com.tonbeller.wcf.controller.RequestContext;
18 import com.tonbeller.wcf.utils.DomUtils;
19
20 /**
21  * separator for toolbar
22  * @author av
23  */

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 JavaDoc parent) throws Exception JavaDoc {
39     Element JavaDoc 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