1 14 package org.wings.plaf.css; 15 16 17 import org.wings.SComponent; 18 import org.wings.SIcon; 19 import org.wings.SSpacer; 20 import org.wings.io.Device; 21 import org.wings.session.SessionManager; 22 23 import java.io.IOException ; 24 25 public class SpacerCG extends AbstractComponentCG implements org.wings.plaf.SpacerCG { 26 29 private static final SIcon BLIND_ICON = (SIcon) SessionManager.getSession() 30 .getCGManager().getObject("SpacerCG.blindIcon", SIcon.class); 31 32 public void writeContent(final Device device, final SComponent c) throws IOException { 33 final SSpacer component = (SSpacer) c; 34 int height = component.getPreferredSize().getIntHeight(); 35 int width = component.getPreferredSize().getIntWidth(); 36 device.print("<img"); 37 Utils.optAttribute(device, "src", BLIND_ICON.getURL()); 38 Utils.optAttribute(device, "width", width); 39 Utils.optAttribute(device, "height", height); 40 device.print(" alt=\""); 41 device.print(BLIND_ICON.getIconTitle()); 42 device.print("\"/>"); 43 } 44 } 45 | Popular Tags |