Source Code Cross Referenced for SplitPaneCG.java in  » Swing-Library » wings3 » org » wings » 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.wings.plaf.css 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.wings.plaf.css;
002:
003:        import org.wings.io.Device;
004:        import org.wings.*;
005:        import org.wings.header.Header;
006:        import org.wings.header.SessionHeaders;
007:        import org.wings.plaf.css.script.OnPageRenderedScript;
008:
009:        import java.io.IOException;
010:        import java.util.List;
011:        import java.util.ArrayList;
012:
013:        public class SplitPaneCG extends AbstractComponentCG implements 
014:                org.wings.plaf.SplitPaneCG {
015:            public static final String CSS_EXT_CORE = "CSS.extCoreCSS";
016:            public static final String JS_EXT_EXT = "JS.extExt";
017:            public static final String JS_EXT_YUI_BRIDGE = "JS.extYuiBridge";
018:            public static final String JS_EXT_DOM_QUERY = "JS.extDomQuery";
019:            public static final String JS_EXT_OBSERVABLE = "JS.extObservable";
020:            public static final String JS_EXT_EVENT_MANAGER = "JS.extEventManager";
021:            public static final String JS_EXT_DOM_HELPER = "JS.extDomHelper";
022:            public static final String JS_EXT_ELEMENT = "JS.extElement";
023:            public static final String JS_EXT_DD_CORE = "JS.extDDCore";
024:            public static final String JS_EXT_SPLITBAR = "JS.extSplitBar";
025:
026:            protected final List<Header> headers = new ArrayList<Header>();
027:
028:            public SplitPaneCG() {
029:                headers.add(Utils
030:                        .createExternalizedCSSHeaderFromProperty(CSS_EXT_CORE));
031:                headers.add(Utils
032:                        .createExternalizedJSHeaderFromProperty(JS_EXT_EXT));
033:                headers
034:                        .add(Utils
035:                                .createExternalizedJSHeaderFromProperty(JS_EXT_DOM_QUERY));
036:                headers
037:                        .add(Utils
038:                                .createExternalizedJSHeaderFromProperty(JS_EXT_YUI_BRIDGE));
039:                headers
040:                        .add(Utils
041:                                .createExternalizedJSHeaderFromProperty(JS_EXT_OBSERVABLE));
042:                headers
043:                        .add(Utils
044:                                .createExternalizedJSHeaderFromProperty(JS_EXT_EVENT_MANAGER));
045:                headers
046:                        .add(Utils
047:                                .createExternalizedJSHeaderFromProperty(JS_EXT_DOM_HELPER));
048:                headers
049:                        .add(Utils
050:                                .createExternalizedJSHeaderFromProperty(JS_EXT_ELEMENT));
051:
052:                headers
053:                        .add(Utils
054:                                .createExternalizedJSHeaderFromProperty(JS_EXT_DD_CORE));
055:                headers
056:                        .add(Utils
057:                                .createExternalizedJSHeaderFromProperty(JS_EXT_SPLITBAR));
058:            }
059:
060:            public void installCG(final SComponent comp) {
061:                super .installCG(comp);
062:                SessionHeaders.getInstance().registerHeaders(headers);
063:            }
064:
065:            public void uninstallCG(SComponent component) {
066:                super .uninstallCG(component);
067:                SessionHeaders.getInstance().deregisterHeaders(headers);
068:            }
069:
070:            public void writeInternal(final Device device,
071:                    final SComponent component) throws java.io.IOException {
072:                final SSplitPane splitPane = (SSplitPane) component;
073:                String name = splitPane.getName();
074:
075:                device.print("<table");
076:                Utils.writeAllAttributes(device, component);
077:                Utils.writeEvents(device, component, null);
078:                device.print(">");
079:
080:                StringBuilder scriptBuilder = STRING_BUILDER.get();
081:                scriptBuilder.setLength(0);
082:
083:                if (splitPane.getOrientation() == SSplitPane.VERTICAL_SPLIT) {
084:                    String topPaneName = name + "_t";
085:                    String bottomPaneName = name + "_b";
086:                    String splitBarName = name + "_tb";
087:
088:                    writeSplitterScript(scriptBuilder, splitBarName,
089:                            topPaneName, splitPane.getDividerLocation(),
090:                            "Ext.SplitBar.VERTICAL", "Ext.SplitBar.TOP");
091:                    splitPane.getSession().getScriptManager()
092:                            .addScriptListener(
093:                                    new OnPageRenderedScript(scriptBuilder
094:                                            .toString()));
095:
096:                    writeVertical(device, topPaneName, splitPane
097:                            .getTopComponent());
098:                    writeVerticalSplitter(device, splitBarName, splitPane
099:                            .getDividerSize());
100:                    writeVertical(device, bottomPaneName, splitPane
101:                            .getBottomComponent());
102:                } else {
103:                    String leftPaneName = name + "_l";
104:                    String rightPaneName = name + "_r";
105:                    String splitBarName = name + "_lr";
106:
107:                    writeSplitterScript(scriptBuilder, splitBarName,
108:                            leftPaneName, splitPane.getDividerLocation(),
109:                            "Ext.SplitBar.HORIZONTAL", "Ext.SplitBar.LEFT");
110:                    splitPane.getSession().getScriptManager()
111:                            .addScriptListener(
112:                                    new OnPageRenderedScript(scriptBuilder
113:                                            .toString()));
114:
115:                    device.print("<tr>");
116:                    writeHorizontal(device, leftPaneName, splitPane
117:                            .getLeftComponent());
118:                    writeHorizontalSplitter(device, splitBarName, splitPane
119:                            .getDividerSize());
120:                    writeHorizontal(device, rightPaneName, splitPane
121:                            .getRightComponent());
122:                    device.print("</tr>");
123:                }
124:
125:                device.print("</table>");
126:            }
127:
128:            protected void writeSplitterScript(StringBuilder scriptBuilder,
129:                    String splitBarName, String paneName, int location,
130:                    String orientation, String placement) {
131:                scriptBuilder.append("var ");
132:                scriptBuilder.append(splitBarName);
133:                scriptBuilder.append(" = new Ext.SplitBar('");
134:                scriptBuilder.append(splitBarName);
135:                scriptBuilder.append("', '");
136:                scriptBuilder.append(paneName);
137:                scriptBuilder.append("', ");
138:                scriptBuilder.append(orientation);
139:                scriptBuilder.append(", ");
140:                scriptBuilder.append(placement);
141:                scriptBuilder.append(");\n");
142:                if (location != -1) {
143:                    scriptBuilder.append(splitBarName);
144:                    scriptBuilder.append(".setCurrentSize(");
145:                    scriptBuilder.append(location);
146:                    scriptBuilder.append(");\n");
147:                }
148:                scriptBuilder.append(splitBarName);
149:                scriptBuilder
150:                        .append(".on('moved', wingS.component.splitPaneResized);");
151:            }
152:
153:            protected void writeVertical(Device device, String paneName,
154:                    SComponent paneComponent) throws IOException {
155:                device.print("<tr><td id=\"");
156:                device.print(paneName);
157:                device.print("\">");
158:                paneComponent.write(device);
159:                device.print("</td></tr>");
160:            }
161:
162:            protected void writeVerticalSplitter(Device device, String name,
163:                    int dividerSize) throws IOException {
164:                device.print("<tr><td style=\"height: ");
165:                device.print(dividerSize);
166:                device.print("px\" class=\"splitter\" id=\"");
167:                device.print(name);
168:                device.print("\"></td></tr>");
169:            }
170:
171:            protected void writeHorizontal(Device device, String paneName,
172:                    SComponent paneComponent) throws IOException {
173:                device.print("<td id=\"");
174:                device.print(paneName);
175:                device.print("\">");
176:                paneComponent.write(device);
177:                device.print("</td>");
178:            }
179:
180:            protected void writeHorizontalSplitter(Device device, String name,
181:                    int dividerSize) throws IOException {
182:                device.print("<td style=\"width: ");
183:                device.print(dividerSize);
184:                device.print("px\" class=\"splitter\" id=\"");
185:                device.print(name);
186:                device.print("\"></td>");
187:            }
188:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.