mirror of
https://github.com/igniterealtime/Spark.git
synced 2026-03-01 04:59:51 +00:00
Merge pull request #395 from speedy01/SPARK-2017
Spark-2017 Remove usage of sun.awt.shell
This commit is contained in:
@ -801,19 +801,11 @@ public final class GraphicUtils {
|
||||
* @return the native icon, otherwise default document icon.
|
||||
*/
|
||||
public static Icon getIcon(File file) {
|
||||
try {
|
||||
sun.awt.shell.ShellFolder sf = sun.awt.shell.ShellFolder
|
||||
.getShellFolder(file);
|
||||
|
||||
// Get large icon
|
||||
return new ImageIcon(sf.getIcon(true), sf.getFolderType());
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
return new JFileChooser().getIcon(file);
|
||||
} catch (Exception e1) {
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
||||
try {
|
||||
return new JFileChooser().getIcon(file);
|
||||
} catch (Exception e) {
|
||||
Log.debug("unable to get icon");
|
||||
}
|
||||
|
||||
return SparkRes.getImageIcon(SparkRes.DOCUMENT_INFO_32x32);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user