use of com.canoo.dp.impl.platform.projector.notifications.NotificationBean 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;
});
}
use of com.canoo.dp.impl.platform.projector.notifications.NotificationBean in project dolphin-platform by canoo.
the class GlobalNotificationsController method init.
@PostConstruct
public void init() {
eventBus.subscribe(GLOBAL_NOTIFICATION, e -> {
NotificationBean bean = beanManager.create(NotificationBean.class);
bean.setTitle(e.getData().getTitle());
bean.setDescription(e.getData().getText());
bean.setMessageType(e.getData().getMessageType());
model.setNotification(bean);
});
}
Aggregations