BorderLayoutPanel (@NotNull JLabel label, @NotNull JTree tree) { BorderLayoutPanel panel = JBUI.Panels.simplePanel(); panel.setBackground(UIUtil.getTextFieldBackground()); panel.addToTop(label).addToCenter(tree); new EditSourceAction().registerCustomShortcutSet(CommonShortcuts.getEditSource(), panel); DataManager.registerDataProvider(panel, dataId -> { if (CommonDataKeys.NAVIGATABLE_ARRAY.is(dataId)) { JBIterable<VirtualFile> files = JBIterable.of(tree.getSelectionPaths()) .map(TreePath::getLastPathComponent) .map(node -> (ChangesBrowserNode<?>)node) .flatMap(ChangesBrowserNode::iterateFilePathsUnder) .map(FilePath::getVirtualFile) .filter(Objects::nonNull) .unique(); return getNavigatableArray(myProject, files); } return null; }); return panel; }