Source Code Cross Referenced for PagingToolbar.java in  » Ajax » gwtext-2.01 » com » gwtext » client » widgets » 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 
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;
010:
011:        import com.google.gwt.core.client.JavaScriptObject;
012:        import com.gwtext.client.data.Store;
013:        import com.gwtext.client.util.JavaScriptObjectHelper;
014:
015:        /**
016:         * A specialized toolbar that is bound to a {@link Store} and provides automatic paging controls.
017:         */
018:        public class PagingToolbar extends Toolbar {
019:
020:            private Store store;
021:
022:            /*	private static JavaScriptObject configPrototype;
023:
024:             static {
025:             init();
026:             }
027:
028:             private static native void init()*//*-{
029:                    var c = new $wnd.Ext.PagingToolbar();
030:                    @com.gwtext.client.widgets.PagingToolbar::configPrototype = c.initialConfig;
031:                }-*//*;
032:
033:
034:            	protected JavaScriptObject getConfigPrototype() {
035:            		return configPrototype;
036:            	}*/
037:
038:            public String getXType() {
039:                return "paging";
040:            }
041:
042:            /**
043:             * Create a new PagingToolbar.
044:             */
045:            public PagingToolbar() {
046:            }
047:
048:            /**
049:             * Create a new PagingToolbar.
050:             *
051:             * @param store the underlying Store
052:             */
053:            public PagingToolbar(Store store) {
054:                setStore(store);
055:            }
056:
057:            public PagingToolbar(JavaScriptObject jsObj) {
058:                super (jsObj);
059:            }
060:
061:            protected native JavaScriptObject create(JavaScriptObject config) /*-{
062:            	return new $wnd.Ext.PagingToolbar(config);
063:               }-*/;
064:
065:            /**
066:             * Binds the paging toolbar to the specified Store.
067:             *
068:             * @param store the Store to bind to
069:             */
070:            public void bind(Store store) {
071:                if (!isCreated()) {
072:                    setStore(store);
073:                } else {
074:                    bindCreated(store);
075:                }
076:            }
077:
078:            private native void bindCreated(Store store) /*-{
079:            	var pagingToolbar = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
080:            	var storeJS = store.@com.gwtext.client.core.JsObject::getJsObj()();
081:            	pagingToolbar.bind(storeJS);
082:            }-*/;
083:
084:            /**
085:             * Unbinds the paging toolbar from the specified Store.
086:             *
087:             * @param store the store
088:             */
089:            public void unbind(Store store) {
090:                if (!isCreated()) {
091:                    setStore(null);
092:                } else {
093:                    unbindCreated(store);
094:                }
095:            }
096:
097:            private native void unbindCreated(Store store) /*-{
098:            	var pagingToolbar = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
099:            	var storeJS = store.@com.gwtext.client.core.JsObject::getJsObj()();
100:            	pagingToolbar.unbind(storeJS);
101:            }-*/;
102:
103:            private native void updateInfo() /*-{
104:            	var pagingToolbar = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
105:            	pagingToolbar.updateInfo();
106:            }-*/;
107:
108:            // --- config properties ---
109:
110:            /**
111:             * The paging status message to display (defaults to "Displaying {start} - {end} of {total}").
112:             *
113:             * @param displayMsg the display message
114:             */
115:            public void setDisplayMsg(String displayMsg) {
116:                setAttribute("displayMsg", displayMsg, true, true);
117:            }
118:
119:            /**
120:             * The paging status message to display (defaults to "Displaying {start} - {end} of {total}").
121:             *
122:             * @return the display message
123:             */
124:            public String getDisplayMsg() {
125:                return getAttribute("displayMsg");
126:            }
127:
128:            /**
129:             * The message to display when no records are found (defaults to "No data to display").
130:             *
131:             * @param emptyMsg the empty message
132:             */
133:            public void setEmptyMsg(String emptyMsg) {
134:                setAttribute("emptyMsg", emptyMsg, true, true);
135:            }
136:
137:            /**
138:             * @return the message dispalyed when no records are found
139:             */
140:            public String getEmptyMsg() {
141:                return getAttribute("emptyMsg");
142:            }
143:
144:            /**
145:             * The number of records to display per page (defaults to 20).
146:             *
147:             * @param pageSize the page size
148:             */
149:            public void setPageSize(int pageSize) {
150:                if (isRendered()) {
151:                    setPageSizeRendered(pageSize);
152:                } else {
153:                    setAttribute("pageSize", pageSize, true);
154:                }
155:            }
156:
157:            /**
158:             * The number of records to display per page (defaults to 20).
159:             *
160:             * @return the page size
161:             */
162:            public int getPageSize() {
163:                if (isRendered()) {
164:                    return getPageSizeRendered();
165:                } else {
166:                    return JavaScriptObjectHelper.getAttributeAsInt(config,
167:                            "pageSize");
168:                }
169:            }
170:
171:            //http://extjs.com/forum/showthread.php?p=101628
172:            private native void setPageSizeRendered(int pageSize) /*-{
173:            	var pagingToolbar = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
174:
175:                   pagingToolbar.pageSize = pageSize;
176:                   pagingToolbar.updateInfo();
177:                   if(pagingToolbar.displayEl) {
178:                       var d = pagingToolbar.getPageData();
179:                       pagingToolbar.afterTextEl.el.innerHTML = $wnd.String.format(pagingToolbar.afterPageText, d.pages);
180:                   }
181:                   pagingToolbar.doLoad(Math.floor(pagingToolbar.cursor/pagingToolbar.pageSize) * pagingToolbar.pageSize);
182:               }-*/;
183:
184:            private native int getPageSizeRendered() /*-{
185:            	var pagingToolbar = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
186:                   return pagingToolbar.pageSize;
187:               }-*/;
188:
189:            /**
190:             * True to display the displayMsg (defaults to false).
191:             *
192:             * @param displayInfo the display message
193:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
194:             */
195:            public void setDisplayInfo(boolean displayInfo)
196:                    throws IllegalStateException {
197:                setAttribute("displayInfo", displayInfo, true);
198:            }
199:
200:            /**
201:             * True to display the displayMsg.
202:             *
203:             * @return true to display the info
204:             */
205:            public boolean getDisplayInfo() {
206:                return getAttributeAsBoolean("displayInfo");
207:            }
208:
209:            /**
210:             * Set the Store for the PagingToolbar.
211:             *
212:             * @param store the store
213:             */
214:            public void setStore(Store store) {
215:                if (this .store != null) {
216:                    if (isCreated()) {
217:                        unbind(this .store);
218:                        bind(store);
219:                    }
220:                    this .store = store;
221:                } else {
222:                    this .store = store;
223:                    setAttribute("store", store.getJsObj(), false);
224:                }
225:
226:            }
227:
228:            /**
229:             * Return the Store of the PagingToolbar.
230:             *
231:             * @return the store
232:             */
233:            public Store getStore() {
234:                return store;
235:            }
236:
237:            /**
238:             * The before page paging text tooltip (defaults to "First Page")
239:             *
240:             * @param beforePageText the before page tooltip
241:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
242:             */
243:            public void setBeforePageText(String beforePageText)
244:                    throws IllegalStateException {
245:                setAttribute("beforePageText", beforePageText, true);
246:            }
247:
248:            /**
249:             * The before page paging text tooltip (defaults to "First Page")
250:             *
251:             * @return the before text tooltip
252:             */
253:            public String getBeforePageText() {
254:                return JavaScriptObjectHelper.getAttribute(config,
255:                        "beforePageText");
256:            }
257:
258:            /**
259:             * The after page paging text tooltip (defaults to "of %0")
260:             *
261:             * @param afterPageText the before page tooltip
262:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
263:             */
264:            public void setAfterPageText(String afterPageText)
265:                    throws IllegalStateException {
266:                setAttribute("afterPageText", afterPageText, true);
267:            }
268:
269:            /**
270:             * The after page paging text tooltip (defaults to "of %0")
271:             *
272:             * @return the after page tooltip
273:             */
274:            public String getAfterPageText() {
275:                return getAttribute("afterPageText");
276:            }
277:
278:            /**
279:             * The first page paging text tooltip (defaults to "First Page")
280:             *
281:             * @param firstText the first page tooltip
282:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
283:             */
284:            public void setFirstText(String firstText)
285:                    throws IllegalStateException {
286:                setAttribute("firstText", firstText, true);
287:            }
288:
289:            /**
290:             * The first page paging text tooltip (defaults to "First Page")
291:             *
292:             * @return the after page tooltip
293:             */
294:            public String getFirstText() {
295:                return getAttribute("firstText");
296:            }
297:
298:            /**
299:             * The previous page paging text tooltip (defaults to "Previous Page")
300:             *
301:             * @param prevText the first page tooltip
302:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
303:             */
304:            public void setPrevText(String prevText)
305:                    throws IllegalStateException {
306:                setAttribute("prevText", prevText, true);
307:            }
308:
309:            /**
310:             * The previous page paging text tooltip (defaults to "Previous Page")
311:             *
312:             * @return the previous page tooltip
313:             */
314:            public String getPrevText() {
315:                return getAttribute("prevText");
316:            }
317:
318:            /**
319:             * The next page paging text tooltip (defaults to "Next Page")
320:             *
321:             * @param nextText the first page tooltip
322:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
323:             */
324:            public void setNextText(String nextText)
325:                    throws IllegalStateException {
326:                setAttribute("nextText", nextText, true);
327:            }
328:
329:            /**
330:             * The next page paging text tooltip (defaults to "Next Page")
331:             *
332:             * @return the next page tooltip
333:             */
334:            public String getNextText() {
335:                return getAttribute("nextText");
336:            }
337:
338:            /**
339:             * The last page paging text tooltip (defaults to "Last Page")
340:             *
341:             * @param lastText the first page tooltip
342:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
343:             */
344:            public void setLastText(String lastText)
345:                    throws IllegalStateException {
346:                setAttribute("lastText", lastText, true);
347:            }
348:
349:            /**
350:             * The last page paging text tooltip (defaults to "Last Page")
351:             *
352:             * @return the after page tooltip
353:             */
354:            public String getLastText() {
355:                return getAttribute("lastText");
356:            }
357:
358:            /**
359:             * The refrest page paging text tooltip (defaults to "Refresh")
360:             *
361:             * @param refreshText the first page tooltip
362:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
363:             */
364:            public void setRefreshText(String refreshText)
365:                    throws IllegalStateException {
366:                setAttribute("refreshText", refreshText, true);
367:            }
368:
369:            /**
370:             * The refresh page paging text tooltip (defaults to "Refresh")
371:             *
372:             * @return the after page tooltip
373:             */
374:            public String getRefreshText() {
375:                return getAttribute("refreshText");
376:            }
377:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.