Hello Tatu
Thanks for all your help so far. I have few questions for you which will really help us to launch a global solution
Firstly this is the code we have got to list all the drives in our computers in tree format. I have also used Multi selection mode so that user can select the folders and files which needs to be backed up. The problem is sometime when a folder has large number of items , the UI gets really struck when i select the parent folder. Is there a solution for the same. I just need the file paths from the tree to process by backend job of backup. But why the selection of folders with so many files take this much time.
This is my code
List<File> rootFiles = new ArrayList<>();
File[] drives = File.listRoots();
if (drives != null && drives.length > 0) {
for (File aDrive : drives) {
rootFiles.add(aDrive);
}
}
if(rootFiles == null || rootFiles.size() == 0){
return null;
}
File rootBase = rootFiles.get(0);
FilesystemData root = new FilesystemData(rootBase, false);
rootFiles.remove(0);
FilesystemDataProvider fileSystem = new FilesystemDataProvider(root);
for(File aRoot: rootFiles) {
fileSystem.getTreeData().addRootItems(aRoot);
}
fileSystem.refreshAll();
TreeGrid<File> tree = new RecursiveSelectTreeGrid<>();
tree.setDataProvider(fileSystem);
tree.addHierarchyColumn(file -> file.getName()).setHeader("Name");
tree.setSelectionMode(Grid.SelectionMode.MULTI);
tree.setWidth("750px");
tree.setHeight("500px");
setSizeFull();
return tree;
Secondly i want colorful icons for my tree elements or items. How can i acheive it?
Thirdly, the code above does not display the root folders names i.e. C:. D:. Just a arrow to expand it. Below is a screenshot