boolean (final List<? extends PackagingElementNode<?>> nodes) { Set<PackagingNodeSource> rootSources = new HashSet<>(); for (PackagingElementNode<?> node : nodes) { rootSources.addAll(getRootNodeSources(node.getNodeSources())); } if (!rootSources.isEmpty()) { final String name = rootSources.iterator().next().getPresentableName(); final String message = JavaUiBundle.message("layout.tree.check.can.remove.dialog.message", name, rootSources.size()); final int answer = Messages.showYesNoDialog(myArtifactsEditor.getMainComponent(), message, JavaUiBundle.message( "dialog.title.remove.elements"), null); if (answer != Messages.YES) return false; } return true; }