1 14 package org.wings.plaf.css; 15 16 17 import org.wings.SComponent; 18 import org.wings.SConstants; 19 import org.wings.SSeparator; 20 import org.wings.io.Device; 21 22 import java.io.IOException ; 23 24 public class SeparatorCG extends AbstractComponentCG implements 25 org.wings.plaf.SeparatorCG { 26 27 28 public void writeContent(final Device device, 29 final SComponent _c) 30 throws IOException { 31 final SSeparator component = (SSeparator) _c; 32 33 device.print("<hr"); 34 Utils.optAttribute(device, "class", component.getStyle()); 35 Utils.optAttribute(device, "width", component.getWidth()); 36 Utils.optAttribute(device, "size", component.getSize()); 37 38 switch (component.getAlignment()) { 39 case SConstants.RIGHT_ALIGN: 40 device.print(" align=\"right\""); 41 break; 42 case SConstants.CENTER_ALIGN: 43 device.print(" align=\"center\""); 44 break; 45 case SConstants.BLOCK_ALIGN: 46 device.print(" align=\"justify\""); 47 break; 48 } 49 ; 50 if (!component.getShade()) { 51 device.print(" noshade=\"true\""); 52 } 53 device.print("/>\n"); 54 } 55 } 56 | Popular Tags |