Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Get image from platform image registry
Get image from platform image registry [message #334279] Fri, 30 January 2009 06:44 Go to next message
Eclipse UserFriend
Hello,

How to retrieve the image associated with a file type from the platform
image registry.

*.txt ---> icon text
*.java ---> icon with the letter J
...

As the package explorer treeview.

It is to create a little treeview from some files.
Re: Get image from platform image registry [message #334283 is a reply to message #334279] Fri, 30 January 2009 08:39 Go to previous messageGo to next message
Eclipse UserFriend
You can use the Common Navigator/Project Explorer for any IResource
based file viewer. Basically, the workbench label provider for an IFile
does:
org.eclipse.ui.internal.ide.model.WorkbenchFile.getBaseImage (IResource)

The code in getBaseImage(*) looks up the content type and then tries to
get an icon from the editor registry.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm
Re: Get image from platform image registry [message #334285 is a reply to message #334283] Fri, 30 January 2009 12:47 Go to previous message
Eclipse UserFriend
Thank-you Paul. That is exactly what I was looking for
Previous Topic:A command can have the checked state?
Next Topic:Automatically activate 'problems' view when errors occur in compilation
Goto Forum:
  


Current Time: Sat Mar 29 11:20:53 EDT 2025

Powered by FUDForum. Page generated in 0.03443 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top