Project Wonder 5.0

er.directtoweb.delegates
Class ERDBranchDelegate

java.lang.Object
  extended by er.directtoweb.delegates.ERDBranchDelegate
All Implemented Interfaces:
com.webobjects.directtoweb.NextPageDelegate, ERDBranchDelegateInterface
Direct Known Subclasses:
ERD2WControllerFactory.ERD2WController

public abstract class ERDBranchDelegate
extends java.lang.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.


Nested Class Summary
static interface ERDBranchDelegate.D2WDelegate
          Runtime flags for the delegate, so you can have one delegate for all tasks.
 
Field Summary
static java.lang.String BRANCH_BUTTON_ID
           
static java.lang.String BRANCH_CHOICES
           
static java.lang.String BRANCH_LABEL
           
static java.lang.String BRANCH_NAME
           
static java.lang.String BRANCH_PREFIX
           
static org.apache.log4j.Logger log
          logging support
static java.lang.Class[] WOComponentClassArray
          holds the WOComponent class array used to lookup branch delegate methods
 
Constructor Summary
ERDBranchDelegate()
           
 
Method Summary
protected  com.webobjects.foundation.NSDictionary branchChoiceDictionary(java.lang.String method, java.lang.String label)
          Utility to build branch choice dictionaries in code.
 com.webobjects.foundation.NSArray branchChoicesForContext(com.webobjects.directtoweb.D2WContext context)
          Calculates which branches to show in the display first asking the context for the key branchChoices.
protected  com.webobjects.foundation.NSArray choiceByLeavingKeys(com.webobjects.foundation.NSArray keys, com.webobjects.foundation.NSArray choices)
          Utility to leave entries based on an array of keys
protected  com.webobjects.foundation.NSArray choiceByRemovingKeys(com.webobjects.foundation.NSArray keys, com.webobjects.foundation.NSArray choices)
          Utility to remove entries based on an array of keys
protected  com.webobjects.directtoweb.D2WContext d2wContext(com.webobjects.appserver.WOComponent sender)
          Gets the D2W context from the innermost enclosing D2W component of the sender.
protected  com.webobjects.foundation.NSArray defaultBranchChoices(com.webobjects.directtoweb.D2WContext context)
          Uses reflection to find all of the public methods that don't start with an underscore and take a single WOComponent as a parameter are returned.
 com.webobjects.appserver.WOComponent nextPage(com.webobjects.appserver.WOComponent sender)
          Implementation of the NextPageDelegate interface.
protected  com.webobjects.eocontrol.EOEnterpriseObject object(com.webobjects.directtoweb.D2WContext context)
          Returns the current object form the d2w context
protected  com.webobjects.eocontrol.EOEnterpriseObject object(com.webobjects.appserver.WOComponent sender)
          return the innermost object which might be of interest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final org.apache.log4j.Logger log
logging support


WOComponentClassArray

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


BRANCH_CHOICES

public static final java.lang.String BRANCH_CHOICES
See Also:
Constant Field Values

BRANCH_BUTTON_ID

public static final java.lang.String BRANCH_BUTTON_ID
See Also:
Constant Field Values

BRANCH_NAME

public static final java.lang.String BRANCH_NAME
See Also:
Constant Field Values

BRANCH_LABEL

public static final java.lang.String BRANCH_LABEL
See Also:
Constant Field Values

BRANCH_PREFIX

public static final java.lang.String BRANCH_PREFIX
See Also:
Constant Field Values
Constructor Detail

ERDBranchDelegate

public ERDBranchDelegate()
Method Detail

nextPage

public final com.webobjects.appserver.WOComponent nextPage(com.webobjects.appserver.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 com.webobjects.directtoweb.NextPageDelegate
Parameters:
sender - template invoking the branch delegate
Returns:
result of dynamic method lookup and execution on itself.

branchChoiceDictionary

protected com.webobjects.foundation.NSDictionary branchChoiceDictionary(java.lang.String method,
                                                                        java.lang.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 com.webobjects.foundation.NSArray branchChoicesForContext(com.webobjects.directtoweb.D2WContext context)
Calculates which branches to show in the display first asking the context for the key branchChoices. If this returns null then

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

defaultBranchChoices

protected com.webobjects.foundation.NSArray defaultBranchChoices(com.webobjects.directtoweb.D2WContext context)
Uses reflection to find all of the public methods that don't start with an underscore and take a single WOComponent as a parameter are returned. The methods are sorted by this key.

Parameters:
context - current D2W context

d2wContext

protected com.webobjects.directtoweb.D2WContext d2wContext(com.webobjects.appserver.WOComponent sender)
Gets the D2W context from the innermost enclosing D2W component of the sender.

Parameters:
sender -

object

protected com.webobjects.eocontrol.EOEnterpriseObject object(com.webobjects.appserver.WOComponent sender)
return the innermost object which might be of interest

Parameters:
sender -

object

protected com.webobjects.eocontrol.EOEnterpriseObject object(com.webobjects.directtoweb.D2WContext context)
Returns the current object form the d2w context

Parameters:
context -

choiceByRemovingKeys

protected com.webobjects.foundation.NSArray choiceByRemovingKeys(com.webobjects.foundation.NSArray keys,
                                                                 com.webobjects.foundation.NSArray choices)
Utility to remove entries based on an array of keys

Parameters:
keys -
choices -

choiceByLeavingKeys

protected com.webobjects.foundation.NSArray choiceByLeavingKeys(com.webobjects.foundation.NSArray keys,
                                                                com.webobjects.foundation.NSArray choices)
Utility to leave entries based on an array of keys

Parameters:
keys -
choices -

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.