Source Code Cross Referenced for PanelPositioned.java in  » J2EE » ICEfaces-1.6.1 » com » icesoft » faces » component » panelpositioned » 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 » J2EE » ICEfaces 1.6.1 » com.icesoft.faces.component.panelpositioned 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Version: MPL 1.1/GPL 2.0/LGPL 2.1
003:         *
004:         * "The contents of this file are subject to the Mozilla Public License
005:         * Version 1.1 (the "License"); you may not use this file except in
006:         * compliance with the License. You may obtain a copy of the License at
007:         * http://www.mozilla.org/MPL/
008:         *
009:         * Software distributed under the License is distributed on an "AS IS"
010:         * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
011:         * License for the specific language governing rights and limitations under
012:         * the License.
013:         *
014:         * The Original Code is ICEfaces 1.5 open source software code, released
015:         * November 5, 2006. The Initial Developer of the Original Code is ICEsoft
016:         * Technologies Canada, Corp. Portions created by ICEsoft are Copyright (C)
017:         * 2004-2006 ICEsoft Technologies Canada, Corp. All Rights Reserved.
018:         *
019:         * Contributor(s): _____________________.
020:         *
021:         * Alternatively, the contents of this file may be used under the terms of
022:         * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"
023:         * License), in which case the provisions of the LGPL License are
024:         * applicable instead of those above. If you wish to allow use of your
025:         * version of this file only under the terms of the LGPL License and not to
026:         * allow others to use your version of this file under the MPL, indicate
027:         * your decision by deleting the provisions above and replace them with
028:         * the notice and other provisions required by the LGPL License. If you do
029:         * not delete the provisions above, a recipient may use your version of
030:         * this file under either the MPL or the LGPL License."
031:         *
032:         */
033:
034:        package com.icesoft.faces.component.panelpositioned;
035:
036:        import com.icesoft.faces.component.CSS_DEFAULT;
037:        import com.icesoft.faces.component.dragdrop.DndEvent;
038:        import com.icesoft.faces.component.ext.taglib.Util;
039:        import com.icesoft.faces.component.panelseries.UISeries;
040:        import com.icesoft.faces.context.effects.JavascriptContext;
041:
042:        import javax.faces.context.FacesContext;
043:        import javax.faces.el.MethodBinding;
044:        import javax.faces.el.ValueBinding;
045:        import javax.faces.event.AbortProcessingException;
046:        import javax.faces.event.FacesEvent;
047:        import javax.faces.event.PhaseId;
048:
049:        /**
050:         * Panel Positioned Componenet class
051:         */
052:        public class PanelPositioned extends UISeries {
053:
054:            public static final String COMPONENET_TYPE = "com.icesoft.faces.dragdrop.PanelPositioned";
055:            public static final String DEFAULT_RENDERER_TYPE = "com.icesoft.faces.dragdrop.PanelPositionedRenderer";
056:            public static final String COMPONENT_FAMILY = "com.icesoft.faces.dragdrop.PanelPositionedFamily";
057:
058:            private String styleClass;
059:            private String style;
060:            private MethodBinding listener;
061:            private String overlap;
062:            private String constraint;
063:            private String handle;
064:            private String hoverclass;
065:
066:            public PanelPositioned() {
067:                super ();
068:                setRendererType(DEFAULT_RENDERER_TYPE);
069:                JavascriptContext.includeLib(JavascriptContext.ICE_EXTRAS,
070:                        FacesContext.getCurrentInstance());
071:            }
072:
073:            public String getFamily() {
074:                return COMPONENT_FAMILY;
075:            }
076:
077:            public String getRendererType() {
078:                return DEFAULT_RENDERER_TYPE;
079:            }
080:
081:            public String getStyleClass() {
082:                return Util.getQualifiedStyleClass(this , styleClass,
083:                        CSS_DEFAULT.POSITIONED_PANEL_DEFAULT_CLASS,
084:                        "styleClass");
085:            }
086:
087:            public void setStyleClass(String styleClass) {
088:                this .styleClass = styleClass;
089:            }
090:
091:            public String getStyle() {
092:                if (style != null) {
093:                    return style;
094:                }
095:                ValueBinding vb = getValueBinding("style");
096:                return vb != null ? (String) vb.getValue(getFacesContext())
097:                        : null;
098:            }
099:
100:            public void setStyle(String style) {
101:                this .style = style;
102:            }
103:
104:            public MethodBinding getListener() {
105:                return listener;
106:            }
107:
108:            public void setListener(MethodBinding listener) {
109:                this .listener = listener;
110:            }
111:
112:            public String getOverlap() {
113:                if (overlap != null) {
114:                    return overlap;
115:                }
116:                ValueBinding vb = getValueBinding("overlap");
117:                return vb != null ? (String) vb.getValue(getFacesContext())
118:                        : null;
119:            }
120:
121:            /**
122:             * Either 'vertical' or 'horizontal'. For floating sortables or horizontal
123:             * lists, choose 'horizontal'. Vertical lists should use 'vertical'.
124:             *
125:             * @param overlap
126:             */
127:            public void setOverlap(String overlap) {
128:                this .overlap = overlap;
129:            }
130:
131:            public String getConstraint() {
132:                if (constraint != null) {
133:                    return constraint;
134:                }
135:                ValueBinding vb = getValueBinding("constraint");
136:                return vb != null ? (String) vb.getValue(getFacesContext())
137:                        : null;
138:            }
139:
140:            /**
141:             * If set to 'horizontal' or 'vertical' the drag will be constrained to take
142:             * place only horizontally or vertically.
143:             *
144:             * @param constraint
145:             */
146:            public void setConstraint(String constraint) {
147:                this .constraint = constraint;
148:            }
149:
150:            public String getHandle() {
151:                if (handle != null) {
152:                    return handle;
153:                }
154:                ValueBinding vb = getValueBinding("handle");
155:                return vb != null ? (String) vb.getValue(getFacesContext())
156:                        : null;
157:            }
158:
159:            /**
160:             * The handle used to drag. The first child/grandchild/etc. element found
161:             * within the element that has this CSS class value will be used as the
162:             * handle.
163:             *
164:             * @param handle
165:             */
166:            public void setHandle(String handle) {
167:                this .handle = handle;
168:            }
169:
170:            public String getHoverclass() {
171:                if (hoverclass != null) {
172:                    return hoverclass;
173:                }
174:                ValueBinding vb = getValueBinding("hoverclass");
175:                return vb != null ? (String) vb.getValue(getFacesContext())
176:                        : null;
177:            }
178:
179:            /**
180:             * If set, the Droppable will have this additional CSS class when an
181:             * accepted Draggable is hovered over it.
182:             *
183:             * @param hoverclass
184:             */
185:            public void setHoverclass(String hoverclass) {
186:                this .hoverclass = hoverclass;
187:            }
188:
189:            public void broadcast(FacesEvent event)
190:                    throws AbortProcessingException {
191:
192:                if (event instanceof  PanelPositionedEvent) {
193:                    try {
194:
195:                        PanelPositionedEvent de = (PanelPositionedEvent) event;
196:                        de.process(); // Copy over the list values now
197:                        MethodBinding mb = de.getListener();
198:                        Object[] oa = { de };
199:                        mb.invoke(FacesContext.getCurrentInstance(), oa);
200:                    } catch (Exception e) {
201:                        e.printStackTrace();
202:                    }
203:                }
204:                super .broadcast(event);
205:            }
206:
207:            /* (non-Javadoc)
208:             * @see javax.faces.component.UIComponent#queueEvent(javax.faces.event.FacesEvent)
209:             */
210:            public void queueEvent(FacesEvent event) {
211:                if (event instanceof  DndEvent) {
212:
213:                    event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
214:                }
215:                super .queueEvent(event);
216:            }
217:
218:            public Object saveState(FacesContext context) {
219:                Object[] values = new Object[4];
220:                values[0] = super .saveState(context);
221:                values[1] = styleClass;
222:                values[2] = style;
223:                values[3] = listener;
224:                return values;
225:            }
226:
227:            public void restoreState(FacesContext context, Object stateIn) {
228:                Object[] state = (Object[]) stateIn;
229:                super .restoreState(context, state[0]);
230:                styleClass = (String) state[1];
231:                style = (String) state[2];
232:                listener = (MethodBinding) state[3];
233:            }
234:
235:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.