Source Code Cross Referenced for FramePanel.java in  » Ajax » MyGWT » net » mygwt » ui » client » widget » 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 » Ajax » MyGWT » net.mygwt.ui.client.widget 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * MyGWT Widget Library
003:         * Copyright(c) 2007, MyGWT.
004:         * licensing@mygwt.net
005:         * 
006:         * http://mygwt.net/license
007:         */
008:        package net.mygwt.ui.client.widget;
009:
010:        import java.util.Stack;
011:
012:        import net.mygwt.ui.client.MyGWT;
013:
014:        import com.google.gwt.user.client.DOM;
015:        import com.google.gwt.user.client.Element;
016:        import com.google.gwt.user.client.ui.Widget;
017:
018:        /**
019:         * Displays an iframe under a element to stop IE bleed through and applet
020:         * related issues.
021:         */
022:        public class FramePanel extends Widget {
023:
024:            private static Stack frameStack = new Stack();
025:
026:            /**
027:             * Returns a frame panel from the stack.
028:             * 
029:             * @return the frame panel
030:             */
031:            public static FramePanel pop() {
032:                FramePanel panel = frameStack.size() > 0 ? (FramePanel) frameStack
033:                        .pop()
034:                        : null;
035:                if (panel == null) {
036:                    panel = new FramePanel();
037:                }
038:                return panel;
039:            }
040:
041:            /**
042:             * Pushes a panel back onto the stack.
043:             * 
044:             * @param panel the panel
045:             */
046:            public static void push(FramePanel panel) {
047:                frameStack.push(panel);
048:            }
049:
050:            /**
051:             * Creates a new frame panel.
052:             */
053:            private FramePanel() {
054:                Element frame = DOM.createIFrame();
055:                setElement(frame);
056:                if (MyGWT.isIE && MyGWT.isSecure) {
057:                    DOM.setElementProperty(getElement(), "src",
058:                            MyGWT.SSL_SECURE_URL);
059:                }
060:            }
061:
062:            /**
063:             * Removes the panel.
064:             * 
065:             * @param element the parent element
066:             */
067:            public native void onHide(Element element) /*-{
068:              var frame = this.@com.google.gwt.user.client.ui.UIObject::element;
069:              frame.parentNode.removeChild(frame);
070:             }-*/;
071:
072:            /**
073:             * Displays the panel behind the given element.
074:             * 
075:             * @param element the element
076:             */
077:            public void onShow(Element element) {
078:                if (MyGWT.isIE) {
079:                    bindIE(element, getElement());
080:                } else {
081:                    bindOther(element, getElement());
082:                }
083:            }
084:
085:            /**
086:             * Displays the panel behind the given element.
087:             * 
088:             * @param element the element
089:             * @param zIndex the z index
090:             */
091:            public void onShow(Element element, int zIndex) {
092:                onShow(element);
093:                setZIndex(zIndex);
094:            }
095:
096:            /**
097:             * Sets the z-index of the panel.
098:             * 
099:             * @param index the z index
100:             */
101:            public void setZIndex(int index) {
102:                index = Math.max(1, index);
103:                if (MyGWT.isIE) {
104:                    setZIndexIE(index);
105:                } else {
106:                    DOM.setIntStyleAttribute(getElement(), "zIndex", index);
107:                }
108:            }
109:
110:            public void sync(Element element) {
111:                if (MyGWT.isIE) {
112:                    syncIE(element, getElement());
113:                } else {
114:                    syncOther(element, getElement());
115:                }
116:            }
117:
118:            private native void bindIE(Element parent, Element frame) /*-{
119:                frame.scrolling = 'no';
120:                frame.frameBorder = 0;
121:                frame.style.position = 'absolute';
122:                frame.className = 'my-frame-panel';
123:                parent.__frame = frame;
124:                frame.__parent = parent;
125:                frame.style.setExpression('left', parent.offsetLeft);
126:                frame.style.setExpression('top', parent.offsetTop);
127:                frame.style.setExpression('width', parent.offsetWidth);
128:                frame.style.setExpression('height', parent.offsetHeight);
129:                parent.parentElement.insertBefore(frame, parent);
130:              }-*/;
131:
132:            private native void bindOther(Element parent, Element frame) /*-{
133:                frame.scrolling = 'no';
134:                frame.frameBorder = 0;
135:                frame.style.position = 'absolute';
136:                frame.className = 'my-frame-panel';
137:                parent.__frame = frame;
138:                frame.__parent = parent;
139:                frame.style.left = parent.offsetLeft + 'px';
140:                frame.style.top = parent.offsetTop + 'px';
141:                frame.style.width = parent.offsetWidth + 'px';
142:                frame.style.height = parent.offsetHeight + 'px'; 
143:                parent.parentNode.insertBefore(frame, parent);
144:              }-*/;
145:
146:            private native void setZIndexIE(int index) /*-{
147:                var frame = this.@com.google.gwt.user.client.ui.UIObject::element;
148:                frame.style.setExpression('zIndex', index);
149:              }-*/;
150:
151:            private native void syncIE(Element parent, Element frame) /*-{
152:                frame.style.setExpression('left', parent.offsetLeft);
153:                frame.style.setExpression('top', parent.offsetTop);
154:                frame.style.setExpression('width', parent.offsetWidth);
155:                frame.style.setExpression('height', parent.offsetHeight);
156:             }-*/;
157:
158:            private native void syncOther(Element parent, Element frame) /*-{
159:                frame.style.left = parent.offsetLeft + 'px';
160:                frame.style.top = parent.offsetTop + 'px';
161:                frame.style.width = parent.offsetWidth + 'px';
162:                frame.style.height = parent.offsetHeight + 'px'; 
163:             }-*/;
164:
165:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.