Source Code Cross Referenced for Popup.java in  » Ajax » zk » org » zkoss » zul » 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 » zk » org.zkoss.zul 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* Popup.java
002:
003:        {{IS_NOTE
004:        	Purpose:
005:        		
006:        	Description:
007:        		
008:        	History:
009:        		Fri Sep 23 09:49:49     2005, Created by tomyeh
010:        }}IS_NOTE
011:
012:        Copyright (C) 2005 Potix Corporation. All Rights Reserved.
013:
014:        {{IS_RIGHT
015:        	This program is distributed under GPL Version 2.0 in the hope that
016:        	it will be useful, but WITHOUT ANY WARRANTY.
017:        }}IS_RIGHT
018:         */
019:        package org.zkoss.zul;
020:
021:        import org.zkoss.lang.Objects;
022:        import org.zkoss.xml.HTMLs;
023:
024:        import org.zkoss.zk.ui.Component;
025:        import org.zkoss.zk.ui.event.Events;
026:        import org.zkoss.zk.ui.ext.render.ZidRequired;
027:        import org.zkoss.zk.ui.ext.render.Floating;
028:
029:        import org.zkoss.zul.impl.XulElement;
030:        import org.zkoss.zul.au.out.AuPopup;
031:
032:        /**
033:         * A container that is displayed as a popup.
034:         * The popup window does not have any special frame.
035:         * Popups can be displayed when an element is clicked by assigning
036:         * the id of the popup to either the {@link #setPopup},
037:         * {@link #setContext} or {@link #setTooltip} attribute of the element.
038:         *
039:         * <p>Default {@link #getSclass}: ctxpopup.
040:         *
041:         * @author tomyeh
042:         */
043:        public class Popup extends XulElement {
044:            public Popup() {
045:                super .setVisible(false);
046:                if (!(this  instanceof  Menupopup))
047:                    setSclass("ctxpopup");
048:            }
049:
050:            /**
051:             * Opens this popup to the specified location at the client.
052:             *
053:             * <p>In most cases, the popup is shown automatically when specified
054:             * in the tooltip, popup and context properties
055:             * ({@link XulElement#setTooltip}, {@link XulElement#setPopup},
056:             * and {@link XulElement#setContext}).
057:             * However, if you want to show it manually, you can invoke this
058:             * method directly.
059:             *
060:             * @param x the X coordinate
061:             * @param y the Y coordinate
062:             * @since 3.0.0
063:             */
064:            public void open(String x, String y) {
065:                response("popup", new AuPopup(this , x, y));
066:            }
067:
068:            /**
069:             * Opens this popup to the specified location at the client.
070:             *
071:             * <p>In most cases, the popup is shown automatically when specified
072:             * in the tooltip, popup and context properties
073:             * ({@link XulElement#setTooltip}, {@link XulElement#setPopup},
074:             * and {@link XulElement#setContext}).
075:             * However, if you want to show it manually, you can invoke this
076:             * method directly.
077:             *
078:             * @param x the X coordinate
079:             * @param y the Y coordinate
080:             * @since 3.0.0
081:             */
082:            public void open(int x, int y) {
083:                response("popup", new AuPopup(this , Integer.toString(x),
084:                        Integer.toString(y)));
085:            }
086:
087:            /**
088:             * Opens this popup right below the specified component at the cleint.
089:             * <p>In most cases, the popup is shown automatically when specified
090:             * in the tooltip, popup and context properties
091:             * ({@link XulElement#setTooltip}, {@link XulElement#setPopup},
092:             * and {@link XulElement#setContext}).
093:             * However, if you want to show it manually, you can invoke this
094:             * method directly.
095:             *
096:             * @param ref the reference component to position the popup.
097:             * It cannot be null.
098:             * @since 3.0.0
099:             */
100:            public void open(Component ref) {
101:                response("popup", new AuPopup(this , ref));
102:            }
103:
104:            /**
105:             * Closes this popup at the client.
106:             *
107:             * <p>In most cases, the popup is closed automatically when the user
108:             * clicks outside of the popup.
109:             * @since 3.0.0
110:             */
111:            public void close() {
112:                response("popup", new AuPopup(this , false));
113:            }
114:
115:            //super//
116:            /** Not allowd.
117:             * Use {@link #open} to open, and {@link #close} to close.
118:             */
119:            public boolean setVisible(boolean visible) {
120:                throw new UnsupportedOperationException(
121:                        "Use open/close instead");
122:            }
123:
124:            public String getOuterAttrs() {
125:                //Note: don't generate z.type here because Menupopup's z.type diff
126:                final StringBuffer sb = appendAsapAttr(null, Events.ON_OPEN);
127:                final String attrs = super .getOuterAttrs();
128:                return sb != null ? sb.append(attrs).toString() : attrs;
129:            }
130:
131:            //-- ComponentCtrl --//
132:            protected Object newExtraCtrl() {
133:                return new ExtraCtrl();
134:            }
135:
136:            /** A utility class to implement {@link #getExtraCtrl}.
137:             * It is used only by component developers.
138:             */
139:            protected class ExtraCtrl extends XulElement.ExtraCtrl implements 
140:                    ZidRequired, Floating {
141:                //ZidRequired//
142:                public boolean isZidRequired() {
143:                    return !(getParent() instanceof  Menu);
144:                }
145:
146:                //Floating//
147:                public boolean isFloating() {
148:                    return true;
149:                }
150:            }
151:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.