Source Code Cross Referenced for ListBoxTag.java in  » Portal » gridsphere » org » gridsphere » provider » portletui » tags » 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 » Portal » gridsphere » org.gridsphere.provider.portletui.tags 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * @author <a href="mailto:novotny@gridsphere.org">Jason Novotny</a>
003:         * @author <a href="mailto:oliver.wehrens@aei.mpg.de">Oliver Wehrens</a>
004:         * @version $Id: ListBoxTag.java 6385 2007-10-25 14:02:26Z wehrens $
005:         */
006:        package org.gridsphere.provider.portletui.tags;
007:
008:        import org.gridsphere.provider.portletui.beans.ListBoxBean;
009:        import org.gridsphere.provider.portletui.beans.ListBoxItemBean;
010:        import org.gridsphere.provider.portletui.beans.TagBean;
011:
012:        import javax.servlet.jsp.JspException;
013:        import javax.servlet.jsp.JspWriter;
014:        import java.util.ArrayList;
015:
016:        /**
017:         * A <code>ListBoxTag</code> represents a list box element
018:         */
019:        public class ListBoxTag extends ContainerTag {
020:
021:            protected ListBoxBean listbox = null;
022:            protected boolean isMultiple = false;
023:            protected int size = 1;
024:            protected String onChange = null;
025:            protected String onBlur = null;
026:            protected String onFocus = null;
027:            protected boolean submitOnChange = false;
028:
029:            /**
030:             * Returns the (html) size of the field.
031:             *
032:             * @return size of the field
033:             */
034:            public int getSize() {
035:                return size;
036:            }
037:
038:            /**
039:             * Sets the (html) size of the field
040:             *
041:             * @param size size of the field
042:             */
043:            public void setSize(int size) {
044:                this .size = size;
045:            }
046:
047:            /**
048:             * Returns true if this listbox should invoke a form submission if the selection is changed
049:             *
050:             * @return true if this listbox should invoke a form submission if the selection is changed
051:             */
052:            public boolean getSubmitOnChange() {
053:                return submitOnChange;
054:            }
055:
056:            /**
057:             * Sets whether this listbox should invoke a form submission if the selection is changed
058:             *
059:             * @param submitOnChange if true a form submission is invoked if selection changes
060:             */
061:            public void setSubmitOnChange(boolean submitOnChange) {
062:                this .submitOnChange = submitOnChange;
063:            }
064:
065:            /**
066:             * Returns the onChange JavaScript function
067:             *
068:             * @return onChange JavaScript function
069:             */
070:            public String getOnChange() {
071:                return onChange;
072:            }
073:
074:            /**
075:             * Sets the onChange JavaScript function
076:             *
077:             * @param onChange the onChange JavaScript function
078:             */
079:            public void setOnChange(String onChange) {
080:                this .onChange = onChange;
081:            }
082:
083:            /**
084:             * Returns the onBlur JavaScript function
085:             *
086:             * @return onBlur JavaScript function
087:             */
088:            public String getOnBlur() {
089:                return onBlur;
090:            }
091:
092:            /**
093:             * Sets the onBlur JavaScript function
094:             *
095:             * @param onBlur the onBlur JavaScript function
096:             */
097:            public void setOnBlur(String onBlur) {
098:                this .onBlur = onBlur;
099:            }
100:
101:            /**
102:             * Returns the onFocus JavaScript function
103:             *
104:             * @return onFocus JavaScript function
105:             */
106:            public String getOnFocus() {
107:                return onChange;
108:            }
109:
110:            /**
111:             * Sets the onFocus JavaScript function
112:             *
113:             * @param onFocus the onFocus JavaScript function
114:             */
115:            public void setOnFocus(String onFocus) {
116:                this .onFocus = onFocus;
117:            }
118:
119:            /**
120:             * Sets multiple selection
121:             *
122:             * @param isMultiple is true if listbox provides multiple selections, false otherwise
123:             */
124:            public void setMultiple(boolean isMultiple) {
125:                this .isMultiple = isMultiple;
126:            }
127:
128:            public void setListBoxBean(ListBoxBean listbox) {
129:                this .listbox = listbox;
130:            }
131:
132:            public ListBoxBean getListBoxBean() {
133:                return listbox;
134:            }
135:
136:            /**
137:             * Indicates if multiple selection is provided
138:             *
139:             * @return true if this listbox supports multiple selection, false otherwise
140:             */
141:            public boolean getMultiple() {
142:                return isMultiple;
143:            }
144:
145:            public int doStartTag() throws JspException {
146:                list = new ArrayList<TagBean>();
147:                if (submitOnChange)
148:                    onChange = "GridSphere_SelectSubmit( this.form )";
149:                if (!beanId.equals("")) {
150:                    listbox = (ListBoxBean) getTagBean();
151:                    if (listbox == null) {
152:                        listbox = new ListBoxBean();
153:                        listbox.setSize(size);
154:                        listbox.setMultipleSelection(isMultiple);
155:                        this .setBaseComponentBean(listbox);
156:                    } else {
157:                        if (size != 1)
158:                            listbox.setSize(size);
159:                        this .updateBaseComponentBean(listbox);
160:                    }
161:                } else {
162:                    listbox = new ListBoxBean();
163:                    listbox.setSize(size);
164:                    listbox.setMultipleSelection(isMultiple);
165:                    this .setBaseComponentBean(listbox);
166:                }
167:
168:                if (onChange != null)
169:                    listbox.setOnChange(onChange);
170:                if (onBlur != null)
171:                    listbox.setOnBlur(onBlur);
172:                if (onFocus != null)
173:                    listbox.setOnFocus(onFocus);
174:
175:                try {
176:                    JspWriter out = pageContext.getOut();
177:                    out.print(listbox.toStartString());
178:                } catch (Exception e) {
179:                    throw new JspException(e.getMessage());
180:                }
181:                return EVAL_BODY_INCLUDE;
182:            }
183:
184:            public int doEndTag() throws JspException {
185:                for (TagBean aList : list) {
186:                    ListBoxItemBean itembean = (ListBoxItemBean) aList;
187:                    listbox.addBean(itembean);
188:                }
189:                try {
190:                    JspWriter out = pageContext.getOut();
191:                    out.print(listbox.toEndString());
192:                } catch (Exception e) {
193:                    throw new JspException(e.getMessage());
194:                }
195:
196:                return EVAL_PAGE;
197:            }
198:
199:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.