@Override protected void doHandle(String className, String message, @Nullable Throwable throwable, WindowManager windowManager) { windowManager.showNotification(message, Frame.NotificationType.ERROR); } }
@Override protected void doHandle(String className, String message, @Nullable Throwable throwable, WindowManager windowManager) { String msg = messages.getMessage(getClass(), "accessDenied.message"); windowManager.showNotification(msg, Frame.NotificationType.ERROR); }
@Override protected void doHandle(String className, String message, @Nullable Throwable throwable, WindowManager windowManager) { String msg = messages.getMessage(LuceneIndexNotFoundExceptionHandler.class, "indexNotFound.msg"); windowManager.showNotification(msg, Frame.NotificationType.ERROR); } }
protected void doHandle(WindowManager windowManager) { String msg = messages.formatMessage(getClass(), "mssqlDateOutOfRangeException.message"); windowManager.showNotification(msg, Frame.NotificationType.WARNING); } }
@Override protected void doHandle(String className, String message, @Nullable Throwable throwable, WindowManager windowManager) { String msg = messages.getMessage(getClass(), "noSuchScreen.message"); windowManager.showNotification(msg, throwable != null ? throwable.getMessage() : null, Frame.NotificationType.ERROR); }
/** * Show notification with {@link Frame.NotificationType#HUMANIZED}. <br> * Supports line breaks ({@code \n}). * * @param caption notification text * * @deprecated Use {@link Notifications} bean instead. */ @Deprecated default void showNotification(String caption) { getWindowManager().showNotification(caption); }
@Override protected void doHandle(String className, String message, @Nullable Throwable throwable, WindowManager windowManager) { String msg = messages.formatMessage(getClass(), "entityAccessException.message"); windowManager.showNotification(msg, Frame.NotificationType.WARNING); } }
@Override protected void doHandle(String className, String message, @Nullable Throwable throwable, WindowManager windowManager) { String msg = "It usually occurs when the attribute is not included into a view"; String defaultMsg = "\n\nSee the log to find out what attribute caused the exception"; if (throwable != null) { Matcher matcher = PATTERN.matcher(ExceptionUtils.getStackTrace(throwable)); if (matcher.find()) { msg += "\n\nEntity: " + matcher.group(1) + "\nAttribute: " + matcher.group(2); } else { msg += defaultMsg; } } else { msg += defaultMsg; } windowManager.showNotification("Unfetched attribute access error", msg, Frame.NotificationType.ERROR); } }
/** * Show notification. <br> * Supports line breaks ({@code \n}) for non HTML type. * * @param caption notification text * @param type defines how to display the notification. * Don't forget to escape data from the database in case of {@code *_HTML} types! * * @deprecated Use {@link Notifications} bean instead. */ @Deprecated default void showNotification(String caption, Frame.NotificationType type) { getWindowManager().showNotification(caption, type); }
/** * Show notification with caption and description. <br> * Supports line breaks ({@code \n}) for non HTML type. * * @param caption notification text * @param description notification description * @param type defines how to display the notification. * Don't forget to escape data from the database in case of {@code *_HTML} types! * * @deprecated Use {@link Notifications} bean instead. */ @Deprecated default void showNotification(String caption, String description, Frame.NotificationType type) { getWindowManager().showNotification(caption, description, type); }
@Override protected void doHandle(String className, String message, @Nullable Throwable throwable, WindowManager windowManager) { Messages messages = AppBeans.get(Messages.NAME); String msg = messages.getMessage(getClass(), "numericFieldOverflow.message"); windowManager.showNotification(msg, Frame.NotificationType.ERROR); } }
@Override protected void doHandle(String className, String message, @Nullable Throwable throwable, WindowManager wm) { if (throwable == null) { return; } Set<ConstraintViolation<?>> violations = ((ConstraintViolationException) throwable).getConstraintViolations(); log.error("Service has thrown validation exception. Violations: {}", violations, throwable); String msg = messages.formatMessage(ServiceCallValidationExceptionHandler.class, "serviceCallValidationViolation.message"); wm.showNotification(msg, NotificationType.ERROR); } }
protected void showParseExceptionNotification(String message) { WindowManager wm = AppBeans.get(WindowManagerProvider.class).get(); wm.showNotification(message, Frame.NotificationType.TRAY); }
protected void showNotification(App app, Throwable exception) { Throwable rootCause = ExceptionUtils.getRootCause(exception); if (rootCause == null) { rootCause = exception; } WindowManager windowManager = app.getWindowManager(); if (windowManager != null) { windowManager.showNotification( messages.getMainMessage("exceptionDialog.caption", app.getLocale()), rootCause.getClass().getSimpleName() + (rootCause.getMessage() != null ? "\n" + rootCause.getMessage() : ""), Frame.NotificationType.ERROR ); } } }
@Override protected void doHandle(String className, String message, @Nullable Throwable throwable, WindowManager windowManager) { Pattern pattern = Pattern.compile("Class> (.+)"); Matcher matcher = pattern.matcher(message); String entityClassName = ""; if (matcher.find()) { entityClassName = matcher.group(1); } String msg; if (entityClassName.contains(".")) { String entityName = entityClassName.substring(entityClassName.lastIndexOf(".") + 1); String packageName = entityClassName.substring(0, entityClassName.lastIndexOf(".")); String localizedEntityName = messages.getMessage(packageName, entityName); msg = messages.formatMessage(messages.getMainMessagePack(), "optimisticException.message", "\"" + localizedEntityName + "\""); } else { msg = messages.getMessage(messages.getMainMessagePack(), "optimisticExceptionUnknownObject.message"); } windowManager.showNotification(msg, Frame.NotificationType.ERROR); }
@Override protected void doHandle(String className, String message, @Nullable Throwable throwable, WindowManager windowManager) { String msg = null; if (throwable != null) { FileStorageException storageException = (FileStorageException) throwable; String fileName = storageException.getFileName(); if (storageException.getType().equals(FileStorageException.Type.FILE_NOT_FOUND)) msg = messages.formatMessage(getClass(), "fileNotFound.message", fileName); else if (storageException.getType().equals(FileStorageException.Type.STORAGE_INACCESSIBLE)) msg = messages.getMessage(getClass(), "fileStorageInaccessible.message"); } if (msg == null) { msg = messages.getMessage(getClass(), "fileStorageException.message"); } windowManager.showNotification(msg, Frame.NotificationType.ERROR); } }
protected void doHandle(String message, WindowManager windowManager) { String caption = null; String notificationMessage = null; MetaClass deletedEntityMetaClass = recognizeDeletedEntityMetaClass(message); if (deletedEntityMetaClass != null) { String customCaptionKey = String.format("deletePolicy.caption.%s", deletedEntityMetaClass.getName()); String customCaption = messages.getMainMessage(customCaptionKey); if (!customCaptionKey.equals(customCaption)) { caption = customCaption; } String customMessageKey = String.format("deletePolicy.references.message.%s", deletedEntityMetaClass.getName()); String customMessage = messages.getMainMessage(customMessageKey); if (!customMessageKey.equals(customMessage)) { notificationMessage = customMessage; } } if (StringUtils.isEmpty(caption)) { caption = messages.getMainMessage("deletePolicy.caption"); } if (StringUtils.isEmpty(notificationMessage)) { MetaClass metaClass = recognizeRelatedEntityMetaClass(message); if (metaClass != null) { String localizedEntityName = messages.getTools().getEntityCaption(metaClass); String referencesMessage = messages.getMainMessage("deletePolicy.references.message"); notificationMessage = String.format(referencesMessage, localizedEntityName); } } windowManager.showNotification(caption, notificationMessage, Frame.NotificationType.ERROR); }
wm.showNotification( messages.getMessage(ReportGuiManager.class, "report.notFoundReports"), Frame.NotificationType.HUMANIZED);
_setValue(UUID.fromString(strValue), valueProperty); } catch (IllegalArgumentException ie) { AppBeans.get(WindowManagerProvider.class).get().showNotification(messages1.getMainMessage("filter.param.uuid.Err"), Frame.NotificationType.TRAY);
@Override public void handleAction(com.vaadin.event.Action action, Object sender, Object target) { if (initialized) { if (saveSettingsAction == action) { Screen screen = getFrameOwner(); UiControllerUtils.saveSettings(screen); } else if (restoreToDefaultsAction == action) { Screen screen = getFrameOwner(); UiControllerUtils.deleteSettings(screen); } else if (analyzeAction == action) { LayoutAnalyzer analyzer = new LayoutAnalyzer(); List<LayoutTip> tipsList = analyzer.analyze(WebDialogWindow.this); if (tipsList.isEmpty()) { getWindowManager().showNotification("No layout problems found", Frame.NotificationType.HUMANIZED); } else { WindowConfig windowConfig = beanLocator.get(WindowConfig.NAME); WindowInfo windowInfo = windowConfig.getWindowInfo("layoutAnalyzer"); getWindowManager().openWindow(windowInfo, WindowManager.OpenType.DIALOG, ParamsMap.of("tipsList", tipsList)); } } } } }