77e65535c5d23a6ec15b61f35f357f7b57c98218
1 package eu
.etaxonomy
.vaadin
.mvp
;
3 import java
.util
.logging
.Logger
;
5 import org
.springframework
.beans
.factory
.annotation
.Autowired
;
6 import org
.springframework
.beans
.factory
.annotation
.Qualifier
;
8 import com
.vaadin
.spring
.annotation
.SpringComponent
;
9 import com
.vaadin
.spring
.annotation
.ViewScope
;
11 import eu
.etaxonomy
.cdm
.api
.application
.CdmRepository
;
14 * AbstractPresenter is the base class of all presenter components. Presenter's
15 * role is to govern the view and control the complex UI logic based on
16 * notifications presenter receives from its view.
18 * @author Peter / Vaadin
21 * type of the view this presenter governs
25 public abstract class AbstractPresenter
<V
extends ApplicationView
> {
30 protected V
getView() {
35 @Qualifier("cdmRepository")
36 private CdmRepository repo
;
41 public CdmRepository
getRepo() {
46 * Notifies the presenter that its view is initialized so that presenter can
47 * start its own initialization if required.
51 protected final void init(V view
) {
52 Logger
.getLogger(getClass().getName()).info("Presenter init");
58 * Extending classes should overwrite this method in order to perform logic
59 * after presenter has finished initializing.
61 protected void onPresenterReady() {
62 Logger
.getLogger(getClass().getName()).info("Presenter ready");
66 * Extending classes should overwrite this method to react to the event when
67 * user has navigated into the view that this presenter governs.
69 public void onViewEnter() {
70 Logger
.getLogger(getClass().getName()).info("View entered");
73 public void onViewExit() {