This presenter is designed to allow receiving notification about document changes.
When a presenter is really attached to a component, then notifyAttached method is called to notify it. Therefore
perform all initialization inside that method. Similarly notifyDetached is called when a presenter is dettached
from a component.
When a design is changed, designChanged method is called on a presenter. The getEventFilter method is called once
after notifyAttached method is called, for resolving the filter that is used for the design-changed listening.
If the presenter changes internally (based on design-changed or other way), it has to call firePresenterChanged method
to notify the model about it.
It is possible to use have a dependencies between presenters e.g. a presenter requires additional data
from other presenter for its own work. For that purpose there are addDependency and removeDependency methods that could
be called from notifyAttached and notifyDetached. When a presenter is no longer used, that all its dependencies are
automatically removed.
When at least one of the dependent presenters (those that this presenter has a dependency on), is changed, presenterChanged
method is called. At the time of the method call, presenterChanged methods on all the dependent presenters are called
(this means all dependent presenters are resolved).
When a presenter fires a presenter-changed event, the presenterChanged method is called automatically called too.
author: David Kaspar |