1 14 package org.wings.plaf.css.msie; 15 16 import org.wings.*; 17 import org.wings.io.Device; 18 import org.wings.plaf.css.Utils; 19 20 import java.io.IOException ; 21 import java.util.List ; 22 23 28 public class FlowLayoutCG extends org.wings.plaf.css.FlowLayoutCG { 29 34 public void write(Device d, SLayoutManager l) throws IOException { 35 final SFlowLayout layout = (SFlowLayout) l; 36 final int alignment = layout.getAlignment(); 37 final int orientation = layout.getOrientation(); 38 39 if (alignment == SConstants.CENTER && orientation == SConstants.HORIZONTAL) { 40 final List components = layout.getComponents(); 41 final SContainer container = layout.getContainer(); 42 43 Utils.printNewline(d, container); 44 d.print("<table"); 45 Utils.printDivHorizontalAlignment(d, alignment); 46 d.print(" class=\"SFlowLayout\">"); 47 48 int count = 0; 49 for (int i = 0; i < components.size(); i++) { 50 SComponent comp = (SComponent) components.get(i); 51 if (comp.isVisible()) { 52 if (count == 0) { 53 printLayouterTableHeader(d, null, 0, 0, 0, layout); 54 d.print("<tr><td"); 55 } 57 else 58 d.print("</td><td"); 59 60 Utils.printTableCellAlignment(d, comp); 61 d.print(">"); 62 comp.write(d); count++; 64 } 65 } 66 if (count > 0) { 67 d.print("</td></tr>"); 68 printLayouterTableFooter(d, "SFlowLayout", layout); 69 } 70 71 Utils.printNewline(d, container); 72 d.print("</table>"); 73 } else { 74 super.write(d, l); 76 } 77 } 78 } 79 | Popular Tags |