roots = (File[])super.get(key);
}
}
return roots;
} else if (key.equals("fileChooserComboBoxFolders")) {
Win32ShellFolder2 desktop = getDesktop();
if (desktop != null) {
ArrayList<File> folders = new ArrayList<File>();
Win32ShellFolder2 drives = getDrives();
Win32ShellFolder2 recentFolder = getRecent();
if (recentFolder != null && OSInfo.getWindowsVersion().compareTo(OSInfo.WINDOWS_2000) >= 0) {
folders.add(recentFolder);
}
folders.add(desktop);
// Add all second level folders
File[] secondLevelFolders = desktop.listFiles();
Arrays.sort(secondLevelFolders);
for (File secondLevelFolder : secondLevelFolders) {
Win32ShellFolder2 folder = (Win32ShellFolder2) secondLevelFolder;
if (!folder.isFileSystem() || folder.isDirectory()) {
folders.add(folder);
// Add third level for "My Computer"
if (folder.equals(drives)) {
File[] thirdLevelFolders = folder.listFiles();
if (thirdLevelFolders != null) {
Arrays.sort(thirdLevelFolders, driveComparator);
for (File thirdLevelFolder : thirdLevelFolders) {
folders.add(thirdLevelFolder);
}
}
}
}
}
return folders.toArray(new File[folders.size()]);
} else {
return super.get(key);
}
} else if (key.equals("fileChooserShortcutPanelFolders")) {
Toolkit toolkit = Toolkit.getDefaultToolkit();
ArrayList<File> folders = new ArrayList<File>();
int i = 0;
Object value;
do {
value = toolkit.getDesktopProperty("win.comdlg.placesBarPlace" + i++);
try {
if (value instanceof Integer) {
// A CSIDL
folders.add(new Win32ShellFolder2((Integer)value));
} else if (value instanceof String) {
// A path
folders.add(createShellFolder(new File((String)value)));
}
} catch (IOException e) {