void (@NotNull String text) { List<NotificationInfo> notifications = new ArrayList<>(); NotificationInfo notification = null; for (String line : StringUtil.splitByLines(text, false)) { if (line.length() == 0) { if (notification != null) { notification = null; continue; } } if (line.startsWith("//")) { continue; } if (line.startsWith("--")) { break; } if (notification == null) { notification = new NotificationInfo(); notifications.add(notification); } if (line.startsWith("Icon:")) { notification.setIcon(StringUtil.substringAfter(line, ":")); } else if (line.startsWith("Title:")) { notification.setTitle(StringUtil.substringAfter(line, ":")); } else if (line.startsWith("Content:")) { String value = StringUtil.substringAfter(line, ":"); if (value != null) { notification.addContent(value); } } else if (line.startsWith("Subtitle:")) { notification.setSubtitle(StringUtil.substringAfter(line, ":")); } else if (line.startsWith("Help:")) { notification.setHelp(StringUtil.substringAfter(line, ":")); } else if (line.startsWith("Actions:")) { String value = StringUtil.substringAfter(line, ":"); if (value != null) { notification.setActions(StringUtil.split(value, ",")); } } else if (line.startsWith("Type:")) { notification.setType(StringUtil.substringAfter(line, ":")); } else if (line.startsWith("LaterId:")) { notification.setRemindLaterHandlerId(StringUtil.substringAfter(line, ":")); } else if (line.equals("Suggestion")) { notification.setSuggestionType(true); } else if (line.equals("ImportantSuggestion")) { notification.setImportantSuggestion(true); } else if (line.equals("Sticky")) { notification.setSticky(true); } else if (line.equals("Listener")) { notification.setAddListener(true); } else if (line.equals("Toolwindow")) { notification.setToolwindow(true); } else if (line.equals("RightCollapseActions")) { notification.myLeftActionsDirection = false; } } ApplicationManager.getApplication().executeOnPooledThread(() -> { for (NotificationInfo info : notifications) { myMessageBus.syncPublisher(Notifications.TOPIC).notify(info.getNotification()); } }); }