Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] System-provided icon services

Greetings!

While writing our own software we have experimented with SWT's ability to fetch a document icon for a given file on the linux-gtk, mac-carbon and win32 variants of SWT 3.0.2. For example, when methods in Program.java are supplied with a file whose extension is "xls" and the host OS has Microsoft Excel installed, we wish to receive the Excel spreadsheet document icon as registered on the host OS.

Concerning Program.java, we found that only the win32 variant reflects the host OS' notion of the document type icon. mac-carbon returns a hardcoded bitmap images. linux-gtk returns no useful data (refer to Bugzilla Bug 79268).

However, we have an immediate need to fetch 2 kinds of icons:

1. Our software needs to display the system representation of the "folder" or "directory" icon, as is displayed in Nautilus, Finder, and Windows Explorer.

2. Our software needs to display the system representation of the icon for any given file extension.

We have written the appropriate code to integrate this with SWT, and we wish to contribute it into the SWT code base. We do not know how our source code best fits in to SWT through the eyes of the powers-that-be; we even do not know if we are duplicating someone else's efforts. Specifically, where exactly should the Java code sit? Program.java? A whole new class? We also understand that, at least in the case of the aforementioned Bugzilla Bug, APIs are in flux but we require this functionality today. We see 2 options before us:

A. Contribute our code into the SWT code base. End-users (this means programmers) benefit from this functionality. The SWT cross-platform yet native look-and-feel cause is furthered. We most desire this approach. After learning where we can place our code without stepping on peoples toes, shall we file an enhancement and attach our patch?

B. Keep the code to ourselves and distribute it with our software separately.


Please advise us on how to proceed.

Thank you for your time,
Ty C



Back to the top