Revision be4a9789
Added by Andreas Kohlbecker about 6 years ago
src/main/java/eu/etaxonomy/vaadin/mvp/AbstractPresenter.java | ||
---|---|---|
10 | 10 |
import org.springframework.beans.factory.annotation.Qualifier; |
11 | 11 |
import org.springframework.security.core.context.SecurityContext; |
12 | 12 |
import org.springframework.security.core.context.SecurityContextHolder; |
13 |
import org.vaadin.spring.events.EventBus; |
|
13 | 14 |
|
14 | 15 |
import eu.etaxonomy.cdm.api.application.CdmRepository; |
15 | 16 |
import eu.etaxonomy.cdm.vaadin.event.AbstractEditorAction; |
... | ... | |
34 | 35 |
|
35 | 36 |
private V view; |
36 | 37 |
|
37 |
|
|
38 | 38 |
protected V getView() { |
39 | 39 |
if(view == null){ |
40 | 40 |
Logger.getLogger(this.getClass()).warn("CDM-VAADIN#6562: presenter " + toString() + " without view."); |
... | ... | |
49 | 49 |
@Autowired |
50 | 50 |
private NavigationManager navigationManager; |
51 | 51 |
|
52 |
protected EventBus.ViewEventBus viewEventBus; |
|
53 |
|
|
54 |
@Autowired |
|
55 |
protected void setViewEventBus(EventBus.ViewEventBus viewEventBus){ |
|
56 |
this.viewEventBus = viewEventBus; |
|
57 |
eventViewBusSubscription(viewEventBus); |
|
58 |
} |
|
59 |
|
|
60 |
/** |
|
61 |
* Override if needed, e.g. to skip subscription |
|
62 |
* |
|
63 |
* @param viewEventBus |
|
64 |
*/ |
|
65 |
protected void eventViewBusSubscription(EventBus.ViewEventBus viewEventBus){ |
|
66 |
viewEventBus.subscribe(this); |
|
67 |
} |
|
68 |
|
|
69 |
public void unsubscribeFromEventBuses(){ |
|
70 |
viewEventBus.unsubscribe(this); |
|
71 |
} |
|
72 |
|
|
52 | 73 |
|
53 | 74 |
// protected DefaultTransactionDefinition definition = null; |
54 | 75 |
|
Also available in: Unified diff
fix #7231 replacing SpringApplicationEventBus by scoped Vaadin4Spring Event Bus