Source Code Cross Referenced for CheckItem.java in  » Ajax » gwtext-2.01 » com » gwtext » client » widgets » menu » 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.menu 
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.menu;
010:
011:        import com.google.gwt.core.client.JavaScriptObject;
012:        import com.gwtext.client.util.JavaScriptObjectHelper;
013:        import com.gwtext.client.widgets.menu.event.CheckItemListener;
014:
015:        /**
016:         * Adds a menu item that contains a checkbox by default, but can also be part of a radio group.
017:         */
018:        public class CheckItem extends Item {
019:
020:            /*    private static JavaScriptObject configPrototype;
021:
022:             static {
023:             init();
024:             }
025:
026:             private static native void init()*//*-{
027:                    var c = new $wnd.Ext.menu.CheckItem();
028:                    @com.gwtext.client.widgets.menu.CheckItem::configPrototype = c.initialConfig;
029:                }-*//*;
030:
031:
032:            	protected JavaScriptObject getConfigPrototype() {
033:            		return configPrototype;
034:            	}*/
035:
036:            protected JavaScriptObject getConfigPrototype() {
037:                return JavaScriptObjectHelper.createObject();
038:            }
039:
040:            /**
041:             * Create a new CheckItem.
042:             *
043:             */
044:            public CheckItem() {
045:            }
046:
047:            /**
048:             * Create a new CheckItem.
049:             *
050:             * @param text the CheckItem text
051:             */
052:            public CheckItem(String text) {
053:                setText(text);
054:            }
055:
056:            /**
057:             * Create a new CheckItem.
058:             *
059:             * @param text the CheckItem text
060:             * @param checked true for checked 
061:             */
062:            public CheckItem(String text, boolean checked) {
063:                super (text);
064:                setChecked(checked);
065:            }
066:
067:            public CheckItem(JavaScriptObject jsObj) {
068:                super (jsObj);
069:            }
070:
071:            protected native JavaScriptObject create(JavaScriptObject jsObj) /*-{
072:                   return new $wnd.Ext.menu.CheckItem(jsObj);
073:               }-*/;
074:
075:            private static CheckItem instance(JavaScriptObject jsObj) {
076:                return new CheckItem(jsObj);
077:            }
078:
079:            /**
080:             * Set the checked state of this item.
081:             *
082:             * @param checked the checked state
083:             */
084:            private native void setCheckedRendered(boolean checked) /*-{
085:                   var checkItem = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
086:                   checkItem.setChecked(checked);
087:               }-*/;
088:
089:            /**
090:             * Add a CheckItemListener.
091:             *
092:             * @param listener the listener
093:             */
094:            public native void addListener(CheckItemListener listener)/*-{
095:                    this.@com.gwtext.client.widgets.menu.BaseItem::addListener(Lcom/gwtext/client/widgets/menu/event/BaseItemListener;)(listener);
096:                    var checkItemJ = this;
097:
098:                    this.@com.gwtext.client.widgets.Component::addListener(Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)('beforecheckchange',
099:                            function(source, checked) {
100:                                return listener.@com.gwtext.client.widgets.menu.event.CheckItemListener::doBeforeCheckChange(Lcom/gwtext/client/widgets/menu/CheckItem;Z)(checkItemJ, checked);
101:                            }
102:                    );
103:                    this.@com.gwtext.client.widgets.Component::addListener(Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)('checkchange',
104:                            function(source, checked) {
105:                                listener.@com.gwtext.client.widgets.menu.event.CheckItemListener::onCheckChange(Lcom/gwtext/client/widgets/menu/CheckItem;Z)(checkItemJ, checked);
106:                            }
107:                    );
108:                 }-*/;
109:
110:            // --- config proeprties ---
111:
112:            /**
113:             * True to initialize this checkbox as checked (defaults to false). Note that if this checkbox is part of a radio group (group = true) only the last item in the group that is initialized with checked = true will be rendered as checked.
114:             *
115:             * @param checked true to set as checked
116:             */
117:            public void setChecked(boolean checked) {
118:                if (!isRendered()) {
119:                    setAttribute("checked", checked, true);
120:                } else {
121:                    setCheckedRendered(checked);
122:                }
123:
124:            }
125:
126:            /**
127:             * All check items with the same group name will automatically be grouped into a single-select radio button group (defaults to '').
128:             *
129:             * @param group the group name
130:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
131:             */
132:            public void setGroup(String group) throws IllegalStateException {
133:                setAttribute("group", group, true);
134:            }
135:
136:            /**
137:             * The default CSS class to use for radio group check items (defaults to "x-menu-group-item").
138:             *
139:             * @param groupClass the group CSS class
140:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
141:             */
142:            public void setGroupClass(String groupClass)
143:                    throws IllegalStateException {
144:                setAttribute("groupClass", groupClass, true);
145:            }
146:
147:            /**
148:             * The default CSS class to use for check items (defaults to "x-menu-item x-menu-check-item").
149:             *
150:             * @param itemCls the default CSS class to use for check items
151:             */
152:            public void setItemCls(String itemCls)
153:                    throws IllegalArgumentException {
154:                setAttribute("itemCls", itemCls, true);
155:            }
156:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.