creamtec.webcream.examples
Class CustomControlProcessor

java.lang.Object
  extended by creamtec.webcream.examples.CustomControlProcessor
All Implemented Interfaces:
ActionEmulator, ComponentUpdater, ComponentRenderer

public class CustomControlProcessor
extends java.lang.Object
implements ComponentRenderer, ComponentUpdater, ActionEmulator

Example of implementing a custom renderer, custom updater and action emulator See WebCream documentation and javadoc for more information.


Constructor Summary
CustomControlProcessor()
           
 
Method Summary
 boolean emulateAction(HTMLPage page, ActionData actionData)
          Called by WebCream to emulate a standard or custom action
 void postUpdateComponent(java.awt.Component comp, HttpRequestData data, ActionData actionData)
          Called by WebCream after the component and it's subtree of children has been updated
 void renderComponent(Document document, java.lang.Object component)
          The implementation must add code to the document that represents the component.
 boolean updateComponent(java.awt.Component comp, HttpRequestData data, ActionData actionData)
          Called by WebCream to apply the data from HTML page to the GUI component
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomControlProcessor

public CustomControlProcessor()
Method Detail

renderComponent

public void renderComponent(Document document,
                            java.lang.Object component)
                     throws java.lang.Exception
Description copied from interface: ComponentRenderer
The implementation must add code to the document that represents the component. For example, if rendering a JLabel into an HTML page then something like text should be added

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

updateComponent

public boolean updateComponent(java.awt.Component comp,
                               HttpRequestData data,
                               ActionData actionData)
                        throws java.lang.Exception
Called by WebCream to apply the data from HTML page to the GUI component

Specified by:
updateComponent in interface ComponentUpdater
Parameters:
comp - component that should be updated
data - data submitted by the browser. The data for each component depends on how it was represeted in HTML by ComponentRenderer
actionData - data structure that controls how the action will be emulated
Returns:
if component is a container, returning true will instruct the engine to continue processing container's children; returning false will instruct it to go to the next sibling
Throws:
java.lang.Exception

emulateAction

public boolean emulateAction(HTMLPage page,
                             ActionData actionData)
                      throws java.lang.Exception
Called by WebCream to emulate a standard or custom action

Specified by:
emulateAction in interface ActionEmulator
Returns:
true, if the action has been emulated and no further processing is necessary, false, if the action should be passed to other emulators or default processing
Throws:
java.lang.Exception

postUpdateComponent

public void postUpdateComponent(java.awt.Component comp,
                                HttpRequestData data,
                                ActionData actionData)
Description copied from interface: ComponentUpdater
Called by WebCream after the component and it's subtree of children has been updated

Specified by:
postUpdateComponent in interface ComponentUpdater


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