Package puremvc :: Package patterns :: Module mediator :: Class Mediator
[hide private]
[frames] | no frames]

type Mediator

source code

              object --+    
                       |    
interfaces.INotifier --+    
                       |    
       observer.Notifier --+
                           |
    interfaces.IMediator --+
                           |
    interfaces.INotifier --+
                           |
                          Mediator

A base IMediator implementation.


See Also: View

Instance Methods [hide private]
 
__init__(self, mediatorName=None, viewComponent=None)
Mediator Constructor
source code
 
getMediatorName(self)
Get the name of the Mediator.
source code
 
setViewComponent(self, viewComponent)
Set the IMediator's view component.
source code
 
getViewComponent(self)
Get the Mediator's view component.
source code
 
listNotificationInterests(self)
List the INotification names this Mediator is interested in being notified of.
source code
 
handleNotification(self, notification)
Handle INotifications.
source code
 
onRegister(self)
Called by the View when the Mediator is registered
source code
 
onRemove(self)
Called by the View when the Mediator is removed
source code

Inherited from observer.Notifier: sendNotification

Class Variables [hide private]
  NAME = 'Mediator'
  facade = None
  viewComponent = None
  mediatorName = None
Method Details [hide private]

__init__(self, mediatorName=None, viewComponent=None)
(Constructor)

source code 

Mediator Constructor

Typically, a Mediator will be written to serve one specific control or group controls and so, will not have a need to be dynamically named.

Overrides: observer.Notifier.__init__

getMediatorName(self)

source code 

Get the name of the Mediator.

Returns:
the Mediator name
Overrides: interfaces.IMediator.getMediatorName

setViewComponent(self, viewComponent)

source code 

Set the IMediator's view component.

Parameters:
  • viewComponent - the view component
Overrides: interfaces.IMediator.setViewComponent

getViewComponent(self)

source code 

Get the Mediator's view component.

Returns:
the view component
Overrides: interfaces.IMediator.getViewComponent

listNotificationInterests(self)

source code 

List the INotification names this Mediator is interested in being notified of.

Returns:
List the list of INotification names
Overrides: interfaces.IMediator.listNotificationInterests

handleNotification(self, notification)

source code 

Handle INotifications.

Typically this will be handled in a if/else statement, with one 'comparison' entry per INotification the Mediator is interested in.

Parameters:
  • notification - the INotification to be handled
Overrides: interfaces.IMediator.handleNotification

onRegister(self)

source code 

Called by the View when the Mediator is registered

Overrides: interfaces.IMediator.onRegister

onRemove(self)

source code 

Called by the View when the Mediator is removed

Overrides: interfaces.IMediator.onRemove