Source Code Cross Referenced for ColumnConfig.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.gwtext.client.core.TextAlign;
012:        import com.gwtext.client.util.JavaScriptObjectHelper;
013:
014:        /**
015:         * The Grid Column configuration.
016:         * 
017:         * @see com.gwtext.client.widgets.grid.ColumnModel
018:         */
019:        public class ColumnConfig extends BaseColumnConfig {
020:
021:            /**
022:             * Create a new ColumnConfig.
023:             */
024:            public ColumnConfig() {
025:            }
026:
027:            /**
028:             * Create a new ColumnConfig.
029:             *
030:             * @param header the column header
031:             * @param dataIndex the data index (the field name pf the Store associated with the Grid)
032:             * @param width the column width
033:             */
034:            public ColumnConfig(String header, String dataIndex, int width) {
035:                this (header, dataIndex, width, false);
036:            }
037:
038:            /**
039:             * Create a new ColumnConfig.
040:             *
041:             * @param header the column header
042:             * @param dataIndex the data index (the field name pf the Store associated with the Grid)
043:             * @param width the column width
044:             * @param sortable true for sortable
045:             */
046:            public ColumnConfig(String header, String dataIndex, int width,
047:                    boolean sortable) {
048:                this (header, dataIndex, width, sortable, null);
049:            }
050:
051:            /**
052:             * Create a new ColumnConfig.
053:             *
054:             * @param header the column header
055:             * @param dataIndex the data index (the field name pf the Store associated with the Grid)
056:             * @param width the column width
057:             * @param sortable true for sortable
058:             * @param renderer a renderer to allow custom formating of cells of this column
059:             */
060:            public ColumnConfig(String header, String dataIndex, int width,
061:                    boolean sortable, Renderer renderer) {
062:                this (header, dataIndex, width, sortable, renderer, null);
063:            }
064:
065:            /**
066:             * Create a new ColumnConfig.
067:             *
068:             * @param header the column header
069:             * @param dataIndex the data index (the field name pf the Store associated with the Grid)
070:             * @param width the column width
071:             * @param sortable true for sortable
072:             * @param renderer a renderer to allow custom formating of cells of this column
073:             * @param id the grid  ID
074:             */
075:            public ColumnConfig(String header, String dataIndex, int width,
076:                    boolean sortable, Renderer renderer, String id) {
077:                if (id != null)
078:                    setId(id);
079:                setHeader(header);
080:                setDataIndex(dataIndex);
081:                setWidth(width);
082:                setSortable(sortable);
083:                if (renderer != null)
084:                    setRenderer(renderer);
085:            }
086:
087:            /**
088:             * Set the CSS text-align property of the column. Defaults to undefined.
089:             *
090:             * @param align the text-align position
091:             */
092:            public void setAlign(TextAlign align) {
093:                JavaScriptObjectHelper.setAttribute(jsObj, "align", align
094:                        .getPosition());
095:            }
096:
097:            public String getTextAlign() {
098:                return JavaScriptObjectHelper.getAttribute(jsObj, "textAlign");
099:            }
100:
101:            /**
102:             * Assigning id to ColumnConfig results in the column dom element having that ID.
103:             * This is useful to apply custom css to the entire column. (e.g. .x-grid-col-topic b { color:#333 }) .
104:             *
105:             * @param id the column ID
106:             */
107:            public void setId(String id) {
108:                JavaScriptObjectHelper.setAttribute(jsObj, "id", id);
109:            }
110:
111:            public String getId() {
112:                return JavaScriptObjectHelper.getAttribute(jsObj, "id");
113:            }
114:
115:            /**
116:             * The name of the field in the grid's {@link com.gwtext.client.data.Store}'s {@link com.gwtext.client.data.Record} definition
117:             * from which to draw the column's value. If not specified, the column's index is used as an index into the Record's data array.
118:             *
119:             * @param dataIndex the data index
120:             */
121:            public void setDataIndex(String dataIndex) {
122:                JavaScriptObjectHelper.setAttribute(jsObj, "dataIndex",
123:                        dataIndex);
124:            }
125:
126:            public String getDataIndex() {
127:                return JavaScriptObjectHelper.getAttribute(jsObj, "dataIndex");
128:            }
129:
130:            /**
131:             * A text string to use as the column header's tooltip. If Quicktips are enabled, this value will be used as the text
132:             * of the quick tip, otherwise it will be set as the header's HTML title attribute. Defaults to ''.
133:             *
134:             * @param tooltip the tooltip
135:             */
136:            public void setTooltip(String tooltip) {
137:                JavaScriptObjectHelper.setAttribute(jsObj, "tooltip", tooltip);
138:            }
139:
140:            public String getTooltip() {
141:                return JavaScriptObjectHelper.getAttribute(jsObj, "tooltip");
142:            }
143:
144:            /**
145:             * Sets teh CSS class for the column,
146:             *
147:             * @param css the CSS class
148:             */
149:            public void setCss(String css) {
150:                JavaScriptObjectHelper.setAttribute(jsObj, "css", css);
151:            }
152:
153:            public String getCss() {
154:                return JavaScriptObjectHelper.getAttribute(jsObj, "css");
155:            }
156:
157:            /**
158:             * The header text to display in the Grid view. You can use arbitrary html for the header.
159:             *
160:             * @param header the column header
161:             */
162:            public void setHeader(String header) {
163:                JavaScriptObjectHelper.setAttribute(jsObj, "header", header);
164:            }
165:
166:            public String getHeader() {
167:                return JavaScriptObjectHelper.getAttribute(jsObj, "header");
168:            }
169:
170:            /**
171:             * True to hide the column. Defaults to false.
172:             *
173:             * @param hidden true to hide column
174:             */
175:            public void setHidden(boolean hidden) {
176:                JavaScriptObjectHelper.setAttribute(jsObj, "hidden", hidden);
177:            }
178:
179:            public boolean getHidden() {
180:                return JavaScriptObjectHelper.getAttributeAsBoolean(jsObj,
181:                        "hidden");
182:            }
183:
184:            /**
185:             * True to make the column width fixed.
186:             *
187:             * @param fixed true for fixed width
188:             */
189:            public void setFixed(boolean fixed) {
190:                JavaScriptObjectHelper.setAttribute(jsObj, "fixed", fixed);
191:            }
192:
193:            public boolean getFixed() {
194:                return JavaScriptObjectHelper.getAttributeAsBoolean(jsObj,
195:                        "fixed");
196:            }
197:
198:            /**
199:             * Sets the rendering (formatting) function for a column.
200:             *
201:             * @param renderer the column renderer
202:             */
203:            public native void setRenderer(Renderer renderer) /*-{
204:                   var config = this.@com.gwtext.client.core.JsObject::getJsObj()();
205:
206:                   config['renderer'] = function(val, cell, r, rowIndex, colNum, store) {
207:                       var valJ = (val  == null || val === undefined || val === '') ? null : $wnd.GwtExt.convertToJavaType(val);
208:                       var recJ = @com.gwtext.client.data.Record::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(r);
209:                       var cellJ = @com.gwtext.client.widgets.grid.ColumnModel::createCellMetadata(Lcom/google/gwt/core/client/JavaScriptObject;)(cell);
210:                       var storeJ = @com.gwtext.client.data.Store::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(store);
211:                       return renderer.@com.gwtext.client.widgets.grid.Renderer::render(Ljava/lang/Object;Lcom/gwtext/client/widgets/grid/CellMetadata;Lcom/gwtext/client/data/Record;IILcom/gwtext/client/data/Store;)(valJ, cellJ, recJ, rowIndex, colNum, storeJ);
212:                   }
213:               }-*/;
214:
215:            /**
216:             * False to disable column resizing. Defaults to true.
217:             *
218:             * @param resizable false to disable column resizing
219:             */
220:            public void setResizable(boolean resizable) {
221:                JavaScriptObjectHelper.setAttribute(jsObj, "resizable",
222:                        resizable);
223:            }
224:
225:            public boolean getResizable() {
226:                return JavaScriptObjectHelper.getAttributeAsBoolean(jsObj,
227:                        "resizable");
228:            }
229:
230:            //todo see possible format strings in Ext.util.Format
231:            public void setRenderer(String renderer) {
232:                JavaScriptObjectHelper
233:                        .setAttribute(jsObj, "renderer", renderer);
234:            }
235:
236:            /**
237:             * True if sorting is to be allowed on this column. Defaults to the value of {@link com.gwtext.client.widgets.grid.ColumnModel#setDefaultSortable(boolean)}.
238:             * Whether local/remote sorting is used is specified in {@link com.gwtext.client.data.Store#Store(com.gwtext.client.data.DataProxy, com.gwtext.client.data.Reader, boolean)}
239:             *
240:             * @param sortable false to disable sorting
241:             */
242:            public void setSortable(boolean sortable) {
243:                JavaScriptObjectHelper
244:                        .setAttribute(jsObj, "sortable", sortable);
245:            }
246:
247:            public boolean getSortable() {
248:                return JavaScriptObjectHelper.getAttributeAsBoolean(jsObj,
249:                        "sortable");
250:            }
251:
252:            /**
253:             * The initial width in pixels of the column.
254:             *
255:             * @param width the column width
256:             */
257:            public void setWidth(int width) {
258:                JavaScriptObjectHelper.setAttribute(jsObj, "width", width);
259:            }
260:
261:            public int getWidth() {
262:                return JavaScriptObjectHelper.getAttributeAsInt(jsObj, "width");
263:            }
264:
265:            /**
266:             * Sets the editor for a column.
267:             *
268:             * @param editor the column editor
269:             */
270:            public void setEditor(GridEditor editor) {
271:                JavaScriptObjectHelper.setAttribute(jsObj, "editor", editor
272:                        .getJsObj());
273:            }
274:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.