Source Code Cross Referenced for ReportView.java in  » Project-Management » EmForce » org » emforge » report » 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 » Project Management » EmForce » org.emforge.report 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * 
003:         */package org.emforge.report;
004:
005:        import java.util.ArrayList;
006:        import java.util.Collection;
007:
008:        import javax.faces.model.SelectItem;
009:
010:        /**
011:         * Contains all supported report view types and knows how to export it
012:         * 
013:         * @author szakusov, 11.03.2008: Implemented to keep all report view types in one place
014:         * @todo Format name should be expanded to full name, for example:
015:         * <pre>
016:         * "PDF" -> "Portable Document Format (PDF)"
017:         * </pre>
018:         * but in this case we should change some jsp's to display the format names in a listbox
019:         */
020:        public enum ReportView {
021:
022:            PDF(801, "PDF", ".pdf", "application/pdf"), XLS(802, "XLS", ".xls",
023:                    "application/vnd.ms-excel"), HTML(803, "HTML", ".html",
024:                    "text/html"), CSV(804, "CSV", ".csv",
025:                    "text/comma-separated-values"), ODT(805, "ODT", ".odt",
026:                    "application/odt");
027:
028:            private int m_formatType; // format type id
029:            private String m_formatName; // format name
030:            private String m_extension; // file extension of specified format
031:            private String m_contentType; // content type
032:
033:            /**
034:             * @param i_formatType
035:             * @param i_formatName
036:             * @param i_extension
037:             * @param i_contentType
038:             */
039:            private ReportView(int i_formatType, String i_formatName,
040:                    String i_extension, String i_contentType) {
041:
042:                m_formatType = i_formatType;
043:                m_formatName = i_formatName;
044:                m_extension = i_extension;
045:                m_contentType = i_contentType;
046:            }
047:
048:            /**
049:             * @return Format type
050:             */
051:            public int getFormatType() {
052:
053:                return m_formatType;
054:            }
055:
056:            /**
057:             * @return Format name
058:             */
059:            public String getFormatName() {
060:
061:                return m_formatName;
062:            }
063:
064:            /**
065:             * @return
066:             */
067:            public String getExtension() {
068:
069:                return m_extension;
070:            }
071:
072:            /**
073:             * @return
074:             */
075:            public String getContentType() {
076:
077:                return m_contentType;
078:            }
079:
080:            /**
081:             * @param i_formatType
082:             * @return
083:             */
084:            public boolean equals(int i_formatType) {
085:
086:                return m_formatType == i_formatType;
087:            }
088:
089:            /**
090:             * @param i_formatType
091:             * @return
092:             */
093:            public static ReportView getView(int i_formatType) {
094:
095:                ReportView result = null;
096:
097:                for (ReportView type : ReportView.values()) {
098:                    if (type.getFormatType() == i_formatType) {
099:                        result = type;
100:                        break;
101:                    }
102:                }
103:
104:                return result;
105:            }
106:
107:            /**
108:             * @return
109:             */
110:            public static Collection<SelectItem> getSelectItems() {
111:
112:                Collection<SelectItem> result = new ArrayList<SelectItem>();
113:
114:                for (ReportView type : ReportView.values()) {
115:                    result.add(new SelectItem(type.getFormatType(), type
116:                            .getFormatName()));
117:                }
118:
119:                return result;
120:            }
121:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.