mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-105580 (delay file system roots loading in file chooser)
This commit is contained in:
@@ -30,17 +30,21 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class RootFileElement extends FileElement {
|
||||
private final VirtualFile[] myFiles;
|
||||
private VirtualFile[] myFiles;
|
||||
private Object[] myChildren;
|
||||
|
||||
public RootFileElement(@NotNull final VirtualFile[] files, final String name, final boolean showFileSystemRoots) {
|
||||
public RootFileElement(@NotNull VirtualFile[] files, String name, boolean showFileSystemRoots) {
|
||||
super(files.length == 1 ? files[0] : null, name);
|
||||
myFiles = files.length == 0 && showFileSystemRoots ? getFileSystemRoots() : files;
|
||||
myFiles = files.length == 0 && showFileSystemRoots ? null : files;
|
||||
}
|
||||
|
||||
public Object[] getChildren() {
|
||||
if (myChildren == null) {
|
||||
final List<FileElement> children = new ArrayList<FileElement>();
|
||||
if (myFiles == null) {
|
||||
myFiles = getFileSystemRoots();
|
||||
}
|
||||
|
||||
List<FileElement> children = new ArrayList<FileElement>();
|
||||
for (final VirtualFile file : myFiles) {
|
||||
if (file != null) {
|
||||
children.add(new FileElement(file, file.getPresentableUrl()));
|
||||
|
||||
Reference in New Issue
Block a user