| Package | org.puremvc.as3.patterns.mediator |
| Class | public class Mediator |
| Inheritance | Mediator Notifier |
| Implements | IMediator, INotifier |
IMediator implementation.
See also
| Property | Defined by | ||
|---|---|---|---|
![]() | facade : IFacade | Notifier | |
| mediatorName : String | Mediator | ||
| viewComponent : Object | Mediator | ||
| Method | Defined by | ||
|---|---|---|---|
|
Mediator(mediatorName:String = null, viewComponent:Object = null)
Constructor.
| Mediator | ||
|
getMediatorName():String
Get the name of the
Mediator. | Mediator | ||
|
getViewComponent():Object
Get the
Mediator's view component. | Mediator | ||
|
handleNotification(notification:INotification):void
Handle
INotifications. | Mediator | ||
|
listNotificationInterests():Array
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 | ||
![]() |
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 | ||
| Constant | Defined by | ||
|---|---|---|---|
| NAME : String = "Mediator" [static]
The name of the
Mediator. | Mediator | ||
| mediatorName | property |
protected var mediatorName:String
| viewComponent | property |
protected var viewComponent:Object
| Mediator | () | constructor |
public function Mediator(mediatorName:String = null, viewComponent:Object = null)Constructor.
ParametersmediatorName:String (default = null) |
|
viewComponent:Object (default = null) |
| getMediatorName | () | method |
public function getMediatorName():String
Get the name of the Mediator.
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;
}
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.
notification:INotification |
| listNotificationInterests | () | method |
public function listNotificationInterests():Array
List the INotification names this
Mediator is interested in being notified of.
Array — Array the list of INotification names
|
| onRegister | () | method |
public function onRegister():voidCalled by the View when the Mediator is registered
| onRemove | () | method |
public function onRemove():voidCalled by the View when the Mediator is removed
| setViewComponent | () | method |
public function setViewComponent(viewComponent:Object):void
Set the IMediator's view component.
viewComponent:Object — the view component
|
| NAME | constant |
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.