Java Code Examples for com.vaadin.ui.Notification#show()
The following examples show how to use
com.vaadin.ui.Notification#show() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ErrorView.java From hawkbit with Eclipse Public License 1.0 | 6 votes |
@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())); } }
Example 2
Source File: MyAccount.java From jpa-invoicer with The Unlicense | 6 votes |
public void save(Invoicer entity) { try { if (entity.getId() == null) { cf.save(entity); session.getUser().getAdministrates().add(entity); } else { cf.save(entity); } Notification.show("Saved!"); } catch (Exception e) { Notification.show("Saving failed!", "Most probably concurrently edited", Notification.Type.WARNING_MESSAGE); } listEntities(); form.getPopup().close(); }
Example 3
Source File: MultiSelectTableWithStringCollection.java From viritin with Apache License 2.0 | 6 votes |
@Override public Component getTestComponent() { strings.setOptions(Arrays.asList(options)); strings.withColumnHeaderMode(Table.ColumnHeaderMode.HIDDEN); strings.withRowHeaderMode(Table.RowHeaderMode.ID); strings.withProperties(); final Beani beani = new Beani(); MBeanFieldGroup.bindFieldsUnbuffered(beani, this); Button showValue = new Button("show value", new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { Notification.show(beani.toString()); } }); return new MVerticalLayout(strings, showValue); }
Example 4
Source File: MultiFileUpload.java From mycollab with GNU Affero General Public License v3.0 | 5 votes |
public void onMaxSizeExceeded(long contentLength) { Notification.show( "Max size exceeded " + FileUtils.byteCountToDisplaySize(contentLength) + " > " + FileUtils.byteCountToDisplaySize(maxFileSize), Notification.Type.ERROR_MESSAGE); }
Example 5
Source File: MainLayout.java From Vaadin4Spring-MVP-Sample-SpringSecurity with Apache License 2.0 | 5 votes |
@EventBusListenerMethod public void onAccessDenied(org.vaadin.spring.events.Event<AccessDeniedEvent> event) { //TODO Redirect to login, if (event.getPayload().getCause() != null) { Notification.show("Access is denied.", "Service can be invoked only by Admin users.", Type.ERROR_MESSAGE); } else { if (event.getPayload().getViewToken().equals(ViewToken.USER)) { Notification.show("Access is denied.", "You must sign in before accessing User home.", Type.ERROR_MESSAGE); } else { Notification.show("Access is denied.", "You must sign in as Admin user before accessing Admin home.", Type.ERROR_MESSAGE); } } }
Example 6
Source File: ContractApplicationChangeViewImplEx.java From vaadinator with Apache License 2.0 | 5 votes |
@Override public void onValidationError(Map<Field<?>, InvalidValueException> validationErrors) { super.onValidationError(validationErrors); StringBuilder sb = new StringBuilder(); for(Field<?> field: validationErrors.keySet()) { if(sb.length()!= 0) { sb.append(", "); } sb.append(field.getCaption()); } Notification.show("Fehler in folgenden Feldern:", sb.toString(), Notification.Type.ERROR_MESSAGE); }
Example 7
Source File: DemoUI.java From gantt with Apache License 2.0 | 5 votes |
private void showNotificationWithMousedetails(String msg, MouseEventDetails details) { String detailsTxt = ""; if (details.isCtrlKey()) { detailsTxt = "(Ctrl down) "; } Notification.show(detailsTxt + msg, Type.TRAY_NOTIFICATION); }
Example 8
Source File: UiInstanceErrorHandler.java From cia with Apache License 2.0 | 5 votes |
@Override public void error(final ErrorEvent event) { if (ExceptionUtils.getRootCause(event.getThrowable()) instanceof AccessDeniedException) { final AccessDeniedException accessDeniedException = (AccessDeniedException) ExceptionUtils.getRootCause(event.getThrowable()); Notification.show(accessDeniedException.getMessage(), Notification.Type.ERROR_MESSAGE); ui.getNavigator().navigateTo(CommonsViews.MAIN_VIEW_NAME); } else { LOGGER.warn(LOG_WARN_VAADIN_ERROR, event.getThrowable()); } }
Example 9
Source File: GroupsView.java From jpa-addressbook with The Unlicense | 5 votes |
public void entrySaved(PhoneBookGroup value) { try { service.save(value); form.setVisible(false); } catch (Exception e) { Notification.show("Saving entity failed due to " + e. getLocalizedMessage(), Notification.Type.WARNING_MESSAGE); } // deselect the entity entryList.asSingleSelect().setValue(null); // refresh list listEntries(); }
Example 10
Source File: PolicyWorkspace.java From XACML with MIT License | 5 votes |
@Override public void drop(DragAndDropEvent event) { Transferable t = event.getTransferable(); Component source = t.getSourceComponent(); if (source != this.treeWorkspace) { assert(false); throw new IllegalArgumentException(); } TableTransferable tt = (TableTransferable) t; File sourceFile = (File) tt.getItemId(); AbstractSelectTargetDetails target = (AbstractSelectTargetDetails)event.getTargetDetails(); File targetFile = (File) target.getItemIdOver(); if (sourceFile.isFile() && targetFile != null && targetFile.isDirectory()) { // // Construct destination filename // Path dest = targetFile.toPath().resolve(sourceFile.getName()); // // Check if the target domain exists // if (Files.exists(dest)) { // // Prompt the user // Notification.show("A policy file with that name already exists in that directory.", Notification.Type.ERROR_MESSAGE); } else { // // Go ahead and rename it // this.renamePolicyFile(sourceFile, dest.toFile(), targetFile); } } }
Example 11
Source File: MapFieldTest.java From viritin with Apache License 2.0 | 4 votes |
@Override public Component getTestComponent() { mapField.setCaption("String->Double"); stringToInt.setCaption("Strint->Integer"); stringToString.setCaption("Strint->String"); TestClass bean = new TestClass(); bean.getMapField().put("first", 1.0); BeanBinder.bind(bean, this); Button button = new Button("Show value", e -> { Notification.show(bean.toString()); }); return new MVerticalLayout(mapField, stringToInt, stringToString, button); }
Example 12
Source File: CommonAfterCancelListener.java From vaadinator with Apache License 2.0 | 4 votes |
@Override public void afterCancel(Object entity) { Notification.show("Abgebrochen"); }
Example 13
Source File: ElementPropertySetterTest.java From viritin with Apache License 2.0 | 4 votes |
@Override public void valueChange(Property.ValueChangeEvent event) { Notification.show(event.getProperty().getValue().toString()); }
Example 14
Source File: MButtonClickListeners.java From viritin with Apache License 2.0 | 4 votes |
public void sayHolaOldSchool(ClickEvent e) { Notification.show("Hola oldschool fellow!", Notification.Type.TRAY_NOTIFICATION); }
Example 15
Source File: CommonAfterSaveListener.java From vaadinator with Apache License 2.0 | 4 votes |
@Override public void afterSave(Object entity) { Notification.show("Gespeichert"); }
Example 16
Source File: CommonAfterCancelListener.java From vaadinator with Apache License 2.0 | 4 votes |
@Override public void afterCancel(Object entity) { Notification.show("Abgebrochen"); }
Example 17
Source File: InvoicesView.java From jpa-invoicer with The Unlicense | 4 votes |
public void save(Invoice entity) { facade.save(entity); Notification.show("Saved!"); form.getPopup().close(); listEntities(); }
Example 18
Source File: MultiFileUpload.java From mycollab with GNU Affero General Public License v3.0 | 4 votes |
public void onFileTypeMismatch() { Notification.show("File type mismatch, accepted: " + acceptString, Notification.Type.ERROR_MESSAGE); }
Example 19
Source File: MultiFileUpload.java From mycollab with GNU Affero General Public License v3.0 | 4 votes |
public void onFileCountExceeded() { Notification.show("File count exceeded", Notification.Type.ERROR_MESSAGE); }
Example 20
Source File: MeetingCalendar.java From calendar-component with Apache License 2.0 | 3 votes |
private void onCalendarClick(CalendarComponentEvents.ItemClickEvent event) { MeetingItem item = (MeetingItem) event.getCalendarItem(); final Meeting meeting = item.getMeeting(); Notification.show(meeting.getName(), meeting.getDetails(), Type.HUMANIZED_MESSAGE); }