Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Icon for an EClass
Icon for an EClass [message #793701] Wed, 08 February 2012 13:00 Go to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi,
is there an existing way retrieve the Icon for an EClass, which is
defined in the ItemProvider (basically call getImage()) without having
an instance of that EClass?
Cheers
Jonas
Re: Icon for an EClass [message #793944 is a reply to message #793701] Wed, 08 February 2012 19:07 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
<html>
<head>
<meta content="text/html; charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Jonas,<br>
<br>
The item provider does this:<br>
<blockquote>getResourceLocator().getImage("full/obj16/EClass")<br>
</blockquote>
and overrides getResourceLocator like this:<br>
<blockquote>  public ResourceLocator getResourceLocator()<br>
  {<br>
    return EcoreEditPlugin.INSTANCE;<br>
  }<br>
</blockquote>
The general pattern is to use the name of the class, the name of the
edit plugin for the class' edit plugin, to fetch the image's URL and
then use ExtendedImageRegistry.INSTANCE to convert it to an Image.<br>
<br>
<br>
On 08/02/2012 2:00 PM, Jonas Helming wrote:
<blockquote cite="mid:jgtrl8$op8$1@news.eclipse.org" type="cite">Hi,
<br>
is there an existing way retrieve the Icon for an EClass, which is
defined in the ItemProvider (basically call getImage()) without
having an instance of that EClass?
<br>
Cheers
<br>
Jonas
<br>
</blockquote>
</body>
</html>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[CDO] Performance of H2 DBSTORE
Next Topic:Cannot install EMF SDK 2.7.2
Goto Forum:
  


Current Time: Fri Apr 26 00:31:56 GMT 2024

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

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

Back to the top