KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > wings > plaf > css > ToolbarCG


1 /*
2  * $Id: ToolbarCG.java,v 1.9 2005/05/26 15:58:45 neurolabs Exp $
3  * Copyright 2000,2005 wingS development team.
4  *
5  * This file is part of wingS (http://www.j-wings.org).
6  *
7  * wingS is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU Lesser General Public License
9  * as published by the Free Software Foundation; either version 2.1
10  * of the License, or (at your option) any later version.
11  *
12  * Please see COPYING for the complete licence.
13  */

14 package org.wings.plaf.css;
15
16 import org.wings.SComponent;
17 import org.wings.SConstants;
18 import org.wings.SToolbar;
19 import org.wings.io.Device;
20
21 import java.io.IOException JavaDoc;
22
23 public class ToolbarCG extends AbstractComponentCG implements
24         org.wings.plaf.ToolbarCG {
25     public void writeContent(final Device device, final SComponent _c)
26             throws IOException JavaDoc {
27         final SToolbar toolbar = (SToolbar) _c;
28
29         device.print("<table class=\"SLayout\"><tr>");
30         SComponent[] components = toolbar.getComponents();
31         for (int i = 0; i < components.length; i++) {
32             SComponent component = components[i];
33
34             if (component.getHorizontalAlignment() == SConstants.RIGHT_ALIGN)
35                 device.print("<td width=\"100%\" class=\"SLayout\"></td>");
36
37             device.print("<td class=\"SLayout\">");
38             component.write(device);
39             device.print("</td>");
40         }
41         device.print("</tr></table>");
42     }
43 }
44
Popular Tags