Source Code Cross Referenced for DivisionCG.java in  » Swing-Library » wings3 » org » wingx » plaf » css » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Swing Library » wings3 » org.wingx.plaf.css 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.wingx.plaf.css;
002:
003:        import org.wings.plaf.css.*;
004:        import org.wings.plaf.CGManager;
005:        import org.wings.io.Device;
006:        import org.wings.SComponent;
007:        import org.wings.SIcon;
008:        import org.wings.session.SessionManager;
009:        import org.wingx.XDivision;
010:
011:        import java.io.IOException;
012:        import java.awt.*;
013:
014:        import org.wings.style.Style;
015:
016:        public class DivisionCG extends AbstractComponentCG implements 
017:                org.wingx.plaf.DivisionCG {
018:            private SIcon openIcon;
019:            private SIcon closedIcon;
020:
021:            public DivisionCG() {
022:                final CGManager manager = SessionManager.getSession()
023:                        .getCGManager();
024:
025:                setOpenIcon((SIcon) manager.getObject("DivisionCG.openIcon",
026:                        SIcon.class));
027:                setClosedIcon((SIcon) manager.getObject(
028:                        "DivisionCG.closedIcon", SIcon.class));
029:            }
030:
031:            public void setOpenIcon(SIcon openIcon) {
032:                this .openIcon = openIcon;
033:            }
034:
035:            public void setClosedIcon(SIcon closedIcon) {
036:                this .closedIcon = closedIcon;
037:            }
038:
039:            public void writeInternal(Device device, SComponent component)
040:                    throws IOException {
041:                XDivision division = (XDivision) component;
042:
043:                device.print("<table");
044:                Utils.writeAllAttributes(device, component);
045:                Utils.writeEvents(device, component, null);
046:                device
047:                        .print("><colgroup><col width=\"0*\"/><col width=\"1*\"></colgroup><tr ");
048:                if (division.isTitleClickable() && division.isEnabled()) {
049:                    Utils.printClickability(device, division, "t", division
050:                            .isEnabled(), true);
051:                }
052:                device.print("><td class=\"DivisionControl\"");
053:                SIcon icon = division.isShaded() ? closedIcon : openIcon;
054:                if (!division.isTitleClickable() && division.isEnabled()) {
055:                    Utils.printClickability(device, division, "t", division
056:                            .isEnabled(), true);
057:                }
058:
059:                if (isMSIE(component)
060:                        && PaddingVoodoo.hasPaddingInsets(division)) {
061:                    final Insets patchedInsets = new Insets(0, 0, 0, 0);
062:                    PaddingVoodoo.doBorderPaddingsWorkaround(division
063:                            .getBorder(), patchedInsets, true, true, false,
064:                            false);
065:                    Utils.optAttribute(device, "style", Utils
066:                            .createInlineStylesForInsets(patchedInsets)
067:                            .toString());
068:                }
069:
070:                device.print(">");
071:                writeIcon(device, icon, null);
072:                device.print("</td><td class=\"DivisionTitle\"");
073:                Style style = component
074:                        .getDynamicStyle(XDivision.SELECTOR_TITLE);
075:                if (isMSIE(component)
076:                        && PaddingVoodoo.hasPaddingInsets(division)) {
077:                    final Insets patchedInsets = new Insets(0, 0, 0, 0);
078:                    PaddingVoodoo.doBorderPaddingsWorkaround(division
079:                            .getBorder(), patchedInsets, true, false, true,
080:                            false);
081:                    Utils.optAttribute(device, "style", Utils
082:                            .createInlineStylesForInsets(patchedInsets)
083:                            .toString());
084:                } else
085:                    Utils.optAttribute(device, "style", style);
086:
087:                device.print(">");
088:                if (division.getIcon() != null) {
089:                    writeIcon(device, division.getIcon(), null);
090:                    device.print("&nbsp;");
091:                }
092:                if (division.getTitle() != null)
093:                    writeTitle(device, division.getTitle());
094:                device.print("</td></tr>");
095:
096:                if (!division.isShaded() && division.isEnabled()) {
097:                    device
098:                            .print("<tr><td></td><td class=\"DivisionContent\"><table class=\"DivisionContent\">");
099:                    Utils.renderContainer(device, division);
100:                    device.print("</table></td></tr>");
101:                }
102:                device.print("</table>");
103:            }
104:
105:            private void writeTitle(Device device, String text)
106:                    throws IOException {
107:                if ((text.length() > 5)
108:                        && (text.substring(0, 6).equalsIgnoreCase("<html>")))
109:                    Utils.writeRaw(device, text.substring(6));
110:                else
111:                    Utils.quote(device, text, true, true, false);
112:            }
113:
114:            protected void writeIcon(Device device, SIcon icon, String cssClass)
115:                    throws IOException {
116:                device.print("<img");
117:                if (cssClass != null) {
118:                    device.print(" class=\"");
119:                    device.print(cssClass);
120:                    device.print("\"");
121:                }
122:                Utils.optAttribute(device, "src", icon.getURL());
123:                Utils.optAttribute(device, "width", icon.getIconWidth());
124:                Utils.optAttribute(device, "height", icon.getIconHeight());
125:                device.print(" alt=\"");
126:                device.print(icon.getIconTitle());
127:                device.print("\"/>");
128:            }
129:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.