Project

General

Profile

« Previous | Next » 

Revision be4a9789

Added by Andreas Kohlbecker about 6 years ago

fix #7231 replacing SpringApplicationEventBus by scoped Vaadin4Spring Event Bus

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/ListPresenter.java
12 12

  
13 13
import org.apache.commons.lang3.StringUtils;
14 14
import org.springframework.beans.factory.annotation.Autowired;
15
import org.springframework.context.event.EventListener;
16 15
import org.springframework.security.core.Authentication;
16
import org.vaadin.spring.events.annotation.EventBusListenerMethod;
17 17

  
18 18
import com.vaadin.spring.annotation.SpringComponent;
19 19
import com.vaadin.spring.annotation.ViewScope;
......
58 58
        return workingSetService;
59 59
    }
60 60

  
61

  
61 62
    @Override
62 63
    public void handleViewEntered() {
63 64

  
......
129 130
        return dtoPager;
130 131
    }
131 132

  
132
    @EventListener(classes=ShowDetailsEvent.class, condition = "#event.type == T(eu.etaxonomy.cdm.vaadin.view.registration.RegistrationDTO)")
133
    public void onShowDetailsEvent(ShowDetailsEvent<?,?> event) { // WARNING don't use more specific generic type arguments
134
        RegistrationDTO regDto = getWorkingSetService().loadDtoById((Integer)event.getIdentifier());
135
        if(event.getProperty().equals("messages")){
136
            if(getView() != null){
137
                getView().openDetailsPopup("Messages", regDto.getMessages());
133
    @EventBusListenerMethod
134
    public void onShowDetailsEvent(ShowDetailsEvent<?,?> event) {
135

  
136
        if(event.getEntityType().equals(RegistrationDTO.class)){
137
            RegistrationDTO regDto = getWorkingSetService().loadDtoById((Integer)event.getIdentifier());
138
            if(event.getProperty().equals("messages")){
139
                if(getView() != null){
140
                    getView().openDetailsPopup("Messages", regDto.getMessages());
141
                }
138 142
            }
139 143
        }
140 144
    }
141 145

  
142
    @EventListener
146
    @EventBusListenerMethod
143 147
    public void onEntityChangeEvent(EntityChangeEvent event){
144 148
        if(event.getEntityType().isAssignableFrom(Reference.class)){
145 149
            // TODO update component showing the according reference, is there a Vaadin event supporting this?
146 150
        }
147 151
    }
148 152

  
149
    @EventListener
153
    @EventBusListenerMethod
150 154
    public void onUpdateResultsEvent(UpdateResultsEvent event){
151 155
        getView().populate(pageRegistrations(event.getField(), event.getNewText()));
152 156
    }

Also available in: Unified diff