boolean (@NotNull Collection<String> dependencies, @NotNull PluginEnableDisableAction action) { int size = dependencies.size(); if (size == 0) { return true; } boolean hasOnlyOneDependency = size == 1; String key = switch (action) { case ENABLE_GLOBALLY -> hasOnlyOneDependency ? "dialog.message.enable.required.plugin" : "dialog.message.enable.required.plugins"; case DISABLE_GLOBALLY -> hasOnlyOneDependency ? "dialog.message.disable.dependent.plugin" : "dialog.message.disable.dependent.plugins"; }; String dependenciesText = hasOnlyOneDependency ? dependencies.iterator().next() : dependencies.stream() .map("&nbsp;".repeat(5)::concat) .collect(Collectors.joining("<br>")); boolean enabled = action.isEnable(); return MessageDialogBuilder .okCancel(IdeBundle.message(enabled ? "dialog.title.enable.required.plugins" : "dialog.title.disable.dependent.plugins"), IdeBundle.message(key, dependenciesText)) .yesText(IdeBundle.message(enabled ? "plugins.configurable.enable" : "plugins.configurable.disable")) .noText(Messages.getCancelButton()) .ask(getProject()); }