01: /*
02: * Copyright 2000,2005 wingS development team.
03: *
04: * This file is part of wingS (http://wingsframework.org).
05: *
06: * wingS is free software; you can redistribute it and/or modify
07: * it under the terms of the GNU Lesser General Public License
08: * as published by the Free Software Foundation; either version 2.1
09: * of the License, or (at your option) any later version.
10: *
11: * Please see COPYING for the complete licence.
12: */
13: package org.wings.plaf.css.msie;
14:
15: import org.wings.SInternalFrame;
16: import org.wings.event.SInternalFrameEvent;
17: import org.wings.io.Device;
18: import org.wings.plaf.css.Utils;
19:
20: import java.io.IOException;
21:
22: public final class InternalFrameCG extends
23: org.wings.plaf.css.InternalFrameCG {
24:
25: private static final long serialVersionUID = 1L;
26:
27: /* (non-Javadoc)
28: * @see org.wings.plaf.css.InternalFrameCG#writeWindowBar(org.wings.io.Device, org.wings.SInternalFrame)
29: */
30: protected void writeWindowBar(final Device device,
31: SInternalFrame frame) throws IOException {
32: String text = frame.getTitle();
33: if (text == null)
34: text = "wingS";
35:
36: device.print("<div class=\"WindowBar\" id=\"");
37: device.print(frame.getName());
38: device.print("_titlebar\">");
39: device
40: .print("<table width=\"100%\"><tr><td width=\"100%\"><div class=\"WindowBar_title\">");
41: if (frame.getIcon() != null) {
42: writeIcon(device, frame.getIcon(), WINDOWICON_CLASSNAME);
43: }
44: device.print(Utils.nonBreakingSpaces(text));
45: device.print("</div></td>");
46: if (frame.isIconifyable() && !frame.isIconified()
47: && getIconifyIcon() != null) {
48: device.print("<td>");
49: writeWindowIcon(device, frame,
50: SInternalFrameEvent.INTERNAL_FRAME_ICONIFIED,
51: getIconifyIcon());
52: device.print("</td>");
53: }
54: if (frame.isIconified() && getDeiconifyIcon() != null) {
55: device.print("<td>");
56: writeWindowIcon(device, frame,
57: SInternalFrameEvent.INTERNAL_FRAME_DEICONIFIED,
58: getDeiconifyIcon());
59: device.print("</td>");
60: }
61: if (frame.isMaximizable() && !frame.isMaximized()
62: && getMaximizeIcon() != null) {
63: device.print("<td>");
64: writeWindowIcon(device, frame,
65: SInternalFrameEvent.INTERNAL_FRAME_MAXIMIZED,
66: getMaximizeIcon());
67: device.print("</td>");
68: }
69: if (frame.isMaximized() && getUnmaximizeIcon() != null) {
70: device.print("<td>");
71: writeWindowIcon(device, frame,
72: SInternalFrameEvent.INTERNAL_FRAME_UNMAXIMIZED,
73: getUnmaximizeIcon());
74: device.print("</td>");
75: }
76: if (frame.isClosable() && getCloseIcon() != null) {
77: device.print("<td>");
78: writeWindowIcon(device, frame,
79: SInternalFrameEvent.INTERNAL_FRAME_CLOSED,
80: getCloseIcon());
81: device.print("</td>");
82: }
83: device.print("<td> </td></tr></table>");
84: device.print("</div>");
85: }
86: }
|