Source Code Cross Referenced for EditorGridPanel.java in  » Ajax » gwtext-2.01 » com » gwtext » client » widgets » grid » 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.grid 
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:
009:        package com.gwtext.client.widgets.grid;
010:
011:        import com.google.gwt.core.client.JavaScriptObject;
012:        import com.gwtext.client.data.Store;
013:        import com.gwtext.client.widgets.grid.event.EditorGridListener;
014:
015:        /**
016:         * Class for creating and editable grid.
017:         */
018:        public class EditorGridPanel extends GridPanel {
019:
020:            private static JavaScriptObject configPrototype;
021:
022:            static {
023:                init();
024:            }
025:
026:            private static native void init()/*-{
027:            		var c = new $wnd.Ext.grid.EditorGridPanel();
028:            		@com.gwtext.client.widgets.grid.EditorGridPanel::configPrototype = c.initialConfig;
029:            	}-*/;
030:
031:            protected JavaScriptObject getConfigPrototype() {
032:                return configPrototype;
033:            }
034:
035:            public String getXType() {
036:                return "editorgrid";
037:            }
038:
039:            public EditorGridPanel() {
040:            }
041:
042:            /**
043:             * Creates a new Editor Grid.
044:             *
045:             * @param store       the Grid's data store
046:             * @param columnModel the Grids column model
047:             */
048:            public EditorGridPanel(Store store, ColumnModel columnModel) {
049:                super (store, columnModel);
050:            }
051:
052:            public EditorGridPanel(JavaScriptObject jsObj) {
053:                super (jsObj);
054:            }
055:
056:            /**
057:             * Creates a new Editor Grid.
058:             *
059:             * @param id          the Grid ID
060:             * @param width       the Grid width
061:             * @param height      the Grid height
062:             * @param store       the Grid's data store
063:             * @param columnModel the Grids column model
064:             */
065:            public EditorGridPanel(String id, int width, int height,
066:                    Store store, ColumnModel columnModel) {
067:                super (id, width, height, store, columnModel);
068:            }
069:
070:            protected native JavaScriptObject create(JavaScriptObject configJS) /*-{
071:                   return new $wnd.Ext.grid.EditorGridPanel(configJS);
072:               }-*/;
073:
074:            /**
075:             * Add an EditorGridPanel listener.
076:             *
077:             * @param listener the listener
078:             */
079:            public native void addEditorGridListener(EditorGridListener listener)/*-{
080:                    var gridJ = this;
081:                
082:                    this.@com.gwtext.client.widgets.Component::addListener(Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)('afteredit',
083:                            function(e) {
084:                                var recordJ = @com.gwtext.client.data.Record::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(e.record);
085:                                var value = e.value === undefined ? null : $wnd.GwtExt.convertToJavaType(e.value);
086:                                var originalValue = e.originalValue === undefined ? null : $wnd.GwtExt.convertToJavaType(e.originalValue);
087:                                listener.@com.gwtext.client.widgets.grid.event.EditorGridListener::onAfterEdit(Lcom/gwtext/client/widgets/grid/GridPanel;Lcom/gwtext/client/data/Record;Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;II)(gridJ, recordJ, e.field, value , originalValue, e.row, e.column);
088:                            }
089:                    );        
090:
091:                    this.@com.gwtext.client.widgets.Component::addListener(Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)('beforeedit',
092:                            function(e) {
093:                                var recordJ = @com.gwtext.client.data.Record::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(e.record);
094:                                var value = e.value === undefined ? null : $wnd.GwtExt.convertToJavaType(e.value);
095:                                return listener.@com.gwtext.client.widgets.grid.event.EditorGridListener::doBeforeEdit(Lcom/gwtext/client/widgets/grid/GridPanel;Lcom/gwtext/client/data/Record;Ljava/lang/String;Ljava/lang/Object;II)(gridJ, recordJ, e.field, value, e.row, e.column);
096:                            }
097:                    );
098:
099:                    this.@com.gwtext.client.widgets.Component::addListener(Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)('validateedit',
100:                            function(e) {
101:                                var recordJ = @com.gwtext.client.data.Record::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(e.record);
102:                                var value = e.value === undefined ? null : $wnd.GwtExt.convertToJavaType(e.value);
103:                                var originalValue = e.originalValue === undefined ? null : $wnd.GwtExt.convertToJavaType(e.originalValue);
104:                                return listener.@com.gwtext.client.widgets.grid.event.EditorGridListener::doValidateEdit(Lcom/gwtext/client/widgets/grid/GridPanel;Lcom/gwtext/client/data/Record;Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;II)(gridJ, recordJ, e.field, value, originalValue,  e.row, e.column);
105:                            }
106:                    );
107:                }-*/;
108:
109:            /**
110:             * Starts editing the specified for the specified row/column.
111:             *
112:             * @param rowIndex row to edit
113:             * @param colIndex column to edit
114:             */
115:            public native void startEditing(int rowIndex, int colIndex) /*-{
116:                   var grid = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
117:                   grid.startEditing(rowIndex, colIndex);
118:               }-*/;
119:
120:            /**
121:             * Stops any active editing.
122:             */
123:            public native void stopEditing() /*-{
124:                   var grid = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
125:                   grid.stopEditing();
126:               }-*/;
127:
128:            /**
129:             * Get the Grids Cell selection model
130:             *
131:             * @return the cell selection model
132:             */
133:            public CellSelectionModel getCellSelectionModel() {
134:                return new CellSelectionModel(
135:                        getSelectionModel(getOrCreateJsObj()));
136:            }
137:
138:            private native JavaScriptObject getSelectionModel(
139:                    JavaScriptObject grid) /*-{
140:                   return grid.getSelectionModel();
141:               }-*/;
142:
143:            // --- config proeprties ---
144:            /**
145:             * The number of clicks on a cell required to display the cell's editor (defaults to 2).
146:             *
147:             * @param clicksToEdit the number of clicks to edit
148:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
149:             */
150:            public void setClicksToEdit(int clicksToEdit)
151:                    throws IllegalStateException {
152:                setAttribute("clicksToEdit", clicksToEdit, true);
153:            }
154:
155:            /**
156:             * True to automatically HTML encode and decode values pre and post edit (defaults to false)
157:             * 
158:             * @param autoEncode true to auto encode
159:             */
160:            public void setAutoEncode(boolean autoEncode) {
161:                setAttribute("autoEncode", autoEncode, true);
162:            }
163:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.