Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » change default icons
change default icons [message #175710] Wed, 05 March 2008 08:44 Go to next message
Eclipse UserFriend
Originally posted by: simonatoslo.gmail.com

Dear all:
i am a begineerin GMF, who can tell me how can i change a attribute's
icon, like i want to change the default star to an iamge i provided. i
have find the way to turn off the display of the icon. but don't find
how to change it. is it at the same place as turn off the display?(which
is at the *.gmfgen, gen top level->gen node label->diagram
label->element icon)


thanks, i am online waiting.
Re: change default icons [message #175728 is a reply to message #175710] Wed, 05 March 2008 09:06 Go to previous messageGo to next message
Enrico Schnepel is currently offline Enrico SchnepelFriend
Messages: 121
Registered: July 2009
Senior Member
hello simon,

The icons stored in EMF-Edit plugin are also used for the GMF-editor. So
changing this would also change the GMF-editor appearance.

enrico

simon han wrote:
> Dear all:
> i am a begineerin GMF, who can tell me how can i change a attribute's
> icon, like i want to change the default star to an iamge i provided. i
> have find the way to turn off the display of the icon. but don't find
> how to change it. is it at the same place as turn off the display?(which
> is at the *.gmfgen, gen top level->gen node label->diagram
> label->element icon)
>
>
> thanks, i am online waiting.
Re: change default icons [message #176487 is a reply to message #175728] Sun, 09 March 2008 12:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jan.koehnlein.web.de

Simon -

you should also disable the generation of default icons in the genmodel
(edit section) to avoid your custom icons from being overwritten. I find
this particularly annoying, as you are forced to mix generated stuff
with manually changed things.

Note that GMF gets the generated LabelItemProvider directly and not
using the extension point. So you cannot even avoid generating the
EMF.edit plug-in and provide your own LabelItemProvider instead.

Unfortunately, I did not get an answer to my previous post on that topic.
(see news://news.eclipse.org:119/fpn0jn$6mu$1@build.eclipse.org)

Regards
Jan

Enrico Schnepel wrote:
> hello simon,
>
> The icons stored in EMF-Edit plugin are also used for the GMF-editor. So
> changing this would also change the GMF-editor appearance.
>
> enrico
>
> simon han wrote:
>> Dear all:
>> i am a begineerin GMF, who can tell me how can i change a attribute's
>> icon, like i want to change the default star to an iamge i provided. i
>> have find the way to turn off the display of the icon. but don't find
>> how to change it. is it at the same place as turn off the display?(which
>> is at the *.gmfgen, gen top level->gen node label->diagram
>> label->element icon)
>>
>>
>> thanks, i am online waiting.
>
Re: change default icons [message #176506 is a reply to message #176487] Sun, 09 March 2008 14:24 Go to previous message
Enrico Schnepel is currently offline Enrico SchnepelFriend
Messages: 121
Registered: July 2009
Senior Member
We are using some aspectj in the edit plugin to overcome this restriction.

The IconFinder uses the class of the object to find the icon. the generated
icon will be used when no custom icon could be found.

public aspect EditorDecoration {
// customize item icon
pointcut getImage(Object item) :
execution( public Object *..*ItemProvider.getImage(Object) )
&& args( item );

Object around( Object item ) : getImage( item ) {
Object imageURL = IconFinder.getImageURL( item );
if (imageURL != null)
return imageURL;
else
return proceed( item );
}
}


Jan Köhnlein wrote:

> Simon -
>
> you should also disable the generation of default icons in the genmodel
> (edit section) to avoid your custom icons from being overwritten. I find
> this particularly annoying, as you are forced to mix generated stuff
> with manually changed things.
>
> Note that GMF gets the generated LabelItemProvider directly and not
> using the extension point. So you cannot even avoid generating the
> EMF.edit plug-in and provide your own LabelItemProvider instead.
>
> Unfortunately, I did not get an answer to my previous post on that topic.
> (see news://news.eclipse.org:119/fpn0jn$6mu$1@build.eclipse.org)
>
> Regards
> Jan
>
> Enrico Schnepel wrote:
>> hello simon,
>>
>> The icons stored in EMF-Edit plugin are also used for the GMF-editor. So
>> changing this would also change the GMF-editor appearance.
>>
>> enrico
>>
>> simon han wrote:
>>> Dear all:
>>> i am a begineerin GMF, who can tell me how can i change a attribute's
>>> icon, like i want to change the default star to an iamge i provided. i
>>> have find the way to turn off the display of the icon. but don't find
>>> how to change it. is it at the same place as turn off the display?(which
>>> is at the *.gmfgen, gen top level->gen node label->diagram
>>> label->element icon)
>>>
>>>
>>> thanks, i am online waiting.
>>
Previous Topic:GenCustomPreferencePage
Next Topic:Modeling in GMF
Goto Forum:
  


Current Time: Thu Apr 25 16:45:56 GMT 2024

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

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

Back to the top