Source Code Cross Referenced for FormButton.java in  » J2EE » webwork-2.2.6 » com » opensymphony » webwork » components » 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 » webwork 2.2.6 » com.opensymphony.webwork.components 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 2002-2006 by OpenSymphony
003:         * All rights reserved.
004:         */
005:        package com.opensymphony.webwork.components;
006:
007:        import com.opensymphony.xwork.util.OgnlValueStack;
008:
009:        import javax.servlet.http.HttpServletRequest;
010:        import javax.servlet.http.HttpServletResponse;
011:
012:        /**
013:         * FormButton.
014:         *
015:         * @author <a href="mailto:gielen@it-neering.net">Rene Gielen</a>
016:         * @author tm_jee
017:         */
018:
019:        public abstract class FormButton extends UIBean {
020:
021:            static final String BUTTONTYPE_INPUT = "input";
022:            static final String BUTTONTYPE_BUTTON = "button";
023:            static final String BUTTONTYPE_IMAGE = "image";
024:
025:            protected String action;
026:            protected String method;
027:            protected String align;
028:            protected String type;
029:
030:            public FormButton(OgnlValueStack stack, HttpServletRequest request,
031:                    HttpServletResponse response) {
032:                super (stack, request, response);
033:            }
034:
035:            //public void evaluateParams() {
036:            public void evaluateExtraParams() {
037:                super .evaluateExtraParams();
038:                if (align == null) {
039:                    align = "right";
040:                }
041:
042:                String submitType = BUTTONTYPE_INPUT;
043:                if (type != null
044:                        && (BUTTONTYPE_BUTTON.equalsIgnoreCase(type) || (supportsImageType() && BUTTONTYPE_IMAGE
045:                                .equalsIgnoreCase(type)))) {
046:                    submitType = type;
047:                }
048:
049:                //super.evaluateParams();
050:
051:                addParameter("type", submitType);
052:
053:                if (!BUTTONTYPE_INPUT.equals(submitType) && (label == null)) {
054:                    addParameter("label", getParameters().get("nameValue"));
055:                }
056:
057:                if (action != null || method != null) {
058:                    String name;
059:
060:                    if (action != null) {
061:                        name = "action:" + findString(action);
062:
063:                        if (method != null) {
064:                            name += "!" + findString(method);
065:                        }
066:                    } else {
067:                        name = "method:" + findString(method);
068:                    }
069:
070:                    addParameter("name", name);
071:                }
072:
073:                addParameter("align", findString(align));
074:            }
075:
076:            /**
077:             * Override UIBean's implementation, such that component Html id is determined
078:             * in the following order :-
079:             * <ol>
080:             * 	 <li>This component id attribute</li>
081:             *   <li>[containing_form_id]_[this_component_name]</li>
082:             *   <li>[containing_form_id]_[this_component_action]_[this_component_method]</li>
083:             *   <li>[containing_form_id]_[this_component_method]</li>
084:             *   <li>[this_component_name]</li>
085:             *   <li>[this_component_action]_[this_component_method]</li>
086:             *   <li>[this_component_method]</li>
087:             *   <li>[an increasing sequential number unique to the form starting with 0]</li>
088:             * </ol>
089:             */
090:            protected void populateComponentHtmlId(Form form) {
091:                String _tmp_id = "";
092:                if (id != null) {
093:                    // this check is needed for backwards compatibility with 2.1.x
094:                    if (altSyntax()) {
095:                        _tmp_id = findString(id);
096:                    } else {
097:                        _tmp_id = id;
098:                    }
099:                } else {
100:                    if (form != null && form.getParameters().get("id") != null) {
101:                        _tmp_id = _tmp_id
102:                                + form.getParameters().get("id").toString()
103:                                + "_";
104:                    }
105:                    if (name != null) {
106:                        _tmp_id = _tmp_id + escape(name);
107:                    } else if (action != null || method != null) {
108:                        if (action != null) {
109:                            _tmp_id = _tmp_id + escape(action);
110:                        }
111:                        if (method != null) {
112:                            _tmp_id = _tmp_id + "_" + escape(method);
113:                        }
114:                    } else {
115:                        // if form is null, this component is used, without a form, i guess
116:                        // there's not much we could do then.
117:                        if (form != null) {
118:                            _tmp_id = _tmp_id + form.getSequence();
119:                        }
120:                    }
121:                }
122:                addParameter("id", _tmp_id);
123:            }
124:
125:            /**
126:             * Indicate whether the concrete button supports the type "image".
127:             *
128:             * @return <tt>true</tt> if type image is supported.
129:             */
130:            protected abstract boolean supportsImageType();
131:
132:            /**
133:             * Set action attribute.
134:             *
135:             * @ww.tagattribute required="false" type="String"
136:             */
137:            public void setAction(String action) {
138:                this .action = action;
139:            }
140:
141:            /**
142:             * Set method attribute.
143:             *
144:             * @ww.tagattribute required="false" type="String"
145:             */
146:            public void setMethod(String method) {
147:                this .method = method;
148:            }
149:
150:            /**
151:             * HTML align attribute.
152:             *
153:             * @ww.tagattribute required="false" type="String"
154:             */
155:            public void setAlign(String align) {
156:                this .align = align;
157:            }
158:
159:            /**
160:             * The type of submit to use. Valid values are <i>input</i>, <i>button</i> and <i>image</i>.
161:             *
162:             * @ww.tagattribute required="false" type="String" default="input"
163:             */
164:            public void setType(String type) {
165:                this.type = type;
166:            }
167:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.