Package puremvc :: Module interfaces :: Class IView
[hide private]
[frames] | no frames]

Class IView

source code

object --+
         |
        IView
Known Subclasses:

The interface definition for a PureMVC View.

In PureMVC, IView implementors assume these responsibilities:

In PureMVC, the View class assumes these responsibilities:

Maintain a cache of IMediator instances.

Provide methods for registering, retrieving, and removing IMediators.

Managing the observer lists for each INotification in the application.

Providing a method for attaching IObservers to an INotification's observer list.

Providing a method for broadcasting an INotification.

Notifying the IObservers of a given INotification when it broadcast.


See Also:
IMediator, IObserver, INotification
Instance Methods [hide private]
 
registerObserver(self, notificationName, observer)
Register an IObserver to be notified of INotifications with a given name.
source code
 
notifyObservers(self, notification)
Notify the IObservers for a particular INotification.
source code
 
registerMediator(self, mediator)
Register an IMediator instance with the View.
source code
 
retrieveMediator(self, mediatorName)
Retrieve an IMediator from the View.
source code
 
removeMediator(self, mediatorName)
Remove an IMediator from the View.
source code
 
hasMediator(self, mediatorName)
Check if a Mediator is registered or not.
source code
 
removeObserver(self, notificationName, notifyContext)
Remove a group of observers from the observer list for a given Notification name.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

registerObserver(self, notificationName, observer)

source code 

Register an IObserver to be notified of INotifications with a given name.

Raises NotImplemented if subclass does not implement this method.

Parameters:
  • notificationName - the name of the INotifications to notify this IObserver of
  • observer - the IObserver to register

notifyObservers(self, notification)

source code 

Notify the IObservers for a particular INotification.

All previously attached IObservers for this INotification's list are notified and are passed a reference to the INotification in the order in which they were registered.

Raises NotImplemented if subclass does not implement this method.

Parameters:
  • notification - the INotification to notify IObservers of

registerMediator(self, mediator)

source code 

Register an IMediator instance with the View.

Registers the IMediator so that it can be retrieved by name, and further interrogates the IMediator for its INotification interests.

If the IMediator returns any INotification names to be notified about, an Observer is created encapsulating the IMediator instance's handleNotification method and registering it as an Observer for all INotifications the IMediator is interested in.

Parameters:
  • mediator - a reference to the IMediator instance

retrieveMediator(self, mediatorName)

source code 

Retrieve an IMediator from the View.

Raises NotImplemented if subclass does not implement this method.

Parameters:
  • mediatorName - the name of the IMediator instance to retrieve.
Returns:
the IMediator instance previously registered with the given mediatorName.

removeMediator(self, mediatorName)

source code 

Remove an IMediator from the View.

Raises NotImplemented if subclass does not implement this method.

Parameters:
  • mediatorName - name of the IMediator instance to be removed.
Returns:
the IMediator that was removed from the View

hasMediator(self, mediatorName)

source code 

Check if a Mediator is registered or not.

Raises NotImplemented if subclass does not implement this method.

Parameters:
  • mediatorName - name of the IMediator
Returns:
whether a Mediator is registered with the given mediatorName.

removeObserver(self, notificationName, notifyContext)

source code 

Remove a group of observers from the observer list for a given Notification name.

Raises NotImplemented if subclass does not implement this method.

Parameters:
  • notificationName - which observer list to remove from
  • notifyContext - removed the observers with this object as their notifyContext