1 14 package org.wings.plaf.css; 15 16 17 import java.io.IOException ; 18 19 import org.wings.SComponent; 20 import org.wings.SDesktopPane; 21 import org.wings.SDimension; 22 import org.wings.SInternalFrame; 23 import org.wings.io.Device; 24 25 public class DesktopPaneCG extends AbstractComponentCG implements 26 org.wings.plaf.DesktopPaneCG { 27 public void installCG(SComponent component) { 28 super.installCG(component); 29 component.setPreferredSize(new SDimension("100%", null)); 30 } 31 32 public void writeContent(final Device device, final SComponent _c) 33 throws IOException 34 { 35 final SDesktopPane component = (SDesktopPane) _c; 36 SDesktopPane desktop = (SDesktopPane) component; 37 boolean maximized = false; 39 40 device.print("<div class=\"spacer\"> </div>"); 41 int componentCount = desktop.getComponentCount(); 42 for (int i = 0; i < componentCount; i++) { 43 SInternalFrame frame = (SInternalFrame) desktop.getComponent(i); 44 if (!frame.isClosed() && frame.isMaximized()) { 45 frame.write(device); 46 maximized = true; 47 } 48 } 49 50 if (!maximized) { 51 for (int i = 0; i < componentCount; i++) { 52 SInternalFrame frame = (SInternalFrame) desktop.getComponent(i); 53 if (!frame.isClosed() && !frame.isIconified()) { 54 frame.write(device); 55 } 56 } 57 } 58 device.print("<div class=\"spacer\"> </div>"); 59 if (!maximized) { 60 for (int i = 0; i < componentCount; i++) { 61 SInternalFrame frame = (SInternalFrame) desktop.getComponent(i); 62 if (!frame.isClosed() && frame.isIconified()) { 63 frame.write(device); 64 } 65 } 66 } 67 device.print("<div class=\"spacer\"> </div>"); 68 69 } 70 } 71 | Popular Tags |