Source Code Cross Referenced for BaseItem.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.Component;
014:        import com.gwtext.client.widgets.menu.event.BaseItemListener;
015:
016:        //todo - only reason non abstract because menu item click event returns a base item and need to instanticte
017:
018:        //node baselem return null for getEl()
019:        /**
020:         * The base class for all items that render into menus. BaseItem provides default rendering, activated state management
021:         *  and base configuration options shared by all menu components.
022:         */
023:        public class BaseItem extends Component {
024:
025:            public BaseItem() {
026:            }
027:
028:            public BaseItem(JavaScriptObject jsObj) {
029:                super (jsObj);
030:            }
031:
032:            protected JavaScriptObject getConfigPrototype() {
033:                return null;
034:            }
035:
036:            //todo2 -- ext 2 doesnt have xtype for base item so need this
037:            private static BaseItem instance(JavaScriptObject jsObj) {
038:                return new BaseItem(jsObj);
039:            }
040:
041:            /**
042:             * Adda BaseItem listener.
043:             *
044:             * @param listener the listener
045:             */
046:            public native void addListener(BaseItemListener listener)/*-{
047:                    this.@com.gwtext.client.widgets.Component::addListener(Lcom/gwtext/client/widgets/event/ComponentListener;)(listener);
048:                    var baseItemJ = this;
049:
050:                    this.@com.gwtext.client.widgets.Component::addListener(Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)('activate',
051:                            function(source) {
052:                                return listener.@com.gwtext.client.widgets.menu.event.BaseItemListener::onActivate(Lcom/gwtext/client/widgets/menu/BaseItem;)(baseItemJ);
053:                            }
054:                    );
055:
056:                    this.@com.gwtext.client.widgets.Component::addListener(Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)('click',
057:                            function(source, event) {
058:                                var e = @com.gwtext.client.core.EventObject::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(event);
059:                                return listener.@com.gwtext.client.widgets.menu.event.BaseItemListener::onClick(Lcom/gwtext/client/widgets/menu/BaseItem;Lcom/gwtext/client/core/EventObject;)(baseItemJ, e);
060:                            }
061:                    );
062:
063:                    this.@com.gwtext.client.widgets.Component::addListener(Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)('deactivate',
064:                            function(source) {
065:                                return listener.@com.gwtext.client.widgets.menu.event.BaseItemListener::onDeactivate(Lcom/gwtext/client/widgets/menu/BaseItem;)(baseItemJ);
066:                            }
067:                    );
068:                 }-*/;
069:
070:            protected JavaScriptObject create(JavaScriptObject config) {
071:                throw new IllegalArgumentException("must be overridden");
072:            }
073:
074:            // --- config properties ---
075:
076:            /**
077:             * The CSS class to use when the item becomes activated (defaults to "x-menu-item-active")
078:             *
079:             * @param activeClass the active CSS class
080:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
081:             */
082:            public void setActiveClass(String activeClass)
083:                    throws IllegalStateException {
084:                setAttribute("activeClass", activeClass, true);
085:            }
086:
087:            /**
088:             * The CSS class to use when the item becomes activated.
089:             *
090:             * @return the CSS class to use when the item becomes activated
091:             */
092:            public String getActiveClass() {
093:                return JavaScriptObjectHelper.getAttribute(config,
094:                        "activeClass");
095:            }
096:
097:            /**
098:             * True if this item can be visually activated (defaults to false)
099:             *
100:             * @param canActivate true if can be activated
101:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
102:             */
103:            public void setCanActivate(boolean canActivate)
104:                    throws IllegalStateException {
105:                setAttribute("canActivate", canActivate, true);
106:            }
107:
108:            /**
109:             * True if this item can be visually activated (defaults to false).
110:             *
111:             * @return true if this item can be visually activated (defaults to false)
112:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
113:             */
114:            public boolean isCanActivate() throws IllegalStateException {
115:                return JavaScriptObjectHelper.getAttributeAsBoolean(config,
116:                        "canActivate");
117:            }
118:
119:            /**
120:             * Length of time in milliseconds to wait before hiding after a click (defaults to 100).
121:             *
122:             * @param hideDelay the hide delay
123:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
124:             */
125:            public void setHideDelay(int hideDelay)
126:                    throws IllegalStateException {
127:                setAttribute("hideDelay", hideDelay, true);
128:            }
129:
130:            /**
131:             * Length of time in milliseconds to wait before hiding after a click (defaults to 100).
132:             *
133:             * @return the hide delay
134:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
135:             */
136:            public int getHideDelay() throws IllegalStateException {
137:                return JavaScriptObjectHelper.getAttributeAsInt(config,
138:                        "hideDelay");
139:            }
140:
141:            /**
142:             * Length of time in milliseconds to wait before showing a hidden item  after a click (defaults to 100)
143:             *
144:             * @param showDelay the show delay
145:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
146:             */
147:            public void setShowDelay(int showDelay)
148:                    throws IllegalStateException {
149:                setAttribute("showDelay", showDelay, true);
150:            }
151:
152:            /**
153:             * Length of time in milliseconds to wait before showing a hidden item  after a click (defaults to 100).
154:             *
155:             * @return the show delay
156:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
157:             */
158:            public int getShowDelay() throws IllegalStateException {
159:                return JavaScriptObjectHelper.getAttributeAsInt(config,
160:                        "showDelay");
161:            }
162:
163:            /**
164:             * True to hide the containing menu after this item is clicked (defaults to true).
165:             *
166:             * @param hideOnClick true to hide on click
167:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
168:             */
169:            public void setHideOnClick(boolean hideOnClick)
170:                    throws IllegalStateException {
171:                setAttribute("hideOnClick", hideOnClick, true);
172:            }
173:
174:            /**
175:             * True to hide the containing menu after this item is clicked (defaults to true).
176:             *
177:             * @return true to hide on click
178:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
179:             */
180:            public boolean isHideOnClick() throws IllegalStateException {
181:                return JavaScriptObjectHelper.getAttributeAsBoolean(config,
182:                        "hideOnClick");
183:            }
184:
185:            //todo 2.0, not in docs, should it be  here?
186:            public void setIcon(String icon) {
187:                setAttribute("icon", icon, true);
188:            }
189:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.