Source Code Cross Referenced for LocalPagingSample.java in  » Ajax » gwtext-2.01 » com » gwtext » sample » showcase2 » client » 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.sample.showcase2.client.grid 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        /*
02:         * GWT-Ext Widget Library
03:         * Copyright(c) 2007-2008, GWT-Ext.
04:         * licensing@gwt-ext.com
05:         * 
06:         * http://www.gwt-ext.com/license
07:         */
08:        package com.gwtext.sample.showcase2.client.grid;
09:
10:        import com.gwtext.client.core.EventObject;
11:        import com.gwtext.client.data.*;
12:        import com.gwtext.client.widgets.PagingToolbar;
13:        import com.gwtext.client.widgets.Panel;
14:        import com.gwtext.client.widgets.ToolTip;
15:        import com.gwtext.client.widgets.form.Field;
16:        import com.gwtext.client.widgets.form.NumberField;
17:        import com.gwtext.client.widgets.form.event.FieldListenerAdapter;
18:        import com.gwtext.client.widgets.grid.GridPanel;
19:        import com.gwtext.sample.showcase2.client.SampleData;
20:        import com.gwtext.sample.showcase2.client.SampleGrid;
21:        import com.gwtext.sample.showcase2.client.ShowcasePanel;
22:        import com.gwtextux.client.data.PagingMemoryProxy;
23:
24:        public class LocalPagingSample extends ShowcasePanel {
25:
26:            public String getSourceUrl() {
27:                return "source/grid/LocalPagingSample.java.html";
28:            }
29:
30:            public Panel getViewPanel() {
31:                if (panel == null) {
32:                    panel = new Panel();
33:
34:                    PagingMemoryProxy proxy = new PagingMemoryProxy(SampleData
35:                            .getCompanyDataLarge());
36:                    RecordDef recordDef = new RecordDef(new FieldDef[] {
37:                            new StringFieldDef("company"),
38:                            new FloatFieldDef("price"),
39:                            new FloatFieldDef("change"),
40:                            new FloatFieldDef("pctChange"),
41:                            new DateFieldDef("lastChanged", "n/j h:ia"),
42:                            new StringFieldDef("symbol"),
43:                            new StringFieldDef("industry") });
44:
45:                    ArrayReader reader = new ArrayReader(recordDef);
46:                    final Store store = new Store(proxy, reader, true);
47:
48:                    final GridPanel grid = new SampleGrid();
49:                    grid.setStore(store);
50:                    grid.setWidth(600);
51:                    grid.setHeight(250);
52:                    grid.setTitle("Grid that pages Local / In-Memory data");
53:                    grid.setAutoExpandColumn("pctChange");
54:
55:                    final PagingToolbar pagingToolbar = new PagingToolbar(store);
56:                    pagingToolbar.setPageSize(5);
57:                    pagingToolbar.setDisplayInfo(true);
58:                    pagingToolbar
59:                            .setDisplayMsg("Displaying companies {0} - {1} of {2}");
60:                    pagingToolbar.setEmptyMsg("No records to display");
61:
62:                    NumberField pageSizeField = new NumberField();
63:                    pageSizeField.setWidth(40);
64:                    pageSizeField.setSelectOnFocus(true);
65:                    pageSizeField.addListener(new FieldListenerAdapter() {
66:                        public void onSpecialKey(Field field, EventObject e) {
67:                            if (e.getKey() == EventObject.ENTER) {
68:                                int pageSize = Integer.parseInt(field
69:                                        .getValueAsString());
70:                                pagingToolbar.setPageSize(pageSize);
71:                            }
72:                        }
73:                    });
74:
75:                    ToolTip toolTip = new ToolTip("Enter page size");
76:                    toolTip.applyTo(pageSizeField);
77:
78:                    pagingToolbar.addField(pageSizeField);
79:                    grid.setBottomToolbar(pagingToolbar);
80:                    store.load(0, 5);
81:
82:                    panel.add(grid);
83:                }
84:
85:                return panel;
86:            }
87:
88:            public String getIntro() {
89:                return "This example demonstrates loading a Grid with local array data and local paging. It also demonstrates how to change "
90:                        + "the page size dymanically. Enter a value in number field on the Paging Toolbar and hit Enter.";
91:            }
92:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.