Source Code Cross Referenced for AmlCheckBoxTagProcessor.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 Mar 1, 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.GenericHtmlParserCallback;
011:        import com.sun.portal.wireless.htmlconversion.ParserState;
012:
013:        /**
014:         * Tag processor for the AmlCheckBox element
015:         * 
016:         * @author ashwin.mathew@sun.com
017:         */
018:        public class AmlCheckBoxTagProcessor extends BaseTagProcessor {
019:
020:            public static final String AML_CHECKBOX = "AmlCheckBox";
021:
022:            public static final String ATTR_NAME = "name";
023:            public static final String ATTR_SELECTED = "selected";
024:            public static final String ATTR_VALUE = "value";
025:            public static final String ATTR_VIEW = "view";
026:
027:            public static final String VAL_SELECTED_TRUE = "true";
028:            public static final String VAL_SELECTED_FALSE = "false";
029:
030:            public static final String VAL_VIEW_SHOW = "show";
031:            public static final String VAL_VIEW_HIDDEN = "hidden";
032:            public static final String VAL_VIEW_NONE = "none";
033:
034:            // No mapping to HTML tags, since this operates by delegation
035:            // from HtmlInputTagProcessor
036:            private static final String[] supportedTags = {};
037:
038:            /* (non-Javadoc)
039:             * @see com.sun.portal.wireless.htmlconversion.TagProcessor#getAmlTag()
040:             */
041:            public String getAmlTag() {
042:                return AML_CHECKBOX;
043:            }
044:
045:            /* (non-Javadoc)
046:             * @see com.sun.portal.wireless.htmlconversion.TagProcessor#getSupportedTags()
047:             */
048:            public String[] getSupportedTags() {
049:                return supportedTags;
050:            }
051:
052:            /* (non-Javadoc)
053:             * @see com.sun.portal.wireless.htmlconversion.TagProcessor#canHaveChildren(com.sun.portal.wireless.htmlconversion.ParserState)
054:             */
055:            public boolean canHaveChildren(ParserState state) {
056:                return false;
057:            }
058:
059:            /* (non-Javadoc)
060:             * @see com.sun.portal.wireless.htmlconversion.TagProcessor#startTag(java.lang.String, java.util.HashMap, com.sun.portal.wireless.htmlconversion.ParserState)
061:             */
062:            public Element startTag(String tagName, HashMap attributes,
063:                    ParserState state) {
064:                Element amlCheckBox = state.newElement(AML_CHECKBOX);
065:
066:                amlCheckBox.setAttribute(ATTR_NAME, (String) attributes
067:                        .get(HtmlInputTagProcessor.ATTR_NAME));
068:
069:                String checked = (String) attributes
070:                        .get(HtmlInputTagProcessor.ATTR_CHECKED);
071:                if (checked != null
072:                        && checked
073:                                .equals(HtmlInputTagProcessor.VAL_CHECKED_TRUE)) {
074:                    amlCheckBox.setAttribute(ATTR_SELECTED, VAL_SELECTED_TRUE);
075:                }
076:
077:                String value = (String) attributes
078:                        .get(HtmlInputTagProcessor.ATTR_VALUE);
079:                if (value != null) {
080:                    amlCheckBox.setAttribute(ATTR_VALUE, value);
081:                }
082:
083:                // Special case: if the input tag is set to readonly or disabled, then
084:                // output an AmlText with the value (since AmlCheckBox does not support 
085:                // readonly or disabled itself) and hide the AmlCheckBox (so that it's
086:                // value is still returned on form submission). This may have to be 
087:                // reworked to support i18n on the output "true" and "false" strings.
088:                if (attributes.keySet().contains(
089:                        HtmlInputTagProcessor.ATTR_DISABLED)) {
090:                    String selectedStr = VAL_SELECTED_TRUE;
091:                    if (checked == null
092:                            || checked
093:                                    .equals(HtmlInputTagProcessor.VAL_CHECKED_FALSE)) {
094:                        selectedStr = VAL_SELECTED_FALSE;
095:                    }
096:
097:                    Element amlText = AmlTextTagProcessor.createAmlTextElement(
098:                            selectedStr, state);
099:
100:                    GenericHtmlParserCallback.appendChildToOutputContainer(
101:                            state, amlText);
102:
103:                    amlCheckBox.setAttribute(ATTR_VIEW, VAL_VIEW_HIDDEN);
104:                }
105:
106:                return amlCheckBox;
107:            }
108:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.