01: /*
02: * Copyright 2000,2005 wingS development team.
03: *
04: * This file is part of wingS (http://wingsframework.org).
05: *
06: * wingS is free software; you can redistribute it and/or modify
07: * it under the terms of the GNU Lesser General Public License
08: * as published by the Free Software Foundation; either version 2.1
09: * of the License, or (at your option) any later version.
10: *
11: * Please see COPYING for the complete licence.
12: */
13: package org.wings.plaf.css;
14:
15: import org.wings.SComponent;
16: import org.wings.SSpacer;
17: import org.wings.io.Device;
18: import java.io.IOException;
19:
20: public final class SpacerCG extends AbstractComponentCG implements
21: org.wings.plaf.SpacerCG {
22:
23: private static final long serialVersionUID = 1L;
24:
25: public void writeInternal(final Device device, final SComponent c)
26: throws IOException {
27: final SSpacer component = (SSpacer) c;
28: int height = component.getPreferredSize().getHeightInt();
29: int width = component.getPreferredSize().getWidthInt();
30: device.print("<img");
31: Utils.optAttribute(device, "src", getBlindIcon().getURL());
32: Utils.optAttribute(device, "width", width);
33: Utils.optAttribute(device, "height", height);
34: Utils.optAttribute(device, "class", "spacer");
35: Utils.optAttribute(device, "id", c.getName());
36: Utils.attribute(device, "alt", null);
37: device.print("/>");
38: }
39: }
|