Event notification window closes if focus is lost

Signed-off-by: Melanie Retter <melanie.retter@bosch-si.com>
This commit is contained in:
Melanie Retter
2016-12-23 13:41:46 +01:00
committed by Kai Zimmermann
parent feb3369858
commit 113e528616

View File

@@ -17,6 +17,7 @@ import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.springframework.beans.factory.annotation.Autowired;
import com.vaadin.event.FieldEvents.BlurEvent;
import com.vaadin.navigator.View;
import com.vaadin.server.FontAwesome;
import com.vaadin.spring.annotation.SpringComponent;
@@ -94,6 +95,11 @@ public class NotificationUnreadButton extends Button {
notificationsWindow.setDraggable(false);
notificationsWindow.setId(UIComponentIdProvider.NOTIFICATION_UNREAD_POPUP_id);
notificationsWindow.addCloseListener(event -> refreshCaption());
notificationsWindow.addBlurListener(this::closeWindow);
}
private void closeWindow(final BlurEvent event) {
getUI().removeWindow((Window) event.getComponent());
}
private void toggleWindow(final ClickEvent event) {