Source Code Cross Referenced for Alerts.java in  » Ajax » dwr » jsx3 » gui » 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 » dwr » jsx3.gui 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2005 Joe Walker
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of 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,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:        package jsx3.gui;
017:
018:        import org.directwebremoting.ScriptBuffer;
019:        import org.directwebremoting.proxy.ScriptProxy;
020:        import org.directwebremoting.proxy.io.Context;
021:
022:        /**
023:         * Mixin interface allows implementors to show alerts, confirms, and prompts.
024:         * @author Joe Walker [joe at getahead dot org]
025:         * @author DRAPGEN - Dwr Reverse Ajax Proxy GENerator
026:         */
027:        public class Alerts extends jsx3.lang.Object {
028:            /**
029:             * All reverse ajax proxies need context to work from
030:             * @param scriptProxy The place we are writing scripts to
031:             * @param context The script that got us to where we are now
032:             */
033:            public Alerts(Context context, String extension,
034:                    ScriptProxy scriptProxy) {
035:                super (context, extension, scriptProxy);
036:            }
037:
038:            /**
039:             * implementors of this mixin interface must implement this method
040:             * @return the parent of the alert dialogs
041:             */
042:            @SuppressWarnings("unchecked")
043:            public jsx3.app.Model getAlertsParent() {
044:                String extension = "getAlertsParent().";
045:                try {
046:                    java.lang.reflect.Constructor<jsx3.app.Model> ctor = jsx3.app.Model.class
047:                            .getConstructor(Context.class, String.class,
048:                                    ScriptProxy.class);
049:                    return ctor.newInstance(this , extension, getScriptProxy());
050:                } catch (Exception ex) {
051:                    throw new IllegalArgumentException("Unsupported type: "
052:                            + jsx3.app.Model.class.getName());
053:                }
054:            }
055:
056:            /**
057:             * implementors of this mixin interface must implement this method
058:             * @param returnType The expected return type
059:             * @return the parent of the alert dialogs
060:             */
061:            @SuppressWarnings("unchecked")
062:            public <T> T getAlertsParent(Class<T> returnType) {
063:                String extension = "getAlertsParent().";
064:                try {
065:                    java.lang.reflect.Constructor<T> ctor = returnType
066:                            .getConstructor(Context.class, String.class,
067:                                    ScriptProxy.class);
068:                    return ctor.newInstance(this , extension, getScriptProxy());
069:                } catch (Exception ex) {
070:                    throw new IllegalArgumentException(
071:                            "Unsupported return type: " + returnType.getName());
072:                }
073:            }
074:
075:            /**
076:             * show an alert dialog
077:             * @param strTitle the title of the dialog
078:             * @param strMessage the message to display
079:             * @param fctOnOk callback function on pressing ok button, receives the dialog as an argument; if null the dialog will close itself; if defined must explicitly close the dialog
080:             * @param strOk the text of the ok button, can be false to remove button from display
081:             * @param objParams argument to configureAlert()
082:             */
083:            public void alert(String strTitle, String strMessage,
084:                    org.directwebremoting.proxy.CodeBlock fctOnOk,
085:                    String strOk, String objParams) {
086:                ScriptBuffer script = new ScriptBuffer();
087:                script.appendCall(getContextPath() + "alert", strTitle,
088:                        strMessage, fctOnOk, strOk, objParams);
089:                getScriptProxy().addScript(script);
090:            }
091:
092:            /**
093:             * show a text box input prompt
094:             * @param strTitle the title of the dialog
095:             * @param strMessage the message to display
096:             * @param fctOnOk callback function on pressing ok button, receives the dialog as an argument, and the value of the text input as a second argument; if null the dialog will close itself; if defined must explicitly close the dialog
097:             * @param fctOnCancel callback function on pressing cancel button, receives the dialog as an argument; if null the dialog will close itself; if defined must explicitly close the dialog
098:             * @param strOk the text of the ok button
099:             * @param strCancel the text of the cancel button
100:             * @param objParams argument to configureAlert()
101:             */
102:            public void prompt(String strTitle, String strMessage,
103:                    org.directwebremoting.proxy.CodeBlock fctOnOk,
104:                    org.directwebremoting.proxy.CodeBlock fctOnCancel,
105:                    String strOk, String strCancel, String objParams) {
106:                ScriptBuffer script = new ScriptBuffer();
107:                script.appendCall(getContextPath() + "prompt", strTitle,
108:                        strMessage, fctOnOk, fctOnCancel, strOk, strCancel,
109:                        objParams);
110:                getScriptProxy().addScript(script);
111:            }
112:
113:            /**
114:             * show a confirm alert
115:             * @param strTitle the title of the dialog
116:             * @param strMessage the message to display
117:             * @param fctOnOk callback function on pressing ok button, receives the dialog as an argument; if null the dialog will close itself; if defined must explicitly close the dialog
118:             * @param fctOnCancel callback function on pressing cancel button, receives the dialog as an argument; if null the dialog will close itself; if defined must explicitly close the dialog
119:             * @param strOk the text of the ok button
120:             * @param strCancel the text of the cancel button
121:             * @param intBtnDefault the bold button that receives return key, 1:ok, 2:cancel, 3:no
122:             * @param fctOnNo callback function on pressing no button, receives the dialog as an argument; if null the dialog will close itself; if defined must explicitly close the dialog
123:             * @param strNo the text of the no button
124:             * @param objParams argument to configureAlert()
125:             */
126:            public void confirm(String strTitle, String strMessage,
127:                    org.directwebremoting.proxy.CodeBlock fctOnOk,
128:                    org.directwebremoting.proxy.CodeBlock fctOnCancel,
129:                    String strOk, String strCancel, int intBtnDefault,
130:                    org.directwebremoting.proxy.CodeBlock fctOnNo,
131:                    String strNo, String objParams) {
132:                ScriptBuffer script = new ScriptBuffer();
133:                script.appendCall(getContextPath() + "confirm", strTitle,
134:                        strMessage, fctOnOk, fctOnCancel, strOk, strCancel,
135:                        intBtnDefault, fctOnNo, strNo, objParams);
136:                getScriptProxy().addScript(script);
137:            }
138:
139:            /**
140:             * configure the dialog
141:             * @param objDialog the dialog
142:             * @param objParams may include fields 'width', 'height', 'noTitle', and 'nonModal'.
143:             */
144:            public void configureAlert(java.lang.Object objDialog,
145:                    jsx3.lang.Object objParams) {
146:                ScriptBuffer script = new ScriptBuffer();
147:                script.appendCall(getContextPath() + "configureAlert",
148:                        objDialog, objParams);
149:                getScriptProxy().addScript(script);
150:            }
151:
152:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.