< prev index next >
src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java
Print this page
*** 954,964 ****
// Return the icon of a file system shell folder in the form of an HICON
private static native long getIcon(String absolutePath, boolean getLargeIcon);
// NOTE: this method uses COM and must be called on the 'COM thread'. See ComInvoker for the details
private static native long extractIcon(long parentIShellFolder, long relativePIDL,
! boolean getLargeIcon);
// Returns an icon from the Windows system icon list in the form of an HICON
private static native long getSystemIcon(int iconID);
private static native long getIconResource(String libName, int iconID,
int cxDesired, int cyDesired,
--- 954,964 ----
// Return the icon of a file system shell folder in the form of an HICON
private static native long getIcon(String absolutePath, boolean getLargeIcon);
// NOTE: this method uses COM and must be called on the 'COM thread'. See ComInvoker for the details
private static native long extractIcon(long parentIShellFolder, long relativePIDL,
! boolean getLargeIcon, boolean getDefaultIcon);
// Returns an icon from the Windows system icon list in the form of an HICON
private static native long getSystemIcon(int iconID);
private static native long getIconResource(String libName, int iconID,
int cxDesired, int cyDesired,
*** 1005,1015 ****
if (icon == null) {
icon =
invoke(new Callable<Image>() {
public Image call() {
Image newIcon = null;
! if (isFileSystem()) {
long parentIShellIcon = (parent != null)
? ((Win32ShellFolder2) parent).getIShellIcon()
: 0L;
long relativePIDL = getRelativePIDL();
--- 1005,1022 ----
if (icon == null) {
icon =
invoke(new Callable<Image>() {
public Image call() {
Image newIcon = null;
! if (isLink()) {
! ShellFolder folder = getLinkLocation();
! if (folder != null && "Library".equals(
! folder.getFolderType())) {
! return folder.getIcon(getLargeIcon);
! }
! }
! if (isFileSystem() || "Library".equals(getFolderType())) {
long parentIShellIcon = (parent != null)
? ((Win32ShellFolder2) parent).getIShellIcon()
: 0L;
long relativePIDL = getRelativePIDL();
*** 1035,1045 ****
}
if (newIcon == null) {
// These are only cached per object
long hIcon = extractIcon(getParentIShellFolder(),
! getRelativePIDL(), getLargeIcon);
newIcon = makeIcon(hIcon, getLargeIcon);
disposeIcon(hIcon);
}
if (newIcon == null) {
--- 1042,1064 ----
}
if (newIcon == null) {
// These are only cached per object
long hIcon = extractIcon(getParentIShellFolder(),
! getRelativePIDL(), getLargeIcon, false);
! // E_PENDING: loading can take time so get the default
! if(hIcon <= 0) {
! hIcon = extractIcon(getParentIShellFolder(),
! getRelativePIDL(), getLargeIcon, true);
! if(hIcon <= 0) {
! if (isDirectory()) {
! return getShell32Icon(4, getLargeIcon);
! } else {
! return getShell32Icon(1, getLargeIcon);
! }
! }
! }
newIcon = makeIcon(hIcon, getLargeIcon);
disposeIcon(hIcon);
}
if (newIcon == null) {
< prev index next >