Community
Participate
Working Groups
The current SWT Program class allows you to find the program that supports a given file extension, and execute it or get the icon for that program. However, it does not allow you to access any of the "secondary" programs on the machine - for instance, you can get the current program associated with "html", but you can't access any of the other Web browsers installed on the system. I already have code that will find all of the installed Web browsers on a machine, but I can't get their icons. This request is to add support that would allow me to get the icon for an arbitrary program. This could be done via a new mechanism, by extending the Program class to support all known programs on the machine, or by allowing me to create a Program instance using other information (e.g. the executable name or location).
You can ask Program.getPrograms() to get all the available program objects in the OS. The problem is that you cannot locate the one you are looking for since the only method you could use is 'getName()' which can return all kinds of results (a description, a name, a path, even an empty string). If you could return an absolute path of the executable, you could compare it with your own and be able to locate the Program object you need. From there you could get the image data to construct your Image instance.
Billy, any workarounds for our problem?
Not for 3.1, we are API frozen. Note that Program.getPrograms() is not guarenteed to list anything either (it is not supported on newer versions of Linux, for example).
Note that this bug is tracking adding support for obtaining secondary programs (.html -> list of web browsers). Support for finding an icon for an arbitrary path name is tracked as bug 4643.
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 and remove the stalebug whiteboard tag. 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. --