Source Code Cross Referenced for AmlFormTagProcessor.java in  » Portal » Open-Portal » com » sun » portal » wireless » htmlconversion » processors » 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 » Open Portal » com.sun.portal.wireless.htmlconversion.processors 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Created on Feb 28, 2005
003:         */
004:        package com.sun.portal.wireless.htmlconversion.processors;
005:
006:        import java.util.HashMap;
007:
008:        import org.w3c.dom.Element;
009:
010:        import com.sun.portal.wireless.htmlconversion.ParserState;
011:
012:        /**
013:         * Tag processor for AmlForm
014:         * 
015:         * @author ashwin.mathew@sun.com
016:         */
017:        public class AmlFormTagProcessor extends BaseTagProcessor {
018:
019:            public static final String AML_FORM = "AmlForm";
020:
021:            private static final String[] supportedTags = { "form" };
022:
023:            // Attributes for AmlForm
024:            public static final String ATTR_URL = "url";
025:            public static final String ATTR_METHOD = "method";
026:            public static final String ATTR_SUBMIT_LABEL = "submit_label";
027:            public static final String ATTR_RESET = "reset";
028:            public static final String ATTR_RESET_LABEL = "reset_label";
029:
030:            public static final String VAL_METHOD_GET = "get";
031:            public static final String VAL_METHOD_POST = "post";
032:
033:            public static final String VAL_RESET_TRUE = "true";
034:
035:            // Attributes on Form tag
036:            public static final String FORM_ATTR_ACTION = "action";
037:            public static final String FORM_ATTR_METHOD = "method";
038:
039:            // List of AML elements that require a AmlForm in
040:            // their parent hierarchy
041:            private static final String[] elementsRequireForm = new String[4];
042:            static {
043:                elementsRequireForm[0] = AmlInputTagProcessor.AML_INPUT;
044:                elementsRequireForm[1] = AmlChoiceTagProcessor.AML_CHOICE;
045:                elementsRequireForm[2] = AmlTextAreaTagProcessor.AML_TEXT_AREA;
046:                elementsRequireForm[3] = AmlCheckBoxTagProcessor.AML_CHECKBOX;
047:            }
048:
049:            /* (non-Javadoc)
050:             * @see com.sun.portal.wireless.htmlconversion.TagProcessor#getAmlTag()
051:             */
052:            public String getAmlTag() {
053:                return AML_FORM;
054:            }
055:
056:            /* (non-Javadoc)
057:             * @see com.sun.portal.wireless.htmlconversion.TagProcessor#getSupportedTags()
058:             */
059:            public String[] getSupportedTags() {
060:                return supportedTags;
061:            }
062:
063:            /* (non-Javadoc)
064:             * @see com.sun.portal.wireless.htmlconversion.TagProcessor#canHaveChildren()
065:             */
066:            public boolean canHaveChildren(ParserState state) {
067:                return true;
068:            }
069:
070:            /* (non-Javadoc)
071:             * @see com.sun.portal.wireless.htmlconversion.TagProcessor#startTag(java.lang.String, java.util.HashMap, com.sun.portal.wireless.htmlconversion.ParserState)
072:             */
073:            public Element startTag(String tagName, HashMap attributes,
074:                    ParserState state) {
075:                Element amlForm = state.newElement(AML_FORM);
076:
077:                String url = AmlLinkTagProcessor.rewriteUrl((String) attributes
078:                        .get(FORM_ATTR_ACTION), state);
079:                amlForm.setAttribute(ATTR_URL, url);
080:
081:                String method = (String) attributes.get(FORM_ATTR_METHOD);
082:                if (method != null) {
083:                    amlForm.setAttribute(ATTR_METHOD, method);
084:                }
085:
086:                state.getLayoutManager().registerAmlFormTag(amlForm);
087:
088:                state.startedAmlForm();
089:
090:                return amlForm;
091:            }
092:
093:            /* (non-Javadoc)
094:             * @see com.sun.portal.wireless.htmlconversion.TagProcessor#endTag(java.lang.String, com.sun.portal.wireless.htmlconversion.ParserState)
095:             */
096:            public Element endTag(String tag, ParserState state) {
097:                state.endedAmlForm();
098:
099:                return super .endTag(tag, state);
100:            }
101:
102:            /**
103:             * Indicates whether or not the specified tag requires an AmlForm
104:             * in it's parent tag hierarchy.
105:             * 
106:             * @param tagName
107:             * @return
108:             */
109:            public static boolean doesElementRequireForm(String tagName) {
110:                boolean requiresForm = false;
111:
112:                for (int i = 0; i < elementsRequireForm.length; i++) {
113:                    if (tagName.equals(elementsRequireForm[i])) {
114:                        requiresForm = true;
115:                        break;
116:                    }
117:                }
118:
119:                return requiresForm;
120:            }
121:
122:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.