void (final int index, NavBarItem component) { DnDSupport.createBuilder(component) .setBeanProvider(dnDActionInfo -> new DnDDragStartBean(new TransferableWrapper() { @Override public List<File> asFileList() { Object o = myModel.get(index); if (o instanceof PsiElement) { VirtualFile vf = o instanceof PsiDirectory ? ((PsiDirectory)o).getVirtualFile() : ((PsiElement)o).getContainingFile().getVirtualFile(); if (vf != null) { return Collections.singletonList(new File(vf.getPath()).getAbsoluteFile()); } } return Collections.emptyList(); } @Override public TreeNode[] getTreeNodes() { return null; } @Override public PsiElement[] getPsiElements() { return null; } })) .setDisposableParent(component) .install(); }