Source Code Cross Referenced for LoadMask.java in  » Ajax » gwtext-2.01 » com » gwtext » client » widgets » 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 » gwtext 2.01 » com.gwtext.client.widgets 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * GWT-Ext Widget Library
003:         * Copyright(c) 2007-2008, GWT-Ext.
004:         * licensing@gwt-ext.com
005:         * 
006:         * http://www.gwt-ext.com/license
007:         */
008:        package com.gwtext.client.widgets;
009:
010:        import com.google.gwt.core.client.JavaScriptObject;
011:        import com.google.gwt.user.client.Element;
012:        import com.gwtext.client.core.JsObject;
013:        import com.gwtext.client.util.JavaScriptObjectHelper;
014:
015:        /**
016:         * A simple utility class for generically masking elements while loading data. If the element being masked has an
017:         * underlying {@link com.gwtext.client.data.Store}, the masking will be automatically synchronized with the store's
018:         * loading process and the mask element will be cached for reuse. For all other elements, this mask will replace the
019:         * element's UpdateManager load indicator and will be destroyed after the initial load.
020:         */
021:        public class LoadMask extends JsObject {
022:
023:            private String message;
024:            private String messageCls = "x-mask-loading";
025:            private boolean removeMask;
026:
027:            /**
028:             * Create a new LoadMask.
029:             *
030:             * @param element the element to mask
031:             * @param message the text to display in a centered loading message box
032:             */
033:            public LoadMask(Element element, String message) {
034:                this .message = message;
035:                JavaScriptObject config = JavaScriptObjectHelper.createObject();
036:                JavaScriptObjectHelper.setAttribute(config, "msg", message);
037:                jsObj = create(element, config);
038:            }
039:
040:            /**
041:             * Create a new LoadMask.
042:             *
043:             * @param element the element to mask
044:             * @param message the text to display in a centered loading message box
045:             * @param messageCls the CSS class to apply to the loading message element (defaults to "x-mask-loading").
046:             * @param removeMask  true to create a single-use mask that is automatically destroyed after loading (useful for page loads),
047:             * false to persist the mask element reference for multiple uses (e.g., for paged data widgets).
048:             */
049:            public LoadMask(Element element, String message, String messageCls,
050:                    boolean removeMask) {
051:                this .message = message;
052:                this .messageCls = messageCls;
053:                this .removeMask = removeMask;
054:                JavaScriptObject config = JavaScriptObjectHelper.createObject();
055:                JavaScriptObjectHelper.setAttribute(config, "msg", message);
056:                JavaScriptObjectHelper.setAttribute(config, "msgCls",
057:                        messageCls);
058:                JavaScriptObjectHelper.setAttribute(config, "removeMask",
059:                        removeMask);
060:                jsObj = create(element, config);
061:            }
062:
063:            /**
064:             * Create a new LoadMask.
065:             *
066:             * @param id     the element ID to mask
067:             * @param message the text to display in a centered loading message box
068:             */
069:            public LoadMask(String id, String message) {
070:                this .message = message;
071:                JavaScriptObject config = JavaScriptObjectHelper.createObject();
072:                JavaScriptObjectHelper.setAttribute(config, "msg", message);
073:                jsObj = create(id, config);
074:            }
075:
076:            /**
077:             * Create a new LoadMask.
078:             *
079:             * @param id     the element ID to mask
080:             * @param message the text to display in a centered loading message box
081:             * @param messageCls the CSS class to apply to the loading message element (defaults to "x-mask-loading").
082:             * @param removeMask  true to create a single-use mask that is automatically destroyed after loading (useful for page loads),
083:             * false to persist the mask element reference for multiple uses (e.g., for paged data widgets).
084:             */
085:            public LoadMask(String id, String message, String messageCls,
086:                    boolean removeMask) {
087:                this .message = message;
088:                this .messageCls = messageCls;
089:                this .removeMask = removeMask;
090:                JavaScriptObject config = JavaScriptObjectHelper.createObject();
091:                JavaScriptObjectHelper.setAttribute(config, "msg", message);
092:                JavaScriptObjectHelper.setAttribute(config, "msgCls",
093:                        messageCls);
094:                JavaScriptObjectHelper.setAttribute(config, "removeMask",
095:                        removeMask);
096:                jsObj = create(id, config);
097:            }
098:
099:            private native JavaScriptObject create(Element element,
100:                    JavaScriptObject config) /*-{
101:                   return new $wnd.Ext.LoadMask(element, config);
102:               }-*/;
103:
104:            private native JavaScriptObject create(String id,
105:                    JavaScriptObject config) /*-{
106:                   return new $wnd.Ext.LoadMask(id, config);
107:               }-*/;
108:
109:            /**
110:             * Disables the mask to prevent it from being displayed.
111:             */
112:            public native void disable() /*-{
113:                   var lm = this.@com.gwtext.client.core.JsObject::getJsObj()();
114:                   lm.disable();
115:               }-*/;
116:
117:            /**
118:             * Enables the mask so that it can be displayed.
119:             */
120:            public native void enable() /*-{
121:                   var lm = this.@com.gwtext.client.core.JsObject::getJsObj()();
122:                   lm.enable();
123:               }-*/;
124:
125:            /**
126:             * True if the mask is currently disabled so that it will not be displayed (defaults to false)
127:             *
128:             * @return true if mask disabled
129:             */
130:            public native boolean isDisabled() /*-{
131:                   var lm = this.@com.gwtext.client.core.JsObject::getJsObj()();
132:                   return lm.disabled;
133:               }-*/;
134:
135:            /**
136:             * The text to display in a centered loading message box (defaults to 'Loading...').
137:             *
138:             * @return the messsage text
139:             */
140:            public String getMessage() {
141:                return message;
142:            }
143:
144:            /**
145:             * The CSS class to apply to the loading message element (defaults to "x-mask-loading").
146:             * 
147:             * @return the message CSS class
148:             */
149:            public String getMessageCls() {
150:                return messageCls;
151:            }
152:
153:            /**
154:             * True to create a single-use mask that is automatically destroyed after loading (useful for page loads), False to persist the mask element reference for multiple uses (e.g., for paged data widgets).
155:             * Defaults to false.
156:             * 
157:             * @return true to create a single-use mask
158:             */
159:            public boolean isRemoveMask() {
160:                return removeMask;
161:            }
162:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.