Source Code Cross Referenced for ToolbarSample.java in  » Ajax » gwtext-2.01 » com » gwtext » sample » showcase2 » client » toolbar » 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.toolbar 
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:        package com.gwtext.sample.showcase2.client.toolbar;
009:
010:        import com.gwtext.client.widgets.*;
011:        import com.gwtext.client.widgets.menu.*;
012:        import com.gwtext.client.widgets.menu.event.CheckItemListenerAdapter;
013:        import com.gwtext.sample.showcase2.client.Showcase2;
014:        import com.gwtext.sample.showcase2.client.ShowcasePanel;
015:
016:        public class ToolbarSample extends ShowcasePanel {
017:
018:            public String getSourceUrl() {
019:                return "source/toolbar/ToolbarSample.java.html";
020:            }
021:
022:            public String getCssUrl() {
023:                return "source/toolbar/ToolbarSample.css.html";
024:            }
025:
026:            public Panel getViewPanel() {
027:                if (panel == null) {
028:                    panel = new Panel();
029:
030:                    //create a toolbar and various menu items
031:                    Toolbar toolbar = new Toolbar();
032:
033:                    Menu menu = new Menu();
034:                    menu.setShadow(true);
035:                    menu.setMinWidth(10);
036:
037:                    final CheckItemListenerAdapter listener = new CheckItemListenerAdapter() {
038:                        public void onCheckChange(CheckItem item,
039:                                boolean checked) {
040:                            Showcase2.showMessage("Event: checkchange", "'"
041:                                    + item.getText() + "' is now "
042:                                    + (checked ? "checked" : "unchecked"));
043:                        }
044:                    };
045:
046:                    CheckItem checkItem = new CheckItem();
047:                    checkItem.setText("I like Ext");
048:                    checkItem.setChecked(true);
049:                    checkItem.addListener(listener);
050:                    menu.addItem(checkItem);
051:
052:                    CheckItem checkItem2 = new CheckItem();
053:                    checkItem2.setText("I also like GWT-Ext :)");
054:                    checkItem2.setChecked(true);
055:                    checkItem2.addListener(listener);
056:                    menu.addItem(checkItem2);
057:
058:                    CheckItem checkItem3 = new CheckItem();
059:                    checkItem3.setText("I donated");
060:                    checkItem3.setChecked(false);
061:                    checkItem3.addListener(listener);
062:                    menu.addItem(checkItem3);
063:
064:                    menu.addSeparator();
065:
066:                    Menu submenu = new Menu();
067:                    submenu.setShadow(true);
068:                    submenu.setMinWidth(10);
069:                    submenu.addItem(new TextItem(
070:                            "<b class=\"menu-title\">Choose a Theme</b>"));
071:
072:                    CheckItem checkItem4 = new CheckItem();
073:                    checkItem4.setText("Aero Glass");
074:                    checkItem4.setChecked(true);
075:                    checkItem4.setGroup("theme");
076:                    checkItem4.addListener(listener);
077:                    submenu.addItem(checkItem4);
078:
079:                    CheckItem checkItem5 = new CheckItem();
080:                    checkItem5.setText("Vista Black");
081:                    checkItem5.setGroup("theme");
082:                    checkItem5.addListener(listener);
083:                    submenu.addItem(checkItem5);
084:
085:                    CheckItem checkItem7 = new CheckItem();
086:                    checkItem7.setText("Gray Theme");
087:                    checkItem7.setGroup("theme");
088:                    checkItem7.addListener(listener);
089:                    submenu.addItem(checkItem7);
090:
091:                    CheckItem checkItem8 = new CheckItem();
092:                    checkItem8.setText("Default Theme");
093:                    checkItem8.setGroup("theme");
094:                    checkItem8.addListener(listener);
095:                    submenu.addItem(checkItem8);
096:
097:                    MenuItem menuItem = new MenuItem("Radio Options", submenu);
098:                    MenuItem dateMenuItem = new MenuItem("Choose a Date",
099:                            new DateMenu());
100:                    MenuItem colorMenuItem = new MenuItem("Choose a Color",
101:                            new ColorMenu());
102:                    menu.addItem(menuItem);
103:                    menu.addItem(dateMenuItem);
104:                    menu.addItem(colorMenuItem);
105:                    menu.addSeparator();
106:
107:                    Item item = new Item();
108:                    item.setText("Dynamically added");
109:
110:                    Item item2 = new Item("Disabled");
111:                    item2.setDisabled(true);
112:                    menu.addItem(item);
113:                    menu.addItem(item2);
114:
115:                    ToolbarButton menuButton = new ToolbarButton(
116:                            "Button w/ Menu");
117:                    menuButton.setMenu(menu);
118:                    menuButton.setIconCls("bmenu");
119:                    toolbar.addButton(menuButton);
120:                    toolbar.addSeparator();
121:
122:                    Menu splitMenu = new Menu();
123:                    Item bi = new Item();
124:                    bi.setText("<b>Bold</b>");
125:                    splitMenu.addItem(bi);
126:
127:                    Item ii = new Item();
128:                    ii.setText("<i>Italic</i>");
129:                    splitMenu.addItem(ii);
130:
131:                    Item ui = new Item();
132:                    ui.setText("<u>Underline</u>");
133:                    splitMenu.addItem(ui);
134:
135:                    splitMenu.addSeparator();
136:
137:                    Menu colorMenu = new Menu();
138:                    colorMenu.addItem(new ColorItem());
139:                    colorMenu.addSeparator();
140:                    Item moreColors = new Item();
141:                    moreColors.setText("More Colors...");
142:                    colorMenu.addItem(moreColors);
143:
144:                    MenuItem colorMI = new MenuItem("Pic a Color", colorMenu);
145:                    splitMenu.addItem(colorMI);
146:                    Item excellent = new Item();
147:                    excellent.setText("Excellent");
148:                    splitMenu.addItem(excellent);
149:
150:                    ToolbarMenuButton button2 = new ToolbarMenuButton(
151:                            "Split Button", splitMenu);
152:
153:                    toolbar.addButton(button2);
154:                    toolbar.addSeparator();
155:
156:                    ToolbarButton toggleButton = new ToolbarButton("Toggle Me");
157:                    toggleButton.setEnableToggle(true);
158:                    toggleButton.setPressed(true);
159:                    QuickTipsConfig tipsConfig = new QuickTipsConfig();
160:                    tipsConfig.setText("This is a quicktip with a title");
161:                    tipsConfig.setTitle("Tip Title");
162:                    toggleButton.setTooltip(tipsConfig);
163:
164:                    ToolbarButton iconOnly = new ToolbarButton();
165:                    iconOnly.setIcon("images/add-feed.gif");
166:                    iconOnly.setCls("x-btn-icon");
167:                    iconOnly
168:                            .setTooltip("<b>Quick Tips</b><br/>Icon only button with tooltip");
169:
170:                    toolbar.addButton(iconOnly);
171:                    toolbar.addSeparator();
172:                    toolbar.addButton(toggleButton);
173:
174:                    toolbar.addSeparator();
175:                    ToolbarTextItem ti = new ToolbarTextItem("Text Item");
176:                    toolbar.addItem(ti);
177:
178:                    Panel toolbarPanel = new Panel();
179:                    toolbarPanel.setWidth(500);
180:                    toolbarPanel.setHeight(400);
181:                    toolbarPanel.setTopToolbar(toolbar);
182:
183:                    panel.add(toolbarPanel);
184:                }
185:                return panel;
186:            }
187:
188:            protected boolean showEvents() {
189:                return true;
190:            }
191:
192:            public String getIntro() {
193:                return "<p>This example demonstrates creatign a Toolbar with various items and menu items. A toobar directly to a Panel "
194:                        + "or placed at the top and / or bottom on any Panel like a GridPanel, a FormPanel or a TreePanel as illustrated by "
195:                        + "other examples in this Showcase.</p>";
196:            }
197:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.