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; } }
protected void setNotificationDelayMsec(com.vaadin.ui.Notification notification, NotificationType type) { if (type == NotificationType.HUMANIZED) { notification.setDelayMsec(HUMANIZED_NOTIFICATION_DELAY_MSEC); } else if (type == NotificationType.WARNING) { notification.setDelayMsec(WARNING_NOTIFICATION_DELAY_MSEC); } }
@Override public void attach() { super.attach(); Object previousSessionError = getSession().getSession().getAttribute("PrevSessionError"); if (previousSessionError != null) { Notification notification = new Notification(previousSessionError.toString(), Notification.Type.ERROR_MESSAGE); notification.setDelayMsec(-1); notification.show(getUI().getPage()); getSession().getSession().setAttribute("PrevSessionError", null); } }
private void showNotification(Notification notification) { // keep the notification visible a little while after moving the // mouse, or until clicked notification.setDelayMsec(2000); notification.show(Page.getCurrent()); }
public static void showNotification(String title, String message, Type type, int delayMsec) { Notification notification = new Notification(title, message, type, true); notification.setDelayMsec(delayMsec); notification.show(Page.getCurrent()); }
public static void showNotification(String title, String message, Type type, int delayMsec) { Notification notification = new Notification(title, message, type, true); notification.setDelayMsec(delayMsec); notification.show(Page.getCurrent()); }
/** * Displays a localized warning. * @param caption the caption of the warning. * @param description the description of the warning. */ static void showWarning(final String caption, final String description) { Notification warning = new Notification(caption, description, Type.WARNING_MESSAGE, true); warning.setDelayMsec(-1); warning.show(UI.getCurrent().getPage()); } }
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; }
Type.WARNING_MESSAGE, true); notification.setDelayMsec(-1); notification.show(getPage());
private void createLoginUI(final AbstractOrderedLayout parentLayout) { final Rpi_gpio_controllerApplication application = this; LoginForm loginForm = new LoginForm(); loginForm.addListener(new LoginForm.LoginListener() { Rpi_gpio_controllerApplication mApplication = application; @Override public void onLogin(LoginEvent event) { String loginErrorMessage = new User( new UserData(event.getLoginParameter("username"), event.getLoginParameter("password")), mApplication).login(); if (loginErrorMessage != null) { Notification notification = new Notification(LoginErrorMessage, loginErrorMessage, Notification.TYPE_ERROR_MESSAGE); notification.setDelayMsec(1000); notification.show(Page.getCurrent()); } } }); Panel loginPanel = new Panel("Log in!!!!"); loginPanel.setWidth("200px"); loginPanel.setHeight("250px"); loginPanel.setContent(loginForm); parentLayout.addComponent(loginPanel); parentLayout.setComponentAlignment(loginPanel, Alignment.MIDDLE_CENTER);
@Override public void buttonClick(ClickEvent event) { String caption = "Help"; if(getCaption() != null && !getCaption().isEmpty()) { caption = "Help for \"" + getCaption(); } caption = caption + "<br/><br/>(Click here to close)"; Notification notify = new Notification(caption, Notification.Type.HUMANIZED_MESSAGE); notify.setHtmlContentAllowed(true); notify.setDescription(field.getDescription()); notify.setDelayMsec(-1); notify.show(UI.getCurrent().getPage()); }
/** * Method for displaying notification for the user. * * @param message the message to be displayed * @param description the description of this message * @param type the type of this notification */ public void notifyMessage(String message, String description, Notification.Type type) { Notification notification = new Notification("Message", type); notification.setCaption(message); notification.setDescription(description); notification.setDelayMsec(1000); if (getUI() != null) { if (getPage() != null) { notification.show(getUI().getPage()); } } }
n.setIcon(PINGUIN_IMAGE); n.setHtmlContentAllowed(true); n.setDelayMsec(15000);
/** * Method for displaying notification for the user. * * @param message the message to be displayed * @param description the description of this message * @param type the type of this notification */ public void notifyMessage(String message, String description, Notification.Type type) { Notification m_notification = new Notification("Message", type); m_notification.setCaption(message); m_notification.setDescription(description); m_notification.setDelayMsec(1000); if (getUI() != null) { if (getPage() != null) { m_notification.show(getUI().getPage()); } } }
/** * Method for displaying notification for the user. * * @param message the message to be displayed * @param description the description of this message */ public void notifyMessage(String message, String description) { final Notification notification = new Notification("Message", Notification.Type.TRAY_NOTIFICATION); notification.setCaption(message); notification.setDescription(description); notification.setDelayMsec(1000); if (getUI() != null) { if (getPage() != null) { notification.show(getUI().getPage()); } } } }
@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()); } }
"You can narrow the search with a filter or by being more accurate with the date and time range. ", Type.HUMANIZED_MESSAGE); notif.setDelayMsec(-1); notif.setStyleName(ValoTheme.NOTIFICATION_CLOSABLE); notif.setPosition(Position.MIDDLE_CENTER);
"You can narrow the search with a filter or by being more accurate with the date and time range. ", Type.HUMANIZED_MESSAGE); notif.setDelayMsec(-1); notif.setStyleName(ValoTheme.NOTIFICATION_CLOSABLE); notif.setPosition(Position.MIDDLE_CENTER);
"You can narrow the search with a filter or by being more accurate with the date and time range. ", Type.HUMANIZED_MESSAGE); notif.setDelayMsec(-1); notif.setStyleName(ValoTheme.NOTIFICATION_CLOSABLE); notif.setPosition(Position.MIDDLE_CENTER);
/** * @see org.opencms.ui.editors.messagebundle.CmsMessageBundleEditorTypes.I_OptionListener#handleLanguageChange(java.util.Locale) */ public void handleLanguageChange(final Locale locale) { if (!locale.equals(m_model.getLocale())) { Object sortProperty = m_table.getSortContainerPropertyId(); boolean isAcending = m_table.isSortAscending(); Map<Object, Object> filters = getFilters(); m_table.clearFilters(); if (m_model.setLocale(locale)) { m_options.setEditedFilePath(m_model.getEditedFilePath()); m_table.sort(new Object[] {sortProperty}, new boolean[] {isAcending}); } else { String caption = m_messages.key( Messages.GUI_NOTIFICATION_MESSAGEBUNDLEEDITOR_LOCALE_SWITCHING_FAILED_CAPTION_0); String description = m_messages.key( Messages.GUI_NOTIFICATION_MESSAGEBUNDLEEDITOR_LOCALE_SWITCHING_FAILED_DESCRIPTION_0); Notification warning = new Notification(caption, description, Type.WARNING_MESSAGE, true); warning.setDelayMsec(-1); warning.show(UI.getCurrent().getPage()); m_options.setLanguage(m_model.getLocale()); } setFilters(filters); m_table.select(m_table.getCurrentPageFirstItemId()); } }