void (@NotNull AnActionEvent e) { final List<PackagingSourceItem> items = mySourceItemsTree.getSelectedItems(); boolean enabled = false; final Presentation presentation = e.getPresentation(); if (!items.isEmpty()) { enabled = true; Set<String> paths = new HashSet<>(); for (PackagingSourceItem item : items) { final String path = getDefaultPath(item); if (path == null) { enabled = false; break; } paths.add(StringUtil.trimStart(StringUtil.trimEnd(path, "/"), "/")); } presentation.setText(JavaUiBundle.message("action.text.put.source.item.into.0", getTargetLocationText(paths))); } presentation.setEnabledAndVisible(enabled); }