Source Code Cross Referenced for ConfigurePopup.java in  » Library » Apache-beehive-1.0.2-src » org » apache » beehive » netui » tags » html » 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 » Library » Apache beehive 1.0.2 src » org.apache.beehive.netui.tags.html 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         * 
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         * 
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         *
017:         * $Header:$
018:         */
019:        package org.apache.beehive.netui.tags.html;
020:
021:        import org.apache.beehive.netui.tags.AbstractClassicTag;
022:        import org.apache.beehive.netui.util.Bundle;
023:
024:        import javax.servlet.jsp.JspException;
025:        import javax.servlet.jsp.tagext.JspTag;
026:        import javax.servlet.jsp.tagext.SimpleTagSupport;
027:        import javax.servlet.jsp.tagext.Tag;
028:
029:        /**
030:         * Configures popup window parameters for parent tags that can open popup windows.
031:         * @jsptagref.tagdescription Configures popup window parameters for parent tags that can open popup windows.
032:         * @example <pre>
033:         *     &lt;netui:anchor action="getCityZipFromNestedPageFlow" popup="true">
034:         *         Get a city and zip code
035:         *         &lt;netui:configurePopup resizable="false" width="400" height="200">
036:         *             &lt;netui:retrievePopupOutput tagIdRef="zipCodeField" dataSource="outputFormBean.zipCode" /&gt;
037:         *             &lt;netui:retrievePopupOutput tagIdRef="cityField" dataSource="outputFormBean.city" /&gt;
038:         *         &lt;/netui:configurePopup>
039:         *     &lt;/netui:anchor></pre>
040:         * @netui:tag name="configurePopup" description="Configures popup window parameters for parent tags that can open popup windows."
041:         */
042:        public class ConfigurePopup extends AbstractClassicTag {
043:            private String _name = "";
044:            private Boolean _toolbar = null;
045:            private Boolean _location = null;
046:            private Boolean _directories = null;
047:            private Boolean _status = null;
048:            private Boolean _menubar = null;
049:            private Boolean _resizable = null;
050:            private Boolean _scrollbars = null;
051:            private Integer _width = null;
052:            private Integer _height = null;
053:            private Integer _left = null;
054:            private Integer _top = null;
055:            private boolean _replace = false;
056:            private String _popupFunc;
057:            private String _onPopupDone;
058:            private boolean _updateFormFields = false;
059:
060:            /**
061:             * Return the name of the Tag.
062:             */
063:            public String getTagName() {
064:                return "ConfigurePopup";
065:            }
066:
067:            /**
068:             * Sets the JavaScript function to be called when the popup window is closing.  If this attribute is not present,
069:             * a default function will be generated.
070:             * @param onPopupDone the JavaScript function to be called when the popup window is closing.
071:             * @jsptagref.attributedescription The JavaScript function to be called when the popup window is closing.
072:             * @jsptagref.databindable false
073:             * @jsptagref.attributesyntaxvalue <i>string_onPopupDone</i>
074:             * @netui:attribute required="false" rtexprvalue="true"
075:             * description="The JavaScript function to be called when the popup window is closing."
076:             */
077:            public void setOnPopupDone(String onPopupDone) {
078:                _onPopupDone = onPopupDone;
079:            }
080:
081:            /**
082:             * Sets the JavaScript function to be called to open the popup window.  This function overrides the auto-generated
083:             * one that is based on the other attributes like <code>resizable</code>, <code>name</code>, etc.
084:             * @param popupFunc the JavaScript function to be called to open the popup window.
085:             * @jsptagref.attributedescription The JavaScript function to be called to open the popup window.
086:             * @jsptagref.databindable false
087:             * @jsptagref.attributesyntaxvalue <i>string_popupFunc</i>
088:             * @netui:attribute required="false" rtexprvalue="true"
089:             * description="The JavaScript function to be called to open the popup window."
090:             */
091:            public void setPopupFunc(String popupFunc) {
092:                _popupFunc = popupFunc;
093:            }
094:
095:            /**
096:             * Sets whether the JavaScript function that opens the popup window should add data
097:             * from the form fields to the request.
098:             * @param updateFormFields whether the data from the form fields is included in the popup window request.
099:             * @jsptagref.attributedescription Whether the data from the form fields is included in the popup window request.
100:             * @jsptagref.databindable true
101:             * @jsptagref.attributesyntaxvalue <i>string_updateFormFields</i>
102:             * @netui:attribute required="false" rtexprvalue="true"
103:             * description="Whether the data from the form fields is included in the popup window request."
104:             */
105:            public void setUpdateFormFields(boolean updateFormFields) {
106:                _updateFormFields = updateFormFields;
107:            }
108:
109:            /**
110:             * Sets the name of the popup window.
111:             * @param name the name of the popup window.
112:             * @jsptagref.attributedescription The name of the popup window.
113:             * @jsptagref.databindable true
114:             * @jsptagref.attributesyntaxvalue <i>string_name</i>
115:             * @netui:attribute required="false" rtexprvalue="true"
116:             * description="The name of the popup window."
117:             */
118:            public void setName(String name) {
119:                _name = name;
120:            }
121:
122:            /**
123:             * Sets whether the toolbar is visible in the popup window.
124:             * @param toolbar whether the toolbar is visible in the popup window.
125:             * @jsptagref.attributedescription Whether the toolbar is visible in the popup window.
126:             * @jsptagref.databindable true
127:             * @jsptagref.attributesyntaxvalue <i>boolean_toolbar</i>
128:             * @netui:attribute required="false" rtexprvalue="true"
129:             * description="Whether the toolbar is visible in the popup window."
130:             */
131:            public void setToolbar(boolean toolbar) {
132:                _toolbar = Boolean.valueOf(toolbar);
133:            }
134:
135:            /**
136:             * Sets whether the location (address) bar is visible in the popup window.
137:             * @param location whether the location (address) bar is visible in the popup window.
138:             * @jsptagref.attributedescription Whether the location (address) bar is visible in the popup window.
139:             * @jsptagref.databindable true
140:             * @jsptagref.attributesyntaxvalue <i>boolean_location</i>
141:             * @netui:attribute required="false" rtexprvalue="true"
142:             * description="Whether the location (address) bar is visible in the popup window."
143:             */
144:            public void setLocation(boolean location) {
145:                _location = Boolean.valueOf(location);
146:            }
147:
148:            /**
149:             * Sets whether directory buttons are displayed in the popup window.
150:             * @param directories whether directory buttons are displayed in the popup window.
151:             * @jsptagref.attributedescription Whether directory buttons are displayed in the popup window.
152:             * @jsptagref.databindable true
153:             * @jsptagref.attributesyntaxvalue <i>boolean_directories</i>
154:             * @netui:attribute required="false" rtexprvalue="true"
155:             * description="Whether directory buttons are displayed in the popup window."
156:             */
157:            public void setDirectories(boolean directories) {
158:                _directories = Boolean.valueOf(directories);
159:            }
160:
161:            /**
162:             * Sets whether the status bar is displayed in the popup window.
163:             * @param status whether the status bar is displayed in the popup window.
164:             * @jsptagref.attributedescription Whether the status bar is displayed in the popup window.
165:             * @jsptagref.databindable true
166:             * @jsptagref.attributesyntaxvalue <i>boolean_status</i>
167:             * @netui:attribute required="false" rtexprvalue="true"
168:             * description="Whether the status bar is displayed in the popup window."
169:             */
170:            public void setStatus(boolean status) {
171:                _status = Boolean.valueOf(status);
172:            }
173:
174:            /**
175:             * Sets whether the menu bar is displayed in the popup window.
176:             * @param menubar whether the menu bar is displayed in the popup window.
177:             * @jsptagref.attributedescription Whether the menu bar is displayed in the popup window.
178:             * @jsptagref.databindable true
179:             * @jsptagref.attributesyntaxvalue <i>boolean_menubar</i>
180:             * @netui:attribute required="false" rtexprvalue="true"
181:             * description="Whether the menu bar is displayed in the popup window."
182:             */
183:            public void setMenubar(boolean menubar) {
184:                _menubar = Boolean.valueOf(menubar);
185:            }
186:
187:            /**
188:             * Sets whether the popup window has scroll bars.
189:             * @param scrollbars whether the popup window has scroll bars.
190:             * @jsptagref.attributedescription Whether the popup window has scroll bars.
191:             * @jsptagref.databindable true
192:             * @jsptagref.attributesyntaxvalue <i>boolean_scrollbars</i>
193:             * @netui:attribute required="false" rtexprvalue="true"
194:             * description="Whether the popup window has scroll bars."
195:             */
196:            public void setScrollbars(boolean scrollbars) {
197:                _scrollbars = Boolean.valueOf(scrollbars);
198:            }
199:
200:            /**
201:             * Sets whether the popup window is resizable.
202:             * @param resizable whether the popup window is resizable.
203:             * @jsptagref.attributedescription Whether the popup window is resizable.
204:             * @jsptagref.databindable true
205:             * @jsptagref.attributesyntaxvalue <i>boolean_resizable</i>
206:             * @netui:attribute required="false" rtexprvalue="true"
207:             * description="Whether the popup window is resizable."
208:             */
209:            public void setResizable(boolean resizable) {
210:                _resizable = Boolean.valueOf(resizable);
211:            }
212:
213:            /**
214:             * Sets the width of the popup window.
215:             * @param width the width of the popup window.
216:             * @jsptagref.attributedescription The width of the popup window.
217:             * @jsptagref.databindable true
218:             * @jsptagref.attributesyntaxvalue <i>integer_width</i>
219:             * @netui:attribute required="false" rtexprvalue="true"
220:             * description="The width of the popup window."
221:             */
222:            public void setWidth(int width) {
223:                _width = new Integer(width);
224:            }
225:
226:            /**
227:             * Sets the height of the popup window.
228:             * @param height the height of the popup window.
229:             * @jsptagref.attributedescription The height of the popup window.
230:             * @jsptagref.databindable true
231:             * @jsptagref.attributesyntaxvalue <i>integer_height</i>
232:             * @netui:attribute required="false" rtexprvalue="true"
233:             * description="The height of the popup window."
234:             */
235:            public void setHeight(int height) {
236:                _height = new Integer(height);
237:            }
238:
239:            /**
240:             * Sets the X coordinate of the top left corner of the popup window.
241:             * @param left the X coordinate of the top left corner of the popup window.
242:             * @jsptagref.attributedescription The X coordinate of the top left corner of the popup window.
243:             * @jsptagref.databindable true
244:             * @jsptagref.attributesyntaxvalue <i>integer_left</i>
245:             * @netui:attribute required="false" rtexprvalue="true"
246:             * description="The X coordinate of the top left corner of the popup window."
247:             */
248:            public void setLeft(int left) {
249:                _left = new Integer(left);
250:            }
251:
252:            /**
253:             * Sets the Y coordinate of the top left corner of the popup window.
254:             * @param top the Y coordinate of the top left corner of the popup window.
255:             * @jsptagref.attributedescription The Y coordinate of the top left corner of the popup window.
256:             * @jsptagref.databindable true
257:             * @jsptagref.attributesyntaxvalue <i>integer_left</i>
258:             * @netui:attribute required="false" rtexprvalue="true"
259:             * description="The Y coordinate of the top left corner of the popup window."
260:             */
261:            public void setTop(int top) {
262:                _top = new Integer(top);
263:            }
264:
265:            /**
266:             * Sets whether the popup window's location will replace the location in the current window's navigation history.
267:             * @param replace whether the popup window's location will replace the location in the current window's navigation history.
268:             * @jsptagref.attributedescription Whether the popup window's location will replace the location in the current window's navigation history.
269:             * @jsptagref.databindable true
270:             * @jsptagref.attributesyntaxvalue <i>boolean_replace</i>
271:             * @netui:attribute required="false" rtexprvalue="true"
272:             * description="Whether the popup window's location will replace the location in the current window's navigation history."
273:             */
274:            public void setReplace(boolean replace) {
275:                _replace = replace;
276:            }
277:
278:            /**
279:             * @throws JspException if a JSP exception has occurred
280:             */
281:            public int doStartTag() throws JspException {
282:                JspTag parentTag = SimpleTagSupport.findAncestorWithClass(this ,
283:                        IHasPopupSupport.class);
284:                if (parentTag == null) {
285:                    String msg = Bundle
286:                            .getString("Tags_InvalidConfigurePopupParent");
287:                    registerTagError(msg, null);
288:                    reportErrors();
289:                } else {
290:                    PopupSupport popupSupport = ((IHasPopupSupport) parentTag)
291:                            .getPopupSupport();
292:
293:                    // if popupSupport is null, then the tag isn't set to open a popup window
294:                    if (popupSupport != null) {
295:                        popupSupport.setName(_name);
296:                        if (_toolbar != null)
297:                            popupSupport.setToolbar(_toolbar.booleanValue());
298:                        if (_location != null)
299:                            popupSupport.setLocation(_location.booleanValue());
300:                        if (_directories != null)
301:                            popupSupport.setDirectories(_directories
302:                                    .booleanValue());
303:                        if (_status != null)
304:                            popupSupport.setStatus(_status.booleanValue());
305:                        if (_menubar != null)
306:                            popupSupport.setMenubar(_menubar.booleanValue());
307:                        if (_resizable != null)
308:                            popupSupport
309:                                    .setResizable(_resizable.booleanValue());
310:                        if (_scrollbars != null)
311:                            popupSupport.setScrollbars(_scrollbars
312:                                    .booleanValue());
313:                        if (_width != null)
314:                            popupSupport.setWidth(_width.intValue());
315:                        if (_height != null)
316:                            popupSupport.setHeight(_height.intValue());
317:                        if (_left != null)
318:                            popupSupport.setLeft(_left.intValue());
319:                        if (_top != null)
320:                            popupSupport.setTop(_top.intValue());
321:                        popupSupport.setReplace(_replace);
322:                        popupSupport.setPopupFunc(_popupFunc);
323:                        popupSupport.setOnPopupDone(_onPopupDone);
324:
325:                        if (_updateFormFields) {
326:                            Form form = getNearestForm();
327:                            String realFormName = form.getRealFormId();
328:                            form.insureRealId();
329:                            popupSupport.setFormName(realFormName);
330:                        }
331:                    }
332:                }
333:
334:                localRelease();
335:                return EVAL_BODY_INCLUDE;
336:            }
337:
338:            /**
339:             * Release any acquired resources.
340:             */
341:            protected void localRelease() {
342:                _name = "";
343:                _toolbar = null;
344:                _location = null;
345:                _directories = null;
346:                _status = null;
347:                _menubar = null;
348:                _resizable = null;
349:                _scrollbars = null;
350:                _width = null;
351:                _height = null;
352:                _left = null;
353:                _top = null;
354:                _replace = false;
355:                _popupFunc = null;
356:                _onPopupDone = null;
357:                _updateFormFields = false;
358:
359:                super.localRelease();
360:            }
361:
362:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.