Source Code Cross Referenced for Renderer.java in  » Database-ORM » MMBase » org » mmbase » framework » 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 » Database ORM » MMBase » org.mmbase.framework 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:
003:        This software is OSI Certified Open Source Software.
004:        OSI Certified is a certification mark of the Open Source Initiative.
005:
006:        The license (Mozilla version 1.0) can be read at the MMBase site.
007:        See http://www.MMBase.org/license
008:
009:         */
010:        package org.mmbase.framework;
011:
012:        import java.io.*;
013:        import java.net.URI;
014:        import org.mmbase.util.functions.*;
015:
016:        /**
017:         * A Renderer renders a certain aspect of a {@link Block}. Currently every block has two renderers,
018:         * which are identified by the renderer 'type' (see {@link #getType }). Every block also has a
019:         * {@link Processor}, which is similar to a Renderer, but a processor never generates content, only
020:         * handles interaction.
021:         *
022:         * A Renderer is stateless.
023:         *
024:         * @author Michiel Meeuwissen
025:         * @version $Id: Renderer.java,v 1.19 2008/01/25 09:32:23 michiel Exp $
026:         * @since MMBase-1.9
027:         */
028:        public interface Renderer {
029:
030:            /**
031:             * Every block can be in a certain window state, which could be considered during rendering.
032:             */
033:
034:            enum WindowState {
035:                /**
036:                 * Rendering may suppose a full browser window
037:                 */
038:                MAXIMIZED,
039:                /**
040:                 * Rendering should suppose only a 'link' version from the component.
041:                 */
042:                MINIMIZED,
043:                /**
044:                 * Rendering may suppose quite a large area, but should be aware that other blocks are in a
045:                 * similar state.
046:                 */
047:                NORMAL;
048:            }
049:
050:            enum Type {
051:                /**
052:                 * Not yet rendering
053:                 */
054:                NOT,
055:                /**
056:                 * Rendering for 'HEAD' typically happens in the <head> block of HTML, and can
057:                 * e.g. produce links to javascript.
058:                 */
059:                HEAD,
060:                /**
061:                 * A body typed renderer renders the actual content of a block. It should produce a <div>
062:                 */
063:                BODY;
064:
065:                /**
066:                 * Returns a renderer that does nothing.
067:                 */
068:                Renderer getEmpty(final Block block) {
069:                    return new Renderer() {
070:                        public Type getType() {
071:                            return Type.this ;
072:                        }
073:
074:                        public void render(Parameters parameters,
075:                                Parameters urlparameters, Writer w,
076:                                WindowState state) {
077:                        };
078:
079:                        public Parameter[] getParameters() {
080:                            return Parameter.emptyArray();
081:                        };
082:
083:                        public Block getBlock() {
084:                            return block;
085:                        };
086:
087:                        public String toString() {
088:                            return "EMPTY Renderer";
089:                        }
090:
091:                        public URI getUri() {
092:                            try {
093:                                return new URI("mmbase:/renderer/" + Type.this 
094:                                        + "/empty");
095:                            } catch (Exception e) {
096:                                return null;
097:                            }
098:                        }
099:                    };
100:                }
101:            }
102:
103:            /**
104:             * Describes what kind of renderer this is
105:             */
106:            Type getType();
107:
108:            /**
109:             * Every renderer renders for a certain block.
110:             */
111:            Block getBlock();
112:
113:            /**
114:             * A renderer may need certain parameters. These are added to the block-parameters. This method
115:             * is called on instantation of the renderer.
116:             */
117:            Parameter[] getParameters();
118:
119:            /**
120:             * Renders to a writer. In case of e.g. a JSPView, the parameters must also contain
121:             * the Http Servlet response and request, besided specific parameters for this component.
122:             */
123:            void render(Parameters blockParameters,
124:                    Parameters frameworkParameters, Writer w, WindowState state)
125:                    throws FrameworkException;
126:
127:            /**
128:             * An URI which may identify the implementation of this Renderer.
129:             */
130:
131:            URI getUri();
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.