Project Wonder 2.0

er.directtoweb
Class ERDBranchDelegate

java.lang.Object
  extended byer.directtoweb.ERDBranchDelegate
All Implemented Interfaces:
ERDBranchDelegateInterface, NextPageDelegate
Direct Known Subclasses:
ERD2WControllerFactory.ERD2WController

public abstract class ERDBranchDelegate
extends Object
implements ERDBranchDelegateInterface

The branch delegate is used in conjunction with the ERDMessagePageInterface to allow flexible branching for message pages. Branch delegates can only be used with templates that implement the ERDBranchInterface.


Field Summary
static ERXLogger log
          logging support
static Class[] WOComponentClassArray
          holds the WOComponent class array used to lookup branch delegate methods
 
Constructor Summary
ERDBranchDelegate()
           
 
Method Summary
protected  NSDictionary branchChoiceDictionary(String method, String label)
          Utility to build branch choice dictionaries in code.
 NSArray branchChoicesForContext(D2WContext context)
          Calculates which branches to show in the display first asking the context for the key branchChoices if this returns null then using reflection all of the public methods that take a single WOComponent as a parameter are returned.
 WOComponent nextPage(WOComponent sender)
          Implementation of the NextPageDelegate interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final ERXLogger log
logging support


WOComponentClassArray

public static final Class[] WOComponentClassArray
holds the WOComponent class array used to lookup branch delegate methods

Constructor Detail

ERDBranchDelegate

public ERDBranchDelegate()
Method Detail

nextPage

public final WOComponent nextPage(WOComponent sender)
Implementation of the NextPageDelegate interface. This method provides the dynamic dispatch based on the selected branch provided by the sender. Will call the method (WOComponent) on itself returning the result.

Specified by:
nextPage in interface NextPageDelegate
Parameters:
sender - template invoking the branch delegate
Returns:
result of dynamic method lookup and execution on itself.

branchChoiceDictionary

protected NSDictionary branchChoiceDictionary(String method,
                                              String label)
Utility to build branch choice dictionaries in code.

Parameters:
method - name of the method in question
label - label for the button, a beautified method name will be used if set to null.
Returns:
NSDictionary suitable as a branch choice.

branchChoicesForContext

public NSArray branchChoicesForContext(D2WContext context)
Calculates which branches to show in the display first asking the context for the key branchChoices if this returns null then using reflection all of the public methods that take a single WOComponent as a parameter are returned.

Specified by:
branchChoicesForContext in interface ERDBranchDelegateInterface
Parameters:
context - current D2W context
Returns:
array of branch names.

Last updated: Do, Dez 9, 2004 • 12:46 PM CET

Copyright © 2002 – 2004 Project Wonder.