Search in sources :

Example 1 with NotificationData

use of com.canoo.dp.impl.platform.projector.notifications.NotificationData in project dolphin-platform by canoo.

the class GlobalNotificationsHandler method init.

public CompletableFuture<Void> init() {
    CompletableFuture<ControllerProxy<NotificationWrapperBean>> controllerFuture = clientContext.createController(GLOBAL_NOTIFICATIONS_CONTROLLER);
    return controllerFuture.handle((c, e) -> {
        if (e != null) {
        // TODO
        }
        NotificationWrapperBean model = c.getModel();
        model.notificationProperty().onChanged(event -> {
            NotificationBean bean = model.getNotification();
            if (bean != null) {
                showNotification(new NotificationData(bean.getTitle(), bean.getDescription(), bean.getMessageType()));
            }
        });
        NotificationBean bean = model.getNotification();
        if (bean != null) {
            showNotification(new NotificationData(bean.getTitle(), bean.getDescription(), bean.getMessageType()));
        }
        return null;
    });
}
Also used : NotificationWrapperBean(com.canoo.dp.impl.platform.projector.notifications.NotificationWrapperBean) NotificationBean(com.canoo.dp.impl.platform.projector.notifications.NotificationBean) ControllerProxy(com.canoo.platform.remoting.client.ControllerProxy) NotificationData(com.canoo.dp.impl.platform.projector.notifications.NotificationData)

Aggregations

NotificationBean (com.canoo.dp.impl.platform.projector.notifications.NotificationBean)1 NotificationData (com.canoo.dp.impl.platform.projector.notifications.NotificationData)1 NotificationWrapperBean (com.canoo.dp.impl.platform.projector.notifications.NotificationWrapperBean)1 ControllerProxy (com.canoo.platform.remoting.client.ControllerProxy)1