Revision 82f2be03
Added by Andreas Kohlbecker over 5 years ago
src/main/java/eu/etaxonomy/vaadin/ui/mainmenu/ValoMainMenuBean.java | ||
---|---|---|
5 | 5 |
import java.util.stream.Collectors; |
6 | 6 |
import java.util.stream.StreamSupport; |
7 | 7 |
|
8 |
import org.springframework.beans.factory.DisposableBean; |
|
8 | 9 |
import org.springframework.beans.factory.annotation.Autowired; |
9 | 10 |
import org.vaadin.spring.events.EventBus; |
10 | 11 |
import org.vaadin.spring.events.annotation.EventBusListenerMethod; |
... | ... | |
30 | 31 |
|
31 | 32 |
@SpringComponent |
32 | 33 |
@UIScope |
33 |
class ValoMainMenuBean extends CssLayout implements MainMenu { |
|
34 |
class ValoMainMenuBean extends CssLayout implements MainMenu, DisposableBean {
|
|
34 | 35 |
|
35 | 36 |
private static final long serialVersionUID = -993548217313748689L; |
36 | 37 |
|
... | ... | |
116 | 117 |
public void addMenuComponent(Component component) { |
117 | 118 |
menuArea.addComponent(component); |
118 | 119 |
} |
120 |
|
|
121 |
/** |
|
122 |
* {@inheritDoc} |
|
123 |
*/ |
|
124 |
@Override |
|
125 |
public void destroy() throws Exception { |
|
126 |
uiEventBus.unsubscribe(this); |
|
127 |
} |
|
119 | 128 |
} |
Also available in: Unified diff
fix #7742 unsubscribing other beans from event bus on dispose()