Source Code Cross Referenced for ColumnFormat.java in  » Ajax » dwr » jsx3 » gui » matrix » 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.matrix 
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.matrix;
017:
018:        import org.directwebremoting.ScriptBuffer;
019:        import org.directwebremoting.proxy.ScriptProxy;
020:        import org.directwebremoting.proxy.io.Context;
021:
022:        /**
023:         * A class that defines the methods required for an object to be used by Matrix.Column instances to
024:         format cells of data.
025:         * @author Joe Walker [joe at getahead dot org]
026:         * @author DRAPGEN - Dwr Reverse Ajax Proxy GENerator
027:         */
028:        public class ColumnFormat extends jsx3.lang.Object {
029:            /**
030:             * All reverse ajax proxies need context to work from
031:             * @param scriptProxy The place we are writing scripts to
032:             * @param context The script that got us to where we are now
033:             */
034:            public ColumnFormat(Context context, String extension,
035:                    ScriptProxy scriptProxy) {
036:                super (context, extension, scriptProxy);
037:            }
038:
039:            /**
040:             * Returns a column formatter for a string key. The key may be one of the following:
041:
042:
043:                  @unescape Ð 
044:
045:                  @unescape_all Ð 
046:
047:                  @lookup Ð 
048:
049:                  @datetime[,(short|medium|long|full,format)] Ð 
050:
051:                  @date[,(short|medium|long|full,format)] Ð 
052:
053:                  @time[,(short|medium|long|full,format)] Ð 
054:
055:                  @number[,(integer|percent|currency,format)] Ð 
056:
057:                  @message,format
058:                   Ð
059:             * @param strKey 
060:             * @param objColumn 
061:             */
062:            @SuppressWarnings("unchecked")
063:            public jsx3.gui.matrix.ColumnFormat getInstance(String strKey,
064:                    jsx3.gui.matrix.Column objColumn) {
065:                String extension = "getInstance(\"" + strKey + "\", \""
066:                        + objColumn + "\").";
067:                try {
068:                    java.lang.reflect.Constructor<jsx3.gui.matrix.ColumnFormat> ctor = jsx3.gui.matrix.ColumnFormat.class
069:                            .getConstructor(Context.class, String.class,
070:                                    ScriptProxy.class);
071:                    return ctor.newInstance(this , extension, getScriptProxy());
072:                } catch (Exception ex) {
073:                    throw new IllegalArgumentException("Unsupported type: "
074:                            + jsx3.gui.matrix.ColumnFormat.class.getName());
075:                }
076:            }
077:
078:            /**
079:             * Classes that implement this interface must provide this method to allow for browser-specific or similar type 'switch'. If
080:            false is returned, the formatter will not even attempt to iterate
081:             * @param callback true if the formatter should be called to iterate and format
082:             */
083:            @SuppressWarnings("unchecked")
084:            public void validate(
085:                    org.directwebremoting.proxy.Callback<Boolean> callback) {
086:                ScriptBuffer script = new ScriptBuffer();
087:                String callbackPrefix = "";
088:
089:                if (callback != null) {
090:                    callbackPrefix = "var reply = ";
091:                }
092:
093:                script.appendCall(callbackPrefix + getContextPath()
094:                        + "validate");
095:
096:                if (callback != null) {
097:                    String key = org.directwebremoting.extend.CallbackHelper
098:                            .saveCallback(callback, Boolean.class);
099:                    script
100:                            .appendCall("__System.activateCallback", key,
101:                                    "reply");
102:                }
103:
104:                getScriptProxy().addScript(script);
105:            }
106:
107:            /**
108:             * Formats the Matrix cell, a native DIV element.
109:             * @param objDiv on-screen DIV element to be formatted. Note that this DIV is contained within a TD
110:             * @param strCDFKey CDF record id for the record in the data model bound to the affected on-screen row
111:             * @param objMatrix matrix instance
112:             * @param objMatrixColumn matrix column instance
113:             * @param intRowNumber row number for row containing this cell (1-based)
114:             * @param objServer server instance. Useful for querying locale (for localized output)
115:             */
116:            public void format(String objDiv, String strCDFKey,
117:                    jsx3.gui.Matrix objMatrix,
118:                    jsx3.gui.matrix.Column objMatrixColumn, int intRowNumber,
119:                    jsx3.app.Server objServer) {
120:                ScriptBuffer script = new ScriptBuffer();
121:                script.appendCall(getContextPath() + "format", objDiv,
122:                        strCDFKey, objMatrix, objMatrixColumn, intRowNumber,
123:                        objServer);
124:                getScriptProxy().addScript(script);
125:            }
126:
127:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.