private void setType(Type type) { setStyleName(type.getStyle()); switch (type) { case WARNING_MESSAGE: setDelayMsec(1500); break; case ERROR_MESSAGE: setDelayMsec(DELAY_FOREVER); break; case TRAY_NOTIFICATION: setDelayMsec(3000); setPosition(Position.BOTTOM_RIGHT); break; case ASSISTIVE_NOTIFICATION: setDelayMsec(3000); setPosition(Position.ASSISTIVE); break; case HUMANIZED_MESSAGE: default: break; } }
public static Notification build(final String caption, final String description, final int delayMsec, final boolean htmlContentAllowed) { Notification notification = new Notification(caption); notification.setDescription(description); notification.setStyleName("tray dark small closable login-help"); notification.setPosition(Position.BOTTOM_CENTER); notification.setDelayMsec(delayMsec); notification.setHtmlContentAllowed(htmlContentAllowed); return notification; }
"The configuration has been saved successfully!", Type.HUMANIZED_MESSAGE); notification.setStyleName(ValoTheme.NOTIFICATION_CLOSABLE); notification.show(Page.getCurrent());
"The configuration has been saved successfully!", Type.HUMANIZED_MESSAGE); notification.setStyleName(ValoTheme.NOTIFICATION_CLOSABLE); notification.show(Page.getCurrent());
"The configuration has been saved successfully!", Type.HUMANIZED_MESSAGE); notification.setStyleName(ValoTheme.NOTIFICATION_CLOSABLE); notification.show(Page.getCurrent());
"The configuration has been saved successfully!", Type.HUMANIZED_MESSAGE); notification.setStyleName(ValoTheme.NOTIFICATION_CLOSABLE); notification.show(Page.getCurrent());
"The configuration has been saved successfully!", Type.HUMANIZED_MESSAGE); notification.setStyleName(ValoTheme.NOTIFICATION_CLOSABLE); notification.show(Page.getCurrent());
"The configuration has been saved successfully!", Type.HUMANIZED_MESSAGE); notification.setStyleName(ValoTheme.NOTIFICATION_CLOSABLE); notification.show(Page.getCurrent());
@Override public void buttonClick(ClickEvent clickEvent) { platformConfigurationService.saveConfigurationValue (ConfigurationConstants.DASHBOARD_BASE_URL, dashboardBaseUrl.getValue()); platformConfigurationService.saveWebServiceUsername(usernameField.getValue()); platformConfigurationService.saveWebServicePassword(passwordField.getValue()); Notification notification = new Notification( "Saved", "The configuration has been saved successfully!", Type.HUMANIZED_MESSAGE); notification.setStyleName(ValoTheme.NOTIFICATION_CLOSABLE); notification.show(Page.getCurrent()); } });
@Override public void buttonClick(ClickEvent clickEvent) { platformConfigurationService.saveConfigurationValue (ConfigurationConstants.REPLAY_TARGET_SERVERS, replayServers.getValue()); platformConfigurationService.saveConfigurationValue (ConfigurationConstants.NOTIFICATION_INTERVAL_MINUTES, notificationIntervalMinutes.getValue()); platformConfigurationService.saveConfigurationValue (ConfigurationConstants.SEARCH_RESULT_SET_SIZE, searchResultSize.getValue()); Notification notification = new Notification( "Saved", "The configuration has been saved successfully!", Type.HUMANIZED_MESSAGE); notification.setStyleName(ValoTheme.NOTIFICATION_CLOSABLE); notification.show(Page.getCurrent()); } });
@Override public void show() { com.vaadin.ui.Notification vNotification = new com.vaadin.ui.Notification(caption, description, convertType(notificationType)); if (hideDelayMs != DELAY_DEFAULT) { vNotification.setDelayMsec(hideDelayMs); } else { setNotificationDelayMsec(vNotification, notificationType); } if (position != Position.DEFAULT) { vNotification.setPosition(com.vaadin.shared.Position.valueOf(position.name())); } vNotification.setHtmlContentAllowed(contentMode == ContentMode.HTML); if (styleName != null) { vNotification.setStyleName(styleName); } vNotification.show(ui.getPage()); } }
"The configuration has been saved successfully! However, Solr does not appear to be running and will not be enabled.", Type.WARNING_MESSAGE); notification.setStyleName(ValoTheme.NOTIFICATION_CLOSABLE); notification.show(Page.getCurrent()); "The configuration has been saved successfully!", Type.HUMANIZED_MESSAGE); notification.setStyleName(ValoTheme.NOTIFICATION_CLOSABLE); notification.show(Page.getCurrent());
Type.HUMANIZED_MESSAGE); notif.setDelayMsec(-1); notif.setStyleName(ValoTheme.NOTIFICATION_CLOSABLE); notif.setPosition(Position.MIDDLE_CENTER);
Type.HUMANIZED_MESSAGE); notif.setDelayMsec(-1); notif.setStyleName(ValoTheme.NOTIFICATION_CLOSABLE); notif.setPosition(Position.MIDDLE_CENTER);
Type.HUMANIZED_MESSAGE); notif.setDelayMsec(-1); notif.setStyleName(ValoTheme.NOTIFICATION_CLOSABLE); notif.setPosition(Position.MIDDLE_CENTER);
Type.HUMANIZED_MESSAGE); notif.setDelayMsec(-1); notif.setStyleName(ValoTheme.NOTIFICATION_CLOSABLE); notif.setPosition(Position.MIDDLE_CENTER);
Type.HUMANIZED_MESSAGE); notif.setDelayMsec(-1); notif.setStyleName(ValoTheme.NOTIFICATION_CLOSABLE); notif.setPosition(Position.MIDDLE_CENTER);
@Override public void enter(final ViewChangeListener.ViewChangeEvent event) { final DashboardMenuItem view = dashboardMenu.getByViewName(event.getViewName()); if (view == null) { message.setValue(i18n.getMessage("message.error.view", event.getViewName())); return; } if (dashboardMenu.isAccessDenied(event.getViewName())) { final Notification nt = new Notification("Access denied", i18n.getMessage("message.accessdenied.view", event.getViewName()), Type.ERROR_MESSAGE, false); nt.setStyleName(SPUIStyleDefinitions.SP_NOTIFICATION_ERROR_MESSAGE_STYLE); nt.setPosition(Position.BOTTOM_RIGHT); nt.show(UI.getCurrent().getPage()); message.setValue(i18n.getMessage("message.accessdenied.view", event.getViewName())); } }
@Override public void enter(final ViewChangeListener.ViewChangeEvent event) { final DashboardMenuItem view = dashboardMenu.getByViewName(event.getViewName()); if (view == null) { message.setValue(i18n.getMessage("message.error.view", new Object[] { event.getViewName() })); return; } if (dashboardMenu.isAccessDenied(event.getViewName())) { final Notification nt = new Notification("Access denied", i18n.getMessage("message.accessdenied.view", new Object[] { event.getViewName() }), Type.ERROR_MESSAGE, false); nt.setStyleName(SPUIStyleDefinitions.SP_NOTIFICATION_ERROR_MESSAGE_STYLE); nt.setPosition(Position.BOTTOM_RIGHT); nt.show(UI.getCurrent().getPage()); message.setValue(i18n.getMessage("message.accessdenied.view", new Object[] { event.getViewName() })); } }
Type.HUMANIZED_MESSAGE); notif.setDelayMsec(-1); notif.setStyleName(ValoTheme.NOTIFICATION_CLOSABLE); notif.setPosition(Position.MIDDLE_CENTER);