/** * Shows a notification message. * * @see Notification * * @param notification * The notification message to show * * @deprecated As of 7.0, use Notification.show(Page) instead. */ @Deprecated public void showNotification(Notification notification) { notification.show(this); }
@Override public void failure(String reason) { Notification.show("Event file " + file + " cannot be saved" + (reason == null ? "." : ", because: " + reason), Notification.Type.ERROR_MESSAGE); } };
/** * Show notification that the user is already loogged in.<p> */ public void showAlreadyLoggedIn() { // TODO: do something useful Notification.show("You are already logged in"); }
/** * Shows a validation error to the user. * * @param errorMessage * the error message. */ public static void showValidationError(String errorMessage) { Notification.show("Validation Error", errorMessage != null ? errorMessage : "An unknown error occured.", Type.WARNING_MESSAGE); } }
@Override public void failure(String reason) { String msg = reason == null ? "." : ", because" + reason; Notification.show("Data collection group file " + file.getName() + " cannot be saved" + msg, Notification.Type.ERROR_MESSAGE); } };
@Override public void success() { Notification.show("Event file " + file + " has been successfuly saved."); this.setVisible(false); } @Override
@Override public void afterCommit() { VaadinUtil.invoke(vaadinSession, () -> Notification.show((JObjectEditorWindow.this.create ? "Created" : "Updated") + " object " + id)); } });
public void buttonClick(ClickEvent event) { try { m_model.saveAsPropertyBundle(); Notification.show("Conversion successful."); } catch (CmsException | IOException e) { CmsVaadinUtils.showAlert("Conversion failed", e.getLocalizedMessage(), null); } } });
@Handler @Override public void informationMessage(InformationNotificationMessage message) { log.debug("Received information message '{}'", message); String s = message.getTranslatedMessage(); Notification.show(s, Notification.Type.HUMANIZED_MESSAGE); } }
public void buttonClick(ClickEvent event) { replayService.cancel(); executorService.shutdown(); bar.setVisible(false); cancelButton.setVisible(false); Notification.show("Replay cancelled!"); } });
public void buttonClick(ClickEvent event) { replayService.cancel(); executorService.shutdown(); bar.setVisible(false); cancelButton.setVisible(false); Notification.show("Replay cancelled!"); } });
private void newButtonClicked() { final JClass<?> jclass = this.objectChooser.getJClass(); if (jclass == null) { Notification.show("Can't create object having unknown type", "Please select an object type first", Notification.Type.WARNING_MESSAGE); return; } this.log.info("creating new object of type " + jclass.getType().getName()); new JObjectEditorWindow(this.getUI(), this.session, jclass).show(); }
private void newButtonClicked() { final JClass<?> jclass = this.objectChooser.getJClass(); if (jclass == null) { Notification.show("Can't create object having unknown type", "Please select an object type first", Notification.Type.WARNING_MESSAGE); return; } this.log.info("creating new object of type " + jclass.getType().getName()); new JObjectEditorWindow(this.getUI(), this.session, jclass).show(); }
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 void windowClose(CloseEvent e) { if((IkasanAuthentication)VaadinService.getCurrentRequest().getWrappedSession() .getAttribute(DashboardSessionValueConstants.USER) == null) { Notification.show("You cannot access this page!", Type.ERROR_MESSAGE); //Redirect the user to the login/default Page Page.getCurrent().setLocation("/ikasan-dashboard"); } } });
public void windowClose(CloseEvent e) { if((IkasanAuthentication)VaadinService.getCurrentRequest().getWrappedSession() .getAttribute(DashboardSessionValueConstants.USER) == null) { UI.getCurrent().getNavigator().navigateTo("landingView"); Notification.show("You cannot view this error!", Type.ERROR_MESSAGE); } } });
public void windowClose(CloseEvent e) { if((IkasanAuthentication)VaadinService.getCurrentRequest().getWrappedSession() .getAttribute(DashboardSessionValueConstants.USER) == null) { UI.getCurrent().getNavigator().navigateTo("landingView"); Notification.show("You cannot access this page!", Type.ERROR_MESSAGE); } } });
public void dialog2() { // tag::dialog2[] Components.questionDialog() // <1> .message("Can I do it for you?") // <2> .yesButtonConfigurator(cfg -> cfg.caption("Ok, let's do it")) // <3> .noButtonConfigurator(cfg -> cfg.caption("No, thanks")) // <4> .callback(answeredYes -> { // <5> Notification.show("Ok selected: " + answeredYes); }).build().open(); // <6> // end::dialog2[] }
public void dialog2() { // tag::dialog2[] Components.questionDialog() // <1> .message("Can I do it for you?") // <2> .yesButtonConfigurator(cfg -> cfg.caption("Ok, let's do it")) // <3> .noButtonConfigurator(cfg -> cfg.caption("No, thanks")) // <4> .callback(answeredYes -> { // <5> Notification.show("Ok selected: " + answeredYes); }).build().open(); // <6> // end::dialog2[] }