Source Code Cross Referenced for FormPanelImpl.java in  » Ajax » GWT » com » google » gwt » user » client » ui » impl » 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 » GWT » com.google.gwt.user.client.ui.impl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2007 Google Inc.
003:         * 
004:         * Licensed under the Apache License, Version 2.0 (the "License"); you may not
005:         * use this file except in compliance with the License. You may obtain a copy of
006:         * the License at
007:         * 
008:         * http://www.apache.org/licenses/LICENSE-2.0
009:         * 
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
012:         * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
013:         * License for the specific language governing permissions and limitations under
014:         * the License.
015:         */
016:        package com.google.gwt.user.client.ui.impl;
017:
018:        import com.google.gwt.user.client.Element;
019:
020:        /**
021:         * Implementation class used by {@link com.google.gwt.user.client.ui.FormPanel}.
022:         */
023:        public class FormPanelImpl {
024:
025:            /**
026:             * Gets the response html from the loaded iframe.
027:             * 
028:             * @param iframe the iframe from which the response html is to be extracted
029:             * @return the response html
030:             */
031:            public native String getContents(Element iframe) /*-{
032:               try {
033:                 // Make sure the iframe's window & document are loaded.
034:                 if (!iframe.contentWindow || !iframe.contentWindow.document)
035:                   return null;
036:
037:                 // Get the body's entire inner HTML.
038:                 return iframe.contentWindow.document.body.innerHTML;
039:               } catch (e) {
040:                 return null;
041:               }
042:             }-*/;
043:
044:            /**
045:             * Gets the form element's encoding.
046:             * 
047:             * @param form the form whose encoding is to be retrieved
048:             * @return the form's encoding type
049:             */
050:            public native String getEncoding(Element form) /*-{
051:               // We can always get 'enctype', no matter which browser, because we set
052:               // both 'encoding' and 'enctype' in setEncoding().
053:               return form.enctype;
054:             }-*/;
055:
056:            /**
057:             * Hooks the iframe's onLoad event and the form's onSubmit event.
058:             * 
059:             * @param iframe the iframe whose onLoad event is to be hooked
060:             * @param form the form whose onSubmit event is to be hooked
061:             * @param listener the listener to receive notification
062:             */
063:            public native void hookEvents(Element iframe, Element form,
064:                    FormPanelImplHost listener) /*-{
065:               if (iframe) {
066:                 iframe.onload = function() {
067:                   // If there is no __formAction yet, this is a spurious onload
068:                   // generated when the iframe is first added to the DOM.
069:                   if (!iframe.__formAction)
070:                     return;
071:
072:                   listener.@com.google.gwt.user.client.ui.impl.FormPanelImplHost::onFrameLoad()();
073:                 };
074:               }
075:
076:               form.onsubmit = function() {
077:                 // Hang on to the form's action url, needed in the
078:                 // onload/onreadystatechange handler.
079:                 if (iframe)
080:                   iframe.__formAction = form.action;
081:                 return listener.@com.google.gwt.user.client.ui.impl.FormPanelImplHost::onFormSubmit()();
082:               };
083:             }-*/;
084:
085:            /**
086:             * Sets the form element's encoding.
087:             * 
088:             * @param form the form whose encoding is to be set
089:             * @param encoding the new encoding type
090:             */
091:            public native void setEncoding(Element form, String encoding) /*-{
092:               // To be safe, setting both.
093:               form.enctype = encoding;
094:               form.encoding = encoding;
095:             }-*/;
096:
097:            /**
098:             * Submits a form.
099:             * 
100:             * @param form the form to be submitted
101:             * @param iframe the iframe that is targetted, or <code>null</code>
102:             */
103:            public native void submit(Element form, Element iframe) /*-{
104:               // Hang on to the form's action url, needed in the
105:               // onload/onreadystatechange handler.
106:               if (iframe)
107:                 iframe.__formAction = form.action;
108:               form.submit();
109:             }-*/;
110:
111:            /**
112:             * Unhooks the iframe's onLoad event.
113:             * 
114:             * @param iframe the iframe whose onLoad event is to be unhooked
115:             * @param form the form whose onSubmit event is to be unhooked
116:             */
117:            public native void unhookEvents(Element iframe, Element form) /*-{
118:               if (iframe)
119:                 iframe.onload = null;
120:               form.onsubmit = null;
121:             }-*/;
122:        }
w_w___w.j___a___v__a_2__s.___c___o_m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.