Hi all,
As I'm working on some completion/hover that would give some Image
preview, I'm wondering whether Platform UI should actually define a
root content type for Images, just like it does for text, and also
defined most usual children: jpeg, jpg, png, gif, bmp. This would
make it pretty easy to test uniformly in the IDE whether a given
resource is an image:
IContentType imageContentType =
Platform.getContentTypeManager().getContentType("org.eclipse.core.runtime.image");
Platform.getContentTypeManager().getContentType(proposalResource.getName()).isKindOf(imageContentType);
and it would make those content-types available by default in the
content-type page, making it more accessible for users to tweak the
editor association. Also, adding new images format would be "only" a
matter of adding a content-type rather than changing multiple pieces
of code checking for extensions.
Note that the idea is simply to define the content-type, not to
associate it with any viewer/editor at the moment.
Do you think it's worth opening a bug and trying to add it in future
releases?
Cheers,
|