1 14 package org.wings.plaf.css.msie; 15 16 import java.io.IOException ; 17 18 import org.wings.SInternalFrame; 19 import org.wings.event.SInternalFrameEvent; 20 import org.wings.io.Device; 21 import org.wings.plaf.css.Utils; 22 23 public class InternalFrameCG extends org.wings.plaf.css.InternalFrameCG { 24 25 28 protected void writeWindowBar(Device device, SInternalFrame frame) throws IOException { 29 String text = frame.getTitle(); 30 if (text == null) 31 text = "wingS"; 32 device.print("<div class=\"WindowBar\">"); 33 if (frame.isIconified()) { 34 if (frame.getIcon() != null) { 36 writeIcon(device, frame.getIcon(), WINDOWICON_CLASSNAME); 37 } 38 if (getDeiconifyIcon() != null) { 39 device.print(Utils.nonBreakingSpaces(text)); 40 writeWindowIcon(device, frame, 41 SInternalFrameEvent.INTERNAL_FRAME_DEICONIFIED, getDeiconifyIcon(), "DeiconifyButton"); 42 } else { 43 device.print("<a HREF=\"").print( 44 frame.getRequestURL().addParameter( 45 Utils.event(frame) + "=" + SInternalFrameEvent.INTERNAL_FRAME_DEICONIFIED).toString()) 46 .print("\">"); 47 device.print(Utils.nonBreakingSpaces(text)); 48 device.print("</a>"); 49 } 50 } else { 51 device.print("<table class=\"SLayout\" width=\"100%\"><tr><td width=\"100%\" class=\"SLayout\"><div class=\"WindowBar_title\">"); 52 if (frame.getIcon() != null) { 53 writeIcon(device, frame.getIcon(), WINDOWICON_CLASSNAME); 54 } 55 device.print(Utils.nonBreakingSpaces(text)); 56 device.print("</div></td>"); 57 if (frame.isMaximizable() && !frame.isMaximized() && getMaximizeIcon() != null) { 58 device.print("<td class=\"SLayout\">"); 59 writeWindowIcon(device, frame, 60 SInternalFrameEvent.INTERNAL_FRAME_MAXIMIZED, getMaximizeIcon(), BUTTONICON_CLASSNAME); 61 device.print("</td>"); 62 } 63 if (frame.isIconifyable() && getIconifyIcon() != null) { 64 device.print("<td class=\"SLayout\">"); 65 writeWindowIcon(device, frame, 66 SInternalFrameEvent.INTERNAL_FRAME_ICONIFIED, getIconifyIcon(), BUTTONICON_CLASSNAME); 67 device.print("</td>"); 68 } 69 if (frame.isClosable() && getCloseIcon() != null) { 70 device.print("<td class=\"SLayout\">"); 71 writeWindowIcon(device, frame, 72 SInternalFrameEvent.INTERNAL_FRAME_CLOSED, getCloseIcon(), BUTTONICON_CLASSNAME); 73 device.print("</td>"); 74 } 75 device.print("<td class=\"SLayout\"> </td></tr></table>"); 76 } 77 device.print("</div>"); 78 } 79 80 } 81 | Popular Tags |