Source Code Cross Referenced for MultiColumnFormPanel.java in  » Ajax » gwtext-2.01 » com » gwtext » sample » showcase2 » client » form » 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.form 
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.form;
09:
10:        import com.gwtext.client.core.Position;
11:        import com.gwtext.client.widgets.Button;
12:        import com.gwtext.client.widgets.Panel;
13:        import com.gwtext.client.widgets.form.FormPanel;
14:        import com.gwtext.client.widgets.form.HtmlEditor;
15:        import com.gwtext.client.widgets.form.TextField;
16:        import com.gwtext.client.widgets.form.VType;
17:        import com.gwtext.client.widgets.layout.AnchorLayoutData;
18:        import com.gwtext.client.widgets.layout.ColumnLayout;
19:        import com.gwtext.client.widgets.layout.ColumnLayoutData;
20:        import com.gwtext.client.widgets.layout.FormLayout;
21:        import com.gwtext.sample.showcase2.client.ShowcasePanel;
22:
23:        public class MultiColumnFormPanel extends ShowcasePanel {
24:
25:            public String getSourceUrl() {
26:                return "source/form/MultiColumnFormPanel.java.html";
27:            }
28:
29:            public Panel getViewPanel() {
30:                if (panel == null) {
31:                    panel = new Panel();
32:
33:                    //create the FormPanel and set the label position to top
34:                    FormPanel formPanel = new FormPanel();
35:                    formPanel.setFrame(true);
36:                    formPanel
37:                            .setTitle("Multi Column, Nested Layouts and Anchoring");
38:                    formPanel.setPaddings(5, 5, 5, 0);
39:                    formPanel.setWidth(600);
40:                    formPanel.setLabelAlign(Position.TOP);
41:
42:                    //create a top panel with 2 columns (ColumnLayout). Create a Panel for the first column with
43:                    //layout FormLayout and add the fields for the first column. Then create a second Panel with FormLayout
44:                    //and add fields to the sencond panel. Finally add the first and secod pane to the top panel which lays
45:                    //them out in columns since it has a ColumnLayout assigned to it.
46:
47:                    //create top panel with ColumnLayout
48:                    Panel topPanel = new Panel();
49:                    topPanel.setLayout(new ColumnLayout());
50:
51:                    //create first panel and add fields to it
52:                    Panel columnOnePanel = new Panel();
53:                    columnOnePanel.setLayout(new FormLayout());
54:
55:                    TextField firstName = new TextField("First Name", "first");
56:                    columnOnePanel.add(firstName, new AnchorLayoutData("95%"));
57:
58:                    TextField company = new TextField("Company", "company");
59:                    columnOnePanel.add(company, new AnchorLayoutData("95%"));
60:
61:                    //add first panel as first column with 50% of the width
62:                    topPanel.add(columnOnePanel, new ColumnLayoutData(.5));
63:
64:                    //create second panel and add fields to it
65:                    Panel columnTwoPanel = new Panel();
66:                    columnTwoPanel.setLayout(new FormLayout());
67:
68:                    TextField lastName = new TextField("Last Name", "last");
69:                    columnTwoPanel.add(lastName, new AnchorLayoutData("95%"));
70:
71:                    TextField email = new TextField("Email", "email");
72:                    email.setVtype(VType.EMAIL);
73:                    columnTwoPanel.add(email, new AnchorLayoutData("95%"));
74:
75:                    //add the second panel as the second column to the top panel to take up the other 50% width
76:                    topPanel.add(columnTwoPanel, new ColumnLayoutData(0.5));
77:                    formPanel.add(topPanel);
78:
79:                    //add a HtmlEditor below the 2-column top panel
80:                    HtmlEditor htmlEditor = new HtmlEditor("Biography", "bio");
81:                    htmlEditor.setHeight(200);
82:                    formPanel.add(htmlEditor, new AnchorLayoutData("98%"));
83:
84:                    //add a couple of buttons to the form
85:                    formPanel.addButton(new Button("Save"));
86:                    formPanel.addButton(new Button("Cancel"));
87:
88:                    panel.add(formPanel);
89:                }
90:                return panel;
91:            }
92:
93:            public String getIntro() {
94:                return "<p>This example illustrates a multi-column form with lables on top. The form has a top panel which has two columns. "
95:                        + "The first column is a Panel with the 'First Name' and 'Company' fields added to it. And the second column "
96:                        + "is a Panel with the 'Last Name' and 'Email' fields added to it.<p>"
97:                        + "The top panel is added to the form and then a HtmlEditor with no label is added below it.</p>";
98:            }
99:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.