Source Code Cross Referenced for GridView.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.google.gwt.user.client.Element;
013:        import com.gwtext.client.core.JsObject;
014:        import com.gwtext.client.data.Record;
015:        import com.gwtext.client.data.Store;
016:        import com.gwtext.client.util.JavaScriptObjectHelper;
017:
018:        /**
019:         * A Grid's View class.
020:         */
021:        public class GridView extends JsObject {
022:
023:            protected JavaScriptObject configJS = JavaScriptObjectHelper
024:                    .createObject();
025:
026:            public GridView(JavaScriptObject jsObj) {
027:                super (jsObj);
028:                configJS = jsObj;
029:            }
030:
031:            /**
032:             * Constructs a new GridView.
033:             *
034:             */
035:            public GridView() {
036:            }
037:
038:            public JavaScriptObject getJsObj() {
039:                if (!isCreated()) {
040:                    jsObj = create(configJS);
041:                }
042:                return jsObj;
043:            }
044:
045:            protected native JavaScriptObject create(JavaScriptObject config) /*-{
046:                   var gridJ = this;
047:                   var gridV = new $wnd.Ext.grid.GridView(config);
048:                   gridV.getRowClass = function(record, index, rp, store) {
049:                       var recordJ = @com.gwtext.client.data.Record::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(record);
050:            		var rpJ = @com.gwtext.client.widgets.grid.RowParams::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(rp);
051:            		var storeJ = @com.gwtext.client.data.Store::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(store);			
052:            		return gridJ.@com.gwtext.client.widgets.grid.GridView::getRowClass(Lcom/gwtext/client/data/Record;ILcom/gwtext/client/widgets/grid/RowParams;Lcom/gwtext/client/data/Store;)(recordJ, index, rpJ, storeJ);
053:                   }
054:                   return gridV;
055:               }-*/;
056:
057:            /**
058:             * Refreshes the grid.
059:             */
060:            public native void refresh() /*-{
061:                   var view = this.@com.gwtext.client.core.JsObject::getJsObj()();
062:                   view.refresh();
063:               }-*/;
064:
065:            /**
066:             * Refreshes the grid.
067:             *
068:             * @param headersToo true to refresh the headers too
069:             */
070:            public native void refresh(boolean headersToo) /*-{
071:                   var view = this.@com.gwtext.client.core.JsObject::getJsObj()();
072:                   view.refresh(headersToo);
073:               }-*/;
074:
075:            /**
076:             * Override this function to apply custom css classes to rows during rendering.
077:             *
078:             * @param record the record for the row
079:             * @param index the row index
080:             * @param rowParams row class passed to the method to support custom row rendering
081:             * @param store the grids store
082:             * @return the row CSS class
083:             */
084:            public String getRowClass(Record record, int index,
085:                    RowParams rowParams, Store store) {
086:                return "";
087:            }
088:
089:            /**
090:             * Refresh a row.
091:             *
092:             * @param index the row to refresh
093:             */
094:            public native void refreshRow(int index) /*-{
095:                   var view = this.@com.gwtext.client.core.JsObject::getJsObj()();
096:                   view.refreshRow(index);
097:               }-*/;
098:
099:            /**
100:             * The record to refresh.
101:             *
102:             * @param record the record
103:             */
104:            public native void refreshRow(Record record) /*-{
105:                   var view = this.@com.gwtext.client.core.JsObject::getJsObj()();
106:                   var recordJS = record.@com.gwtext.client.core.JsObject::getJsObj()();
107:                   view.refreshRow(recordJS);
108:               }-*/;
109:
110:            /**
111:             * Scrolls the grid to the top.
112:             */
113:            public native void scrollToTop() /*-{
114:                   var view = this.@com.gwtext.client.core.JsObject::getJsObj()();
115:                   view.scrollToTop();
116:               }-*/;
117:
118:            /**
119:             * Return the header cell.
120:             *
121:             * @param index header index
122:             * @return the header cell
123:             */
124:            public native Element getHeaderCell(int index)/*-{
125:                    var view = this.@com.gwtext.client.core.JsObject::getJsObj()();
126:                    var headerCellEl = view.getHeaderCell(index);
127:                    return headerCellEl === undefined ? null : headerCellEl;
128:                }-*/;
129:
130:            /**
131:             * Returns the row element.
132:             *
133:             * @param index row index
134:             * @return the row element
135:             */
136:            public native Element getRow(int index)/*-{
137:                    var view = this.@com.gwtext.client.core.JsObject::getJsObj()();
138:                    var rowEl = view.getRow(index);
139:                    return rowEl === undefined ? null : rowEl;
140:                }-*/;
141:
142:            /**
143:             * Returns a cells element.
144:             *
145:             * @param rowIndex the row index
146:             * @param colIndex the column index
147:             * @return the cell element
148:             */
149:            public native Element getCell(int rowIndex, int colIndex)/*-{
150:                    var view = this.@com.gwtext.client.core.JsObject::getJsObj()();
151:                    var el = view.getCell(rowIndex, colIndex);
152:                    return el=== undefined ? null : el;
153:                }-*/;
154:
155:            /**
156:             * Focusses the specified row.
157:             *
158:             * @param rowIndex the row index
159:             */
160:            public native void focusRow(int rowIndex) /*-{
161:                   var view = this.@com.gwtext.client.core.JsObject::getJsObj()();
162:                   view.focusRow(rowIndex);
163:               }-*/;
164:
165:            /**
166:             * Focuses the specified cell.
167:             *
168:             * @param rowIndex the row index
169:             * @param colIndex the column index
170:             * @param hscroll false to disable horizontal scrolling
171:             */
172:            public native void focusCell(int rowIndex, int colIndex,
173:                    boolean hscroll) /*-{
174:                   var view = this.@com.gwtext.client.core.JsObject::getJsObj()();
175:                   view.focusCell(rowIndex, colIndex, hscroll);
176:               }-*/;
177:
178:            /**
179:             * Autofits all columns to the grid's width proportionate with their current size.
180:             * 
181:             * @param reserveScrollSpace reserve space for a scrollbar
182:             */
183:            public native void fitColumns(boolean reserveScrollSpace) /*-{
184:                   var view = this.@com.gwtext.client.core.JsObject::getJsObj()();
185:                   view.fitColumns(reserveScrollSpace);
186:               }-*/;
187:
188:            /**
189:             * Update the headers sort state.
190:             */
191:            public native void updateHeaderSortState() /*-{
192:                   var view = this.@com.gwtext.client.core.JsObject::getJsObj()();
193:                   view.updateHeaderSortState();
194:               }-*/;
195:
196:            /**
197:             * True to auto expand the columns to fit the grid <b>when the grid is created</b>.
198:             *
199:             * @param autoFill true to auto expand the columns to fit the grid when the grid is created.
200:             */
201:            public void setAutoFill(boolean autoFill) {
202:                JavaScriptObjectHelper.setAttribute(configJS, "autoFill",
203:                        autoFill);
204:            }
205:
206:            /**
207:             * Default text to display in the grid body when no rows are available (defaults to '').
208:             *
209:             * @param emptyText default text to display in the grid body when no rows are available (defaults to '').
210:             */
211:            public void setEmptyText(String emptyText) {
212:                JavaScriptObjectHelper.setAttribute(configJS, "emptyText",
213:                        emptyText);
214:            }
215:
216:            /**
217:             * True to add a second TR element per row that can be used to provide a row body that spans beneath the data row.
218:             * Use the getRowClass method's rowParams config to customize the row body
219:             *
220:             * @param enableRowBody true to add a second TR element per row that can be used to provide a row body that spans beneath the data row.
221:             */
222:            public void setEnableRowBody(boolean enableRowBody) {
223:                JavaScriptObjectHelper.setAttribute(configJS, "enableRowBody",
224:                        enableRowBody);
225:            }
226:
227:            /**
228:             * True to auto expand/contract the size of the columns to fit the grid width and prevent horizontal scrolling.
229:             *
230:             * @param forceFit true to force fit
231:             */
232:            public void setForceFit(boolean forceFit) {
233:                JavaScriptObjectHelper.setAttribute(configJS, "forceFit",
234:                        forceFit);
235:            }
236:
237:            //todo this is doced as a property and not a config but used in example as a config
238:            /**
239:             * The amount of space to reserve for the scrollbar (defaults to 19 pixels).
240:             *
241:             * @param scrollOffset the scroll offset
242:             */
243:            public void setScrollOffset(int scrollOffset) {
244:                JavaScriptObjectHelper.setAttribute(configJS, "scrollOffset",
245:                        scrollOffset);
246:            }
247:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.