Bug 93606 - Need API to get system images [was: Program API enhancement: Static methods that retrieve icons]
Summary: Need API to get system images [was: Program API enhancement: Static methods t...
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.1   Edit
Hardware: All All
: P3 enhancement with 7 votes (vote)
Target Milestone: ---   Edit
Assignee: Billy Biggs CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
: 43689 64138 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-05-03 19:42 EDT by Ty C CLA
Modified: 2019-11-27 07:44 EST (History)
13 users (show)

See Also:


Attachments
Adds static icon retrieval methods to Linux GTK variant (15.79 KB, patch)
2005-05-03 19:43 EDT, Ty C CLA
no flags Details | Diff
Adds static icon retrieval methods to Mac OS X Carbon variant (11.11 KB, patch)
2005-05-03 19:45 EDT, Ty C CLA
no flags Details | Diff
Adds static icon retrieval methods to Windows variant (6.79 KB, patch)
2005-05-03 19:45 EDT, Ty C CLA
no flags Details | Diff
Adds static icon retrieval methods to Mac OS X Carbon variant (12.89 KB, patch)
2005-05-05 14:56 EDT, Ty C CLA
no flags Details | Diff
Forward-ported the Linux patch to swt-3.1.0 (3138) (4.35 KB, patch)
2005-07-28 17:21 EDT, Ty C CLA
no flags Details | Diff
Forward-ported the Mac patch to swt-3.1.0 (3138) (12.27 KB, patch)
2005-07-28 17:23 EDT, Ty C CLA
no flags Details | Diff
Forward-ported the win32 patch to swt-3.1.0 (3138) (6.20 KB, patch)
2005-07-28 17:26 EDT, Ty C CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ty C CLA 2005-05-03 19:42:56 EDT
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)
Comment 1 Ty C CLA 2005-05-03 19:43:51 EDT
Created attachment 20659 [details]
Adds static icon retrieval methods to Linux GTK variant
Comment 2 Ty C CLA 2005-05-03 19:45:06 EDT
Created attachment 20660 [details]
Adds static icon retrieval methods to Mac OS X Carbon variant
Comment 3 Ty C CLA 2005-05-03 19:45:32 EDT
Created attachment 20661 [details]
Adds static icon retrieval methods to Windows variant
Comment 4 Ty C CLA 2005-05-05 14:56:46 EDT
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.
Comment 5 Billy Biggs CLA 2005-05-26 11:30:51 EDT
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.
Comment 6 Steve Northover CLA 2005-07-28 16:00:46 EDT
*** Bug 64138 has been marked as a duplicate of this bug. ***
Comment 7 Ty C CLA 2005-07-28 17:21:40 EDT
Created attachment 25437 [details]
Forward-ported the Linux patch to swt-3.1.0 (3138)
Comment 8 Ty C CLA 2005-07-28 17:23:15 EDT
Created attachment 25438 [details]
Forward-ported the Mac patch to swt-3.1.0 (3138)
Comment 9 Ty C CLA 2005-07-28 17:26:49 EDT
Created attachment 25440 [details]
Forward-ported the win32 patch to swt-3.1.0 (3138)
Comment 10 Steve Northover CLA 2006-05-30 13:50:21 EDT
*** Bug 43689 has been marked as a duplicate of this bug. ***
Comment 11 Steve Northover CLA 2006-05-30 13:51:31 EDT
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.
Comment 12 Lars Vogel CLA 2019-11-27 07:44:06 EST
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.