1 14 package org.wings.plaf.css; 15 16 17 import java.io.IOException ; 18 19 import org.wings.SComponent; 20 import org.wings.STextField; 21 import org.wings.io.Device; 22 23 public class TextFieldCG extends AbstractComponentCG implements 24 org.wings.plaf.TextFieldCG { 25 26 public void writeContent(final Device device, 27 final SComponent _c) 28 throws IOException { 29 final STextField component = (STextField) _c; 30 31 device.print("<input type=\"text\""); 32 Utils.optAttribute(device, "size", component.getColumns()); 33 Utils.optAttribute(device, "maxlength", component.getMaxColumns()); 34 35 Utils.printCSSInlineFullSize(device, _c.getPreferredSize()); 36 37 if (!component.isEditable() || !component.isEnabled()) { 38 device.print(" readonly=\"true\""); 39 } 40 if (component.isEnabled()) { 41 device.print(" name=\""); 42 Utils.write(device, Utils.event(component)); 43 device.print("\""); 44 } else { 45 device.print(" disabled=\"true\""); 46 } 47 Utils.optAttribute(device, "tabindex", component.getFocusTraversalIndex()); 48 49 if (component.isFocusOwner()) 50 Utils.optAttribute(device, "focus", component.getName()); 51 52 Utils.writeEvents(device, component); 53 54 Utils.optAttribute(device, "value", component.getText()); 55 device.print("/>"); 56 } 57 } 58 | Popular Tags |