Win32ShellFolderManager2.java revision 0
91N/A * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved. 91N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 91N/A * This code is free software; you can redistribute it and/or modify it 91N/A * under the terms of the GNU General Public License version 2 only, as 91N/A * published by the Free Software Foundation. Sun designates this 91N/A * particular file as subject to the "Classpath" exception as provided 91N/A * by Sun in the LICENSE file that accompanied this code. 91N/A * This code is distributed in the hope that it will be useful, but WITHOUT 91N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 91N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 91N/A * version 2 for more details (a copy is included in the LICENSE file that 91N/A * accompanied this code). * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * CA 95054 USA or visit www.sun.com if you need additional information or // NOTE: This class supersedes Win32ShellFolderManager, which was removed // from distribution after version 1.4.2. * @author Leif Samuelsson * @author Kenneth Russell // Shouldn't happen but watch for it anyway // Walk down this relative pIDL, creating new nodes for each of the entries // The list is empty if the parent is Desktop and pIDL is a shortcut to Desktop * @param key a <code>String</code> * "fileChooserDefaultFolder": * Returns a <code>File</code> - the default shellfolder for a new filechooser * Returns a <code>File[]</code> - containing the root(s) of the displayable hierarchy * "fileChooserComboBoxFolders": * Returns a <code>File[]</code> - an array of shellfolders representing the list to * show by default in the file chooser's combobox * "fileChooserShortcutPanelFolders": * Returns a <code>File[]</code> - an array of shellfolders representing well-known * folders, such as Desktop, Documents, History, Network, Home, etc. * This is used in the shortcut panel of the filechooser on Windows 2000 * Returns an <code>Image</code> - icon nn from resource 216 in shell32.dll, * or if not found there from resource 124 in comctl32.dll (Windows only). * "optionPaneIcon iconName": * Returns an <code>Image</code> - icon from the system icon list * @return An Object matching the key string. if (
key.
equals(
"fileChooserDefaultFolder")) {
// Should be "History" and "Desktop" ? }
else if (
key.
equals(
"fileChooserComboBoxFolders")) {
// Add all second level folders // Add third level for "My Computer" }
else if (
key.
equals(
"fileChooserShortcutPanelFolders")) {
// Use default list of places if (
key ==
"optionPaneIcon Error") {
}
else if (
key ==
"optionPaneIcon Information") {
}
else if (
key ==
"optionPaneIcon Question") {
}
else if (
key ==
"optionPaneIcon Warning") {
* Does <code>dir</code> represent a "computer" such as a node on the network, or * "My Computer" on the desktop. //Note: Removable drives don't "exist" but are listed in "My Computer" if (
i1 >=
0 &&
i2 >=
0) {
// Non-file shellfolders sort before files // First ignore case when comparing // May differ in case (e.g. "mail" vs. "Mail") // We need this test for consistent sorting