KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > wings > plaf > css > msie > InternalFrameCG


1 /*
2  * $Id: InternalFrameCG.java,v 1.5 2005/05/26 15:58:45 neurolabs Exp $
3  * Copyright 2000,2005 wingS development team.
4  *
5  * This file is part of wingS (http://www.j-wings.org).
6  *
7  * wingS is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU Lesser General Public License
9  * as published by the Free Software Foundation; either version 2.1
10  * of the License, or (at your option) any later version.
11  *
12  * Please see COPYING for the complete licence.
13  */

14 package org.wings.plaf.css.msie;
15
16 import java.io.IOException JavaDoc;
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     /* (non-Javadoc)
26      * @see org.wings.plaf.css.InternalFrameCG#writeWindowBar(org.wings.io.Device, org.wings.SInternalFrame)
27      */

28     protected void writeWindowBar(Device device, SInternalFrame frame) throws IOException JavaDoc {
29         String JavaDoc text = frame.getTitle();
30         if (text == null)
31             text = "wingS";
32         device.print("<div class=\"WindowBar\">");
33         if (frame.isIconified()) {
34             // frame is rendered in taskbar
35
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\">&nbsp;&nbsp;</td></tr></table>");
76         }
77         device.print("</div>");
78     }
79
80 }
81
Popular Tags