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


001:        /* Borderlayout.java
002:
003:         {{IS_NOTE
004:         Purpose:
005:         
006:         Description:
007:         
008:         History:
009:         Aug 27, 2007 3:34:53 PM , Created by jumperchen
010:         }}IS_NOTE
011:
012:         Copyright (C) 2007 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.zkex.zul;
020:
021:        import org.zkoss.zk.ui.Component;
022:        import org.zkoss.zk.ui.HtmlBasedComponent;
023:        import org.zkoss.zk.ui.UiException;
024:        import org.zkoss.zk.ui.ext.render.ChildChangedAware;
025:        import org.zkoss.zul.impl.XulElement;
026:
027:        /**
028:         * A border layout lays out a container, arranging and resizing its components
029:         * to fit in five regions: north, south, east, west, and center. Each region may
030:         * contain no more than one component, and is identified by a corresponding
031:         * constant: <code>NORTH</code>, <code>SOUTH</code>, <code>EAST</code>,
032:         * <code>WEST</code>, and <code>CENTER</code>. When adding a component to
033:         * a container with a border layout, use one of these five constants, for
034:         * example:
035:         * 
036:         * <pre>
037:         *  &lt;borderlayout&gt;
038:         *  &lt;north margins=&quot;1,5,1,1&quot; size=&quot;20%&quot; splittable=&quot;true&quot; collapsible=&quot;true&quot; minsize=&quot;100&quot; maxsize=&quot;400&quot;&gt;
039:         *  &lt;div&gt;
040:         *  North
041:         *  &lt;/div&gt;
042:         *  &lt;/north&gt;
043:         *  &lt;west size=&quot;25%&quot; splittable=&quot;true&quot; autoscroll=&quot;true&quot;&gt;
044:         *  &lt;div&gt;
045:         *  West
046:         *  &lt;/div&gt;
047:         *  &lt;/west&gt;
048:         *  &lt;center flex=&quot;true&quot;&gt;
049:         *  &lt;div&gt;
050:         *  Center
051:         *  &lt;/div&gt;
052:         *  &lt;/center&gt;
053:         *  &lt;east size=&quot;25%&quot; collapsible=&quot;true&quot; onOpen='alert(self.id + &quot; is open :&quot; +event.open)'&gt;
054:         *  &lt;div&gt;
055:         *  East
056:         *  &lt;/div&gt;
057:         *  &lt;/east&gt;
058:         *  &lt;south size=&quot;50%&quot; splittable=&quot;true&quot;&gt;
059:         *  &lt;div&gt;
060:         *  south
061:         *  &lt;/div&gt;
062:         *  &lt;/south&gt;
063:         *  &lt;/borderlayout&gt;
064:         * 
065:         * </pre>
066:         * 
067:         * The default class of CSS is specified "layout-container".
068:         * 
069:         * @author jumperchen
070:         * @since 3.0.0
071:         */
072:        public class Borderlayout extends HtmlBasedComponent {
073:
074:            /**
075:             * The north layout constraint (top of container).
076:             */
077:            public static final String NORTH = "north";
078:
079:            /**
080:             * The south layout constraint (bottom of container).
081:             */
082:            public static final String SOUTH = "south";
083:
084:            /**
085:             * The east layout constraint (right side of container).
086:             */
087:            public static final String EAST = "east";
088:
089:            /**
090:             * The west layout constraint (left side of container).
091:             */
092:            public static final String WEST = "west";
093:
094:            /**
095:             * The center layout constraint (middle of container).
096:             */
097:            public static final String CENTER = "center";
098:
099:            private North _north;
100:
101:            private South _south;
102:
103:            private West _west;
104:
105:            private East _east;
106:
107:            private Center _center;
108:
109:            public Borderlayout() {
110:                setClass("layout-container");
111:            }
112:
113:            public North getNorth() {
114:                return _north;
115:            }
116:
117:            public South getSouth() {
118:                return _south;
119:            }
120:
121:            public West getWest() {
122:                return _west;
123:            }
124:
125:            public East getEast() {
126:                return _east;
127:            }
128:
129:            public Center getCenter() {
130:                return _center;
131:            }
132:
133:            /**
134:             * Re-size this layout component.
135:             */
136:            public void resize() {
137:                smartUpdate("z.resize", "");
138:            }
139:
140:            public boolean insertBefore(Component child, Component insertBefore) {
141:                if (!(child instanceof  LayoutRegion))
142:                    throw new UiException(
143:                            "Unsupported child for Borderlayout: " + child);
144:                if (child instanceof  North) {
145:                    if (_north != null && child != _north)
146:                        throw new UiException(
147:                                "Only one north child is allowed: " + this );
148:                    _north = (North) child;
149:                } else if (child instanceof  South) {
150:                    if (_south != null && child != _south)
151:                        throw new UiException(
152:                                "Only one south child is allowed: " + this );
153:                    _south = (South) child;
154:                } else if (child instanceof  West) {
155:                    if (_west != null && child != _west)
156:                        throw new UiException(
157:                                "Only one west child is allowed: " + this );
158:                    _west = (West) child;
159:                } else if (child instanceof  East) {
160:                    if (_east != null && child != _east)
161:                        throw new UiException(
162:                                "Only one east child is allowed: " + this );
163:                    _east = (East) child;
164:                } else if (child instanceof  Center) {
165:                    if (_center != null && child != _center)
166:                        throw new UiException(
167:                                "Only one center child is allowed: " + this );
168:                    _center = (Center) child;
169:                }
170:                return super .insertBefore(child, insertBefore);
171:            }
172:
173:            // -- ComponentCtrl --//
174:            protected Object newExtraCtrl() {
175:                return new ExtraCtrl();
176:            }
177:
178:            /**
179:             * A utility class to implement {@link #getExtraCtrl}. It is used only by
180:             * component developers.
181:             */
182:            protected class ExtraCtrl extends XulElement.ExtraCtrl implements 
183:                    ChildChangedAware {
184:
185:                public boolean isChildChangedAware() {
186:                    return true;
187:                }
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.