* @param children the current folder's children
*/
synchronized void setCurrentFolder(AbstractFile folder, AbstractFile children[]) {
int nbFiles = children.length;
this.currentFolder = (folder instanceof CachedFile)?folder:new CachedFile(folder, true);
this.parent = currentFolder.getParent(); // Note: the returned parent is a CachedFile instance
if(parent!=null) {
// Pre-fetch the attributes that are used by the table renderer and some actions.
prefetchCachedFileAttributes(parent);
}
// Initialize file indexes and create CachedFile instances to speed up table display and navigation
this.cachedFiles = children;
this.fileArrayIndex = new int[nbFiles];
AbstractFile file;
for(int i=0; i<nbFiles; i++) {
file = new CachedFile(children[i], true);
// Pre-fetch the attributes that are used by the table renderer and some actions.
prefetchCachedFileAttributes(file);
cachedFiles[i] = file;