ERDBranchDelegate Class Reference

Inherits er::directtoweb::delegates::ERDBranchDelegateInterface.

Inherited by BranchDelegate, ListPageDelegate, and ERD2WControllerFactory.ERD2WController.

Collaboration diagram for ERDBranchDelegate:

Collaboration graph
[legend]

List of all members.

Classes

interface  D2WDelegate

Public Member Functions

NSArray branchChoicesForContext (D2WContext context)
final WOComponent nextPage (WOComponent sender)

Static Public Attributes

static final String BRANCH_BUTTON_ID = "branchButtonID"
static final String BRANCH_CHOICES = "branchChoices"
static final String BRANCH_LABEL = "branchButtonLabel"
static final String BRANCH_NAME = "branchName"
static final String BRANCH_PREFIX = "Button"
static final Logger log = Logger.getLogger(ERDBranchDelegate.class)
static final Class[] WOComponentClassArray = new Class[] { WOComponent.class }

Protected Member Functions

NSDictionary branchChoiceDictionary (String method, String label)
NSArray choiceByLeavingKeys (NSArray keys, NSArray choices)
NSArray choiceByRemovingKeys (NSArray keys, NSArray choices)
D2WContext d2wContext (WOComponent sender)
NSArray defaultBranchChoices (D2WContext context)
EOEnterpriseObject object (D2WContext context)
EOEnterpriseObject object (WOComponent sender)


Detailed Description

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.

Member Function Documentation

NSDictionary branchChoiceDictionary ( String  method,
String  label 
) [protected]

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.

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

Parameters:
context current D2W context
Returns:
array of branch names.

Implements ERDBranchDelegateInterface.

NSArray choiceByLeavingKeys ( NSArray  keys,
NSArray  choices 
) [protected]

Utility to leave entries based on an array of keys

Parameters:
keys 
choices 

NSArray choiceByRemovingKeys ( NSArray  keys,
NSArray  choices 
) [protected]

Utility to remove entries based on an array of keys

Parameters:
keys 
choices 

D2WContext d2wContext ( WOComponent  sender  )  [protected]

Gets the D2W context from the innermost enclosing D2W component of the sender.

Parameters:
sender 

NSArray defaultBranchChoices ( D2WContext  context  )  [protected]

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

Reimplemented in BranchDelegate, BugDelegate, ComponentDelegate, FrameworkDelegate, ListPageDelegate, PeopleDelegate, PushBugsDelegate, RequirementDelegate, and TestItemDelegate.

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 <branchName>(WOComponent) on itself returning the result.

Parameters:
sender template invoking the branch delegate
Returns:
result of dynamic method lookup and execution on itself.

EOEnterpriseObject object ( D2WContext  context  )  [protected]

Returns the current object form the d2w context

Parameters:
context 

EOEnterpriseObject object ( WOComponent  sender  )  [protected]

return the innermost object which might be of interest

Parameters:
sender 


Member Data Documentation

final String BRANCH_BUTTON_ID = "branchButtonID" [static]

final String BRANCH_CHOICES = "branchChoices" [static]

final String BRANCH_LABEL = "branchButtonLabel" [static]

final String BRANCH_NAME = "branchName" [static]

final String BRANCH_PREFIX = "Button" [static]

final Logger log = Logger.getLogger(ERDBranchDelegate.class) [static]

logging support

final Class [] WOComponentClassArray = new Class[] { WOComponent.class } [static]

holds the WOComponent class array used to lookup branch delegate methods


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:42:53 2012 for Project Wonder by  doxygen 1.5.8