Community
Participate
Working Groups
Background: We required a common mechanism to fetch icons representative of metaphors common to all platforms (folders, file types identified by file name extension) and yet unique to each platform (a Mac OS X folder icon depiction vs. same on GNOME/GTK). However, there was no way of obtaining the icon unless there was a program associated with the file extension, and then only on some of the platforms. Approach: We chose to place these methods in Program.java because of their tight relationship in both code and function, but not in spirit: the host operating environment may vend icons that are *not* associated with any particular program (i.e. an icon representing a file system folder or a UNIX shell script whose file name extension is "sh"). We wish for these methods to find a suitable place within SWT and we leave that task to the maintainers ;) We added 2 static methods to Program.java: getImageData(String extension, int iconSize) getSystemFolderImageData(int iconSize)
Created attachment 20659 [details] Adds static icon retrieval methods to Linux GTK variant
Created attachment 20660 [details] Adds static icon retrieval methods to Mac OS X Carbon variant
Created attachment 20661 [details] Adds static icon retrieval methods to Windows variant
Created attachment 20753 [details] Adds static icon retrieval methods to Mac OS X Carbon variant Updated getImageData ( String extension, int iconSize ) to accept extensions that have a ``.'' (dot) character prefixed. Added JavaDoc to the public methods.
I think the correct place for the system folder image code is part of the Display.getSystemImage() API. I opened bug 93524 to track this API addition. This bug is tracking adding a static method to get the icon for a file extension. Unfortunately, we have been API frozen for a while now and I will not have time to push these into 3.1. This will be looked at immediately after 3.1 ships. Thanks for your contribution, and sorry that it didn't get squeezed in.
*** Bug 64138 has been marked as a duplicate of this bug. ***
Created attachment 25437 [details] Forward-ported the Linux patch to swt-3.1.0 (3138)
Created attachment 25438 [details] Forward-ported the Mac patch to swt-3.1.0 (3138)
Created attachment 25440 [details] Forward-ported the win32 patch to swt-3.1.0 (3138)
*** Bug 43689 has been marked as a duplicate of this bug. ***
From bug 43689: e.g. see figures 12 ("Common icons for Windows XP") and 13 ("Common toolbar icons for Windows XP") in "Creating Windows XP Icons" (Microsoft, 2001) in the MSDN Library, which seems to encourage us to freely reuse forty or so common icons.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. If the bug is still relevant, please remove the stalebug whiteboard tag.