1 14 package org.wings.plaf.css; 15 16 17 import java.io.IOException ; 18 19 import org.wings.SComponent; 20 import org.wings.SFileChooser; 21 import org.wings.io.Device; 22 23 public class FileChooserCG extends AbstractComponentCG implements 24 org.wings.plaf.FileChooserCG { 25 26 public void writeContent(final Device device, 27 final SComponent _c) 28 throws IOException { 29 final SFileChooser component = (SFileChooser) _c; 30 31 int columns = component.getColumns(); 32 38 40 device.print("<input type=\"file\""); 42 43 Utils.printCSSInlineFullSize(device, component.getPreferredSize()); 44 45 Utils.optAttribute(device, "size", columns); 46 Utils.optAttribute(device, "accept", component.getFileNameFilter()); 47 48 if (component.isEnabled()) { 49 device.print(" name=\""); 50 Utils.write(device, Utils.event(component)); 51 device.print("\""); 52 device.print(" id=\""); 53 Utils.write(device, component.getName()); 54 device.print("\""); 55 } 56 else 57 device.print(" readonly=\"true\""); 58 59 if (component.isFocusOwner()) 60 Utils.optAttribute(device, "focus", component.getName()); 61 62 Utils.optAttribute(device, "tabindex", component.getFocusTraversalIndex()); 63 64 Utils.writeEvents(device, component); 65 device.print("/>"); 66 } 67 } 68 | Popular Tags |