Source Code Cross Referenced for XCustomXmlTemplateEngine.java in  » XML-UI » xui32 » com » xoetrope » carousel » catalog » 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 » XML UI » xui32 » com.xoetrope.carousel.catalog 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.xoetrope.carousel.catalog;
002:
003:        import com.xoetrope.template.XTemplateEngine;
004:        import net.xoetrope.xui.XProject;
005:
006:        /**
007:         * A test application for the template engine
008:         *
009:         * <p> Copyright (c) Xoetrope Ltd., 2001-2007, This software is licensed under
010:         * the GNU Public License (GPL), please see license.txt for more details. If
011:         * you make commercial use of this software you must purchase a commercial
012:         * license from Xoetrope.</p>
013:         * <p> $Revision: 1.2 $</p>
014:         */
015:        public class XCustomXmlTemplateEngine extends XTemplateEngine {
016:            private String welcomeText, subTitle;
017:            private int samples;
018:
019:            /**
020:             * 
021:             * Creates a new instance of XCustomXmlTemplateEngine
022:             */
023:            public XCustomXmlTemplateEngine(XProject proj, String source,
024:                    String target) {
025:                super (proj, source, target);
026:                samples = -1;
027:            }
028:
029:            /**
030:             * Include a given element
031:             * @param s the name of the element.
032:             * @param b <CODE>boolean</CODE> specifying whether the element is to be used or not.
033:             */
034:
035:            public void addInclude(String s, boolean b) {
036:                includes.put(s, b);
037:            }
038:
039:            /** 
040:             * Returns a boolean when given a key specifying whether the element is to be included or not.
041:             * @param elementName <CODE>String</CODE> specifying the element name.
042:             * @return true if the element is included, false if it is to be excluded.
043:             */
044:            public boolean includes(String elementName) {
045:                if (includes.containsKey(elementName)) {
046:                    Object o = includes.get(elementName);
047:                    return ((Boolean) o).booleanValue();
048:                }
049:                return false;
050:            }
051:
052:            /**
053:             * Sets the welcome text that will be displayed on the welcome page of the catalogue
054:             * @param <CODE>String</CODE> containing the welcome text
055:             */
056:            public void setWelcomeText(String text) {
057:                welcomeText = text;
058:            }
059:
060:            /**
061:             * Sets the sub-title text that will be displayed on the welcome page of the catalogue
062:             * @param <CODE>String</CODE> containing the sub-title text
063:             */
064:            public void setSubTitle(String text) {
065:                subTitle = text;
066:            }
067:
068:            /**
069:             * Add content to the xml template
070:             * @param key <CODE>String</CODE> containing the key for the content
071:             * @param content <CODE>String</CODE> containing the content
072:             */
073:            public void addContent(String key, String content) {
074:                contents.put(key, content);
075:            }
076:
077:            /**
078:             * Returns the content to be used in the xml template
079:             * @param elementName <CODE>String</CODE> containing the key for the content
080:             * @return <CODE>String</CODE> containing the content
081:             */
082:            public String getContent(String elementName) {
083:                if (contents.containsKey(elementName)) {
084:                    Object o = contents.get(elementName);
085:                    return o.toString();
086:                }
087:
088:                return null;
089:            }
090:
091:            /**
092:             * Sets how many sample products are to be used within the catalogue
093:             * @param a <CODE>int</CODE> specifying the amount of products to be included
094:             */
095:            public void useSampleProducts(int s) {
096:                samples = s;
097:
098:                if (includes("SimpleView")) {
099:                    if (samples == 2) {
100:                        addInclude("Products1", true);
101:                    } else if (samples == 4) {
102:                        addInclude("Products1", true);
103:                        addInclude("Products2", true);
104:                    } else if (samples == 8) {
105:                        addInclude("Products1", true);
106:                        addInclude("Products2", true);
107:                        addInclude("Products3", true);
108:                    } else if (samples == 12) {
109:                        addInclude("Products1", true);
110:                        addInclude("Products2", true);
111:                        addInclude("Products3", true);
112:                        addInclude("Products4", true);
113:                    }
114:                } else if (includes("TreeView")) {
115:                    if (samples == 2) {
116:                        addInclude("TreeProducts1", true);
117:                    } else if (samples == 4) {
118:                        addInclude("TreeProducts1", true);
119:                        addInclude("TreeProducts2", true);
120:                    } else if (samples == 8) {
121:                        addInclude("TreeProducts1", true);
122:                        addInclude("TreeProducts2", true);
123:                        addInclude("TreeProducts3", true);
124:                    } else if (samples == 12) {
125:                        addInclude("TreeProducts1", true);
126:                        addInclude("TreeProducts2", true);
127:                        addInclude("TreeProducts3", true);
128:                        addInclude("TreeProducts4", true);
129:                    }
130:                }
131:            }
132:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.