List of usage examples for com.vaadin.shared Position TOP_CENTER
Position TOP_CENTER
To view the source code for com.vaadin.shared Position TOP_CENTER.
Click Source Link
From source file:facs.components.BookAdmin.java
License:Open Source License
private void showErrorNotification(String title, String description) { Notification notify = new Notification(title, description); notify.setDelayMsec(15000);/* www . j av a 2 s . c om*/ notify.setPosition(Position.TOP_CENTER); notify.setIcon(FontAwesome.FROWN_O); notify.setStyleName(ValoTheme.NOTIFICATION_ERROR + " " + ValoTheme.NOTIFICATION_CLOSABLE); notify.show(Page.getCurrent()); }
From source file:facs.components.BookAdmin.java
License:Open Source License
private void Notification(String title, String description, String type) { Notification notify = new Notification(title, description); notify.setPosition(Position.TOP_CENTER); if (type.equals("error")) { notify.setDelayMsec(16000);//from www .j a v a2s . c om notify.setIcon(FontAwesome.FROWN_O); notify.setStyleName(ValoTheme.NOTIFICATION_ERROR + " " + ValoTheme.NOTIFICATION_CLOSABLE); } else if (type.equals("success")) { notify.setDelayMsec(8000); notify.setIcon(FontAwesome.SMILE_O); notify.setStyleName(ValoTheme.NOTIFICATION_SUCCESS + " " + ValoTheme.NOTIFICATION_CLOSABLE); } else { notify.setDelayMsec(8000); notify.setIcon(FontAwesome.MEH_O); notify.setStyleName(ValoTheme.NOTIFICATION_TRAY + " " + ValoTheme.NOTIFICATION_CLOSABLE); } notify.show(Page.getCurrent()); }
From source file:facs.components.Booking.java
License:Open Source License
private void showErrorNotification(String title, String description) { Notification notify = new Notification(title, description); notify.setDelayMsec(16000);/*from w w w.j av a 2s.co m*/ notify.setPosition(Position.TOP_CENTER); notify.setIcon(FontAwesome.FROWN_O); notify.setStyleName(ValoTheme.NOTIFICATION_ERROR + " " + ValoTheme.NOTIFICATION_CLOSABLE); notify.show(Page.getCurrent()); }
From source file:facs.components.Booking.java
License:Open Source License
private void showNotification(String title, String description) { Notification notify = new Notification(title, description); notify.setDelayMsec(8000);//from w w w. j a v a 2 s . com notify.setPosition(Position.TOP_CENTER); notify.setIcon(FontAwesome.MEH_O); notify.setStyleName(ValoTheme.NOTIFICATION_TRAY + " " + ValoTheme.NOTIFICATION_CLOSABLE); notify.show(Page.getCurrent()); }
From source file:facs.components.Booking.java
License:Open Source License
private void showSuccessfulNotification(String title, String description) { Notification notify = new Notification(title, description); notify.setDelayMsec(8000);//from www.ja va 2 s . co m notify.setPosition(Position.TOP_CENTER); notify.setIcon(FontAwesome.SMILE_O); notify.setStyleName(ValoTheme.NOTIFICATION_SUCCESS + " " + ValoTheme.NOTIFICATION_CLOSABLE); notify.show(Page.getCurrent()); }
From source file:fr.amapj.view.engine.notification.NotificationHelper.java
License:Open Source License
static public void displayNotification(String message) { Notification notification = new Notification("Erreur", message, Type.ERROR_MESSAGE, true); notification.setPosition(Position.TOP_CENTER); notification.setDelayMsec(1000);/*from w w w .j a va 2 s. c o m*/ notification.show(Page.getCurrent()); }
From source file:fr.univlorraine.mondossierweb.controllers.UiController.java
License:Apache License
/** * Permet la saisie et l'envoi d'un message tous les clients connects *//*from w ww.j a va 2 s . c om*/ public void sendMessage() { InputWindow inputWindow = new InputWindow( applicationContext.getMessage("admin.sendMessage.message", null, UI.getCurrent().getLocale()), applicationContext.getMessage("admin.sendMessage.title", null, UI.getCurrent().getLocale())); inputWindow.addBtnOkListener(text -> { if (text instanceof String && !text.isEmpty()) { Notification notification = new Notification( applicationContext.getMessage("admin.sendMessage.notificationCaption", new Object[] { text }, UI.getCurrent().getLocale()), Type.TRAY_NOTIFICATION); notification.setDelayMsec(-1); notification.setDescription("\n" + applicationContext.getMessage( "admin.sendMessage.notificationDescription", null, UI.getCurrent().getLocale())); notification.setPosition(Position.TOP_CENTER); sendNotification(notification); } }); UI.getCurrent().addWindow(inputWindow); }
From source file:helpers.Utils.java
License:Open Source License
public static void Notification(String title, String description, String type) { Notification notify = new Notification(title, description); notify.setPosition(Position.TOP_CENTER); if (type.equals("error")) { notify.setDelayMsec(16000);// ww w . jav a 2s . c o m notify.setIcon(FontAwesome.FROWN_O); notify.setStyleName(ValoTheme.NOTIFICATION_ERROR + " " + ValoTheme.NOTIFICATION_CLOSABLE); } else if (type.equals("success")) { notify.setDelayMsec(8000); notify.setIcon(FontAwesome.SMILE_O); notify.setStyleName(ValoTheme.NOTIFICATION_SUCCESS + " " + ValoTheme.NOTIFICATION_CLOSABLE); } else { notify.setDelayMsec(8000); notify.setIcon(FontAwesome.COMMENT); notify.setStyleName(ValoTheme.NOTIFICATION_TRAY + " " + ValoTheme.NOTIFICATION_CLOSABLE); } notify.show(Page.getCurrent()); }
From source file:life.qbic.utils.qOfferManagerUtils.java
License:Open Source License
/** * Displays a vaadin Notification with the respective title, description and type. * @param title: title of the displayNotification window * @param description: description of the displayNotification Window * @param type: one of "error", "success" and "warning". Changes the style and the delay of the displayNotification. *///from ww w . j a v a 2 s. c om public static void displayNotification(String title, String description, String type) { com.vaadin.ui.Notification notify = new com.vaadin.ui.Notification(title, description); notify.setPosition(Position.TOP_CENTER); switch (type) { case "error": notify.setDelayMsec(16000); notify.setIcon(FontAwesome.FROWN_O); notify.setStyleName(ValoTheme.NOTIFICATION_ERROR + " " + ValoTheme.NOTIFICATION_CLOSABLE); break; case "success": notify.setDelayMsec(8000); notify.setIcon(FontAwesome.SMILE_O); notify.setStyleName(ValoTheme.NOTIFICATION_SUCCESS + " " + ValoTheme.NOTIFICATION_CLOSABLE); break; case "warning": notify.setDelayMsec(16000); notify.setIcon(FontAwesome.MEH_O); notify.setStyleName(ValoTheme.NOTIFICATION_WARNING + " " + ValoTheme.NOTIFICATION_CLOSABLE); break; default: notify.setDelayMsec(16000); notify.setIcon(FontAwesome.MEH_O); notify.setStyleName(ValoTheme.NOTIFICATION_TRAY + " " + ValoTheme.NOTIFICATION_CLOSABLE); break; } notify.show(Page.getCurrent()); }
From source file:tad.grupo7.ccamistadeslargas.AmigosLayout.java
/** * Muestra una amistad en concreto./*www.ja va2s . c o m*/ * @param p Participante */ private void mostrarParticipante(Participante p) { //FORMULARIO POR SI SE QUIERE EDITAR EL PARTICIPANTE TextField nombre = new TextField("Nombre"); nombre.setValue(p.getNombre()); final Button eliminar = new Button("Eliminar Participante"); final Button actualizar = new Button("Actualizar Participante"); //BOTN PARA ACTUALIZAR EL PARTICIPANTE actualizar.addClickListener(clickEvent -> { if (ParticipanteDAO.read(nombre.getValue(), usuario.getId()) == null) { ParticipanteDAO.update(p.getId(), nombre.getValue()); UsuarioDAO.updateAmigo(nombre.getValue(), p.getId(), usuario.getId()); Notification n = new Notification("Amigo actualizado", Notification.Type.ASSISTIVE_NOTIFICATION); n.setPosition(Position.TOP_CENTER); n.show(Page.getCurrent()); removeAllComponents(); mostrarAmistades(); } else { Notification n = new Notification("Ya existe un amigo con el mismo nombre", Notification.Type.WARNING_MESSAGE); n.setPosition(Position.TOP_CENTER); n.show(Page.getCurrent()); } }); //BOTN PARA ELIMINAR EL PARTICIPANTE eliminar.addClickListener(clickEvent -> { ParticipanteDAO.delete(p.getId()); UsuarioDAO.removeAmigo(nombre.getValue(), usuario.getId()); removeAllComponents(); mostrarAmistades(); }); //AADIMOS LOS COMPONENTES FormLayout form = new FormLayout(nombre, actualizar, eliminar); VerticalLayout l = new VerticalLayout(form); l.setMargin(true); setSecondComponent(l); }