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