/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
// NOTE: This class supersedes Win32ShellFolderManager, which was removed
// from distribution after version 1.4.2.
/**
* @author Michael Martak
* @author Leif Samuelsson
* @author Kenneth Russell
* @since 1.4
*/
static {
// Load library here
}
try {
} catch (InterruptedException e) {
throw new FileNotFoundException("Execution was interrupted");
}
}
throws FileNotFoundException, InterruptedException {
long pIDL;
try {
} catch (IOException ex) {
pIDL = 0;
}
if (pIDL == 0) {
// Shouldn't happen but watch for it anyway
}
try {
} finally {
}
}
throws InterruptedException {
// Walk down this relative pIDL, creating new nodes for each of the entries
while (pIDL != 0) {
if (curPIDL != 0) {
} else {
// The list is empty if the parent is Desktop and pIDL is a shortcut to Desktop
break;
}
}
return parent;
}
return result;
}
return img;
}
// Special folders
try {
} catch (IOException e) {
// Ignore error
} catch (InterruptedException e) {
// Ignore error
}
}
return desktop;
}
try {
} catch (IOException e) {
// Ignore error
} catch (InterruptedException e) {
// Ignore error
}
}
return drives;
}
try {
}
} catch (InterruptedException e) {
// Ignore error
} catch (IOException e) {
// Ignore error
}
}
return recent;
}
try {
} catch (IOException e) {
// Ignore error
} catch (InterruptedException e) {
// Ignore error
}
}
return network;
}
try {
}
}
}
} catch (InterruptedException e) {
// Ignore error
} catch (IOException e) {
// Ignore error
}
}
return personal;
}
/**
* @param key a <code>String</code>
* "fileChooserDefaultFolder":
* Returns a <code>File</code> - the default shellfolder for a new filechooser
* "roots":
* 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
* and Windows Me.
* "fileChooserIcon <icon>":
* Returns an <code>Image</code> - icon can be ListView, DetailsView, UpFolder, NewFolder or
* ViewMenu (Windows only).
* "optionPaneIcon iconName":
* Returns an <code>Image</code> - icon from the system icon list
*
* @return An Object matching the key string.
*/
file = getDesktop();
}
return file;
// Should be "History" and "Desktop" ?
} else {
}
}
return roots;
}
// Add all second level folders
// Add third level for "My Computer"
}
}
}
}
} else {
}
int i = 0;
do {
try {
// A CSIDL
// A path
}
} catch (IOException e) {
// Skip this value
} catch (InterruptedException e) {
// Return empty result
return new File[0];
}
// Use default list of places
}) {
if (f != null) {
}
}
}
int iconIndex;
} else {
return null;
}
return getStandardViewButton(iconIndex);
if (key == "optionPaneIcon Error") {
} else if (key == "optionPaneIcon Information") {
} else if (key == "optionPaneIcon Question") {
} else if (key == "optionPaneIcon Warning") {
} else {
return null;
}
try {
if (i >= 0) {
}
} catch (NumberFormatException ex) {
}
}
return null;
}
/**
* Does <code>dir</code> represent a "computer" such as a node on the network, or
* "My Computer" on the desktop.
*/
return true;
} else {
return dir.getAbsolutePath();
}
});
}
}
//Note: Removable drives don't "exist" but are listed in "My Computer"
if (dir instanceof Win32ShellFolder2) {
if (sf.isFileSystem()) {
}
// else fall through ...
} else {
return false;
}
}
return false;
}
}
return false;
}
if (topFolderList == null) {
}
} else if (i1 >= 0) {
return -1;
} else if (i2 >= 0) {
return 1;
}
}
// Non-file shellfolders sort before files
return -1;
return 1;
}
}
// First ignore case when comparing
if (diff != 0) {
return diff;
} else {
// May differ in case (e.g. "mail" vs. "Mail")
// We need this test for consistent sorting
}
}
return new ComInvoker();
}
private static class ComInvoker extends ThreadPoolExecutor implements ThreadFactory, ShellFolder.Invoker {
private ComInvoker() {
allowCoreThreadTimeOut(false);
setThreadFactory(this);
public void run() {
shutdownNow();
return null;
}
});
}
};
new Thread(shutdownHook)
);
return null;
}
});
}
public void run() {
try {
} finally {
}
}
};
new PrivilegedAction<Thread>() {
/* The thread must be a member of a thread group
* which will not get GCed before VM exit.
* Make its parent the top-level thread group.
*/
return thread;
}
}
);
return comThread;
}
// if it's already called from the COM
// thread, we don't need to delegate the task
} else {
try {
} catch (RejectedExecutionException e) {
throw new InterruptedException(e.getMessage());
}
try {
} catch (InterruptedException e) {
return null;
}
});
throw e;
} catch (ExecutionException e) {
}
}
}
}
}
}
static native void initializeCom();
static native void uninitializeCom();
}