creamtec.webcream.rendering
Class AbstractDocumentRenderer

java.lang.Object
  extended by creamtec.webcream.rendering.AbstractDocumentRenderer
All Implemented Interfaces:
ComponentRenderer, DocumentRenderer
Direct Known Subclasses:
HTMLPageRenderer

public abstract class AbstractDocumentRenderer
extends java.lang.Object
implements DocumentRenderer

Acts as a base class for all document renderers and contains logic shared by all of them. Includes support for renderer maps


Field Summary
static boolean dummyField1
           
static boolean LIMIT_MODE
           
 
Constructor Summary
AbstractDocumentRenderer()
           
 
Method Summary
 void afterRenderComponent(Document document, java.lang.Object obj)
          A callback method that is invoked right after the component is rendered
 void beforeRenderComponent(Document document, java.lang.Object obj)
          A callback method that is invoked right before the component is rendered
abstract  Document createDocument()
          Abstract Factory Method design pattern to create documents.
 ComponentRenderer getCustomComponentRenderer(java.lang.Object component)
          Locates the proper renderer for the given component and returns it
 DefaultComponentRenderer getDefaultJComponentRenderer()
           
static boolean knownContainer(java.lang.Object comp)
          Returns true if the passed component should be rendered as a container.
 void renderComponent(Document document, java.lang.Object component)
          Facade method for rendering a component into the document.
abstract  void renderContainer(Document document, java.awt.Container container)
          Renders given container into the given document.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface creamtec.webcream.rendering.DocumentRenderer
renderDocument
 

Field Detail

LIMIT_MODE

public static boolean LIMIT_MODE

dummyField1

public static boolean dummyField1
Constructor Detail

AbstractDocumentRenderer

public AbstractDocumentRenderer()
Method Detail

renderContainer

public abstract void renderContainer(Document document,
                                     java.awt.Container container)
                              throws java.lang.Exception
Renders given container into the given document. Subclasses override to add logic

Throws:
java.lang.Exception

createDocument

public abstract Document createDocument()
                                 throws java.lang.Exception
Abstract Factory Method design pattern to create documents.

Throws:
java.lang.Exception

getCustomComponentRenderer

public ComponentRenderer getCustomComponentRenderer(java.lang.Object component)
                                             throws java.lang.Exception
Locates the proper renderer for the given component and returns it

Parameters:
component - descendent or Object descendent such as MenuBar
Throws:
WebCreamException - if there is no renderer for the component
java.lang.Exception

renderComponent

public void renderComponent(Document document,
                            java.lang.Object component)
                     throws java.lang.Exception
Facade method for rendering a component into the document. If the component is a known container (such as JPanel) then delegates to renderContainer method. Otherwise delegates to the appropriate component renderer. This method should be used as an entry level into WebCream framework for rendering components.

Specified by:
renderComponent in interface ComponentRenderer
Parameters:
document - such as HTML page that is being rendered
component - GUI component that needs to be rendered. Can be subclasses of java.awt.Component or other components such as JMenuItem
Throws:
java.lang.Exception

knownContainer

public static boolean knownContainer(java.lang.Object comp)
Returns true if the passed component should be rendered as a container. For example, JPanel is rendered as a container, but JLabel which extend java.awt.Container should not be rendered as a Container since WebCream doesn't support components inside JLabel.


beforeRenderComponent

public void beforeRenderComponent(Document document,
                                  java.lang.Object obj)
A callback method that is invoked right before the component is rendered


afterRenderComponent

public void afterRenderComponent(Document document,
                                 java.lang.Object obj)
A callback method that is invoked right after the component is rendered


getDefaultJComponentRenderer

public DefaultComponentRenderer getDefaultJComponentRenderer()


Copyright © 2000-2006 CreamTec LLC. All Rights Reserved.