Packageorg.puremvc.as3.patterns.mediator
Classpublic class Mediator
InheritanceMediator Inheritance Notifier
ImplementsIMediator, INotifier

A base IMediator implementation.

See also

View


Protected Properties
 PropertyDefined by
 Inheritedfacade : IFacade
Notifier
  mediatorName : String
Mediator
  viewComponent : Object
Mediator
Public Methods
 MethodDefined by
  
Mediator(mediatorName:String = null, viewComponent:Object = null)
Constructor.
Mediator
  
getMediatorName():String
Get the name of the Mediator.
Mediator
  
Get the Mediator's view component.
Mediator
  
handleNotification(notification:INotification):void
Handle INotifications.
Mediator
  
List the INotification names this Mediator is interested in being notified of.
Mediator
  
onRegister():void
Called by the View when the Mediator is registered
Mediator
  
onRemove():void
Called by the View when the Mediator is removed
Mediator
 Inherited
sendNotification(notificationName:String, body:Object = null, type:String = null):void
Create and send an INotification.
Notifier
  
setViewComponent(viewComponent:Object):void
Set the IMediator's view component.
Mediator
Public Constants
 ConstantDefined by
  NAME : String = "Mediator"
[static] The name of the Mediator.
Mediator
Property detail
mediatorNameproperty
protected var mediatorName:String
viewComponentproperty 
protected var viewComponent:Object
Constructor detail
Mediator()constructor
public function Mediator(mediatorName:String = null, viewComponent:Object = null)

Constructor.

Parameters
mediatorName:String (default = null)
 
viewComponent:Object (default = null)
Method detail
getMediatorName()method
public function getMediatorName():String

Get the name of the Mediator.

Returns
String — the Mediator name
getViewComponent()method 
public function getViewComponent():Object

Get the Mediator's view component.

Additionally, an implicit getter will usually be defined in the subclass that casts the view object to a type, like this:

    private function get comboBox : mx.controls.ComboBox 
    {
     return viewComponent as mx.controls.ComboBox;
    }
   

Returns
Object — the view component
handleNotification()method 
public function handleNotification(notification:INotification):void

Handle INotifications.

Typically this will be handled in a switch statement, with one 'case' entry per INotification the Mediator is interested in.

Parameters
notification:INotification
listNotificationInterests()method 
public function listNotificationInterests():Array

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

Returns
Array — Array the list of INotification names
onRegister()method 
public function onRegister():void

Called by the View when the Mediator is registered

onRemove()method 
public function onRemove():void

Called by the View when the Mediator is removed

setViewComponent()method 
public function setViewComponent(viewComponent:Object):void

Set the IMediator's view component.

Parameters
viewComponent:Object — the view component
Constant detail
NAMEconstant
public static const NAME:String = "Mediator"

The name of the Mediator.

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.