EMF decorators [message #893525] |
Wed, 04 July 2012 09:00  |
Eclipse User |
|
|
|
HI,
How can I use decorators such as overlayicon image in emf.
[Updated on: Wed, 04 July 2012 09:00] by Moderator
|
|
|
|
|
|
Re: EMF decorators [message #893571 is a reply to message #893570] |
Wed, 04 July 2012 11:48   |
Eclipse User |
|
|
|
Ed Merks wrote on Wed, 04 July 2012 11:35Comments below.
On 04/07/2012 3:44 PM, becks m wrote:
> Ed,
> Where to use it ?
I pointed to it as an example of how to use ComposedImage.
> I've looked at it but I don't know where exactly should I use this
> method.
You don't use it, you look at how it works.
>
>
> I've the generated item provider adapters for all classes ( edit plugin)
>
> should I use this in getImage method ?
You'll want to specialize your getImage method to use ComposedImage.
> also, this class ETypedElementItemProvider where to extend it or what
> to change in the current generated model.
>
>
> all I wanted to add flag icon on an existing icon upon if condition.
Much like we want to add multiplicity decorations to a basic image...
Great, I went through it, and I reached something , wanted to share it with you.
In the edit plugin I override the method overlayImage which is used in each getImage method.
and used it easily by setting the image in it with the one i wanted to add on the original image. so, task was done there.
protected Object overlayImage(Object object, Object image)
{
List<Object> images = new ArrayList<Object>(2);
images.add(image);
images.add(getResourceLocator().getImage("full/obj16/requiredImagetoBeAddedOnOriginal"));
image = new ComposedImage(images);
return image;
}
Thanks Ed.
[Updated on: Wed, 04 July 2012 11:50] by Moderator
|
|
|
Re: EMF decorators [message #893578 is a reply to message #893571] |
Wed, 04 July 2012 12:42   |
Eclipse User |
|
|
|
That method is intended to adding the "controlled object" overlay so
reusing it for something else will disable it for that purpose. As you
can see, that method too simply uses ComposedImage so you could add your
own utility method just like that...
On 04/07/2012 5:48 PM, becks m wrote:
> Ed Merks wrote on Wed, 04 July 2012 11:35
>> Comments below.
>>
>> On 04/07/2012 3:44 PM, becks m wrote:
>> > Ed,
>> > Where to use it ?
>> I pointed to it as an example of how to use ComposedImage.
>> > I've looked at it but I don't know where exactly should I use this
>> > method.
>> You don't use it, you look at how it works.
>> >
>> >
>> > I've the generated item provider adapters for all classes ( edit
>> plugin)
>> >
>> > should I use this in getImage method ?
>> You'll want to specialize your getImage method to use ComposedImage.
>> > also, this class ETypedElementItemProvider where to extend it or
>> what > to change in the current generated model.
>> >
>> >
>> > all I wanted to add flag icon on an existing icon upon if condition.
>> Much like we want to add multiplicity decorations to a basic image...
>
>
>
> Great, I went through it, and I reached to something, wanted to share
> it with you.
>
> In the edit plugin I override the method overlayImage which is used in
> each getImage method.
>
> and used it easily by setting the image in it with the one i wanted to
> add on the original image. so, task was done there.
>
> Thanks Ed.
|
|
|
Re: EMF decorators [message #893649 is a reply to message #893578] |
Thu, 05 July 2012 02:41  |
Eclipse User |
|
|
|
Yes I disabled its default action for a certain class which I wanted to add decoration for. as I don't need to track the controlled object thing in my program.
but it still affects the rest of classes.
this was very helpful.
Thanks!
Ed Merks wrote on Wed, 04 July 2012 12:42That method is intended to adding the "controlled object" overlay so
reusing it for something else will disable it for that purpose. As you
can see, that method too simply uses ComposedImage so you could add your
own utility method just like that...
On 04/07/2012 5:48 PM, becks m wrote:
> Ed Merks wrote on Wed, 04 July 2012 11:35
>> Comments below.
>>
>> On 04/07/2012 3:44 PM, becks m wrote:
>> > Ed,
>> > Where to use it ?
>> I pointed to it as an example of how to use ComposedImage.
>> > I've looked at it but I don't know where exactly should I use this
>> > method.
>> You don't use it, you look at how it works.
>> >
>> >
>> > I've the generated item provider adapters for all classes ( edit
>> plugin)
>> >
>> > should I use this in getImage method ?
>> You'll want to specialize your getImage method to use ComposedImage.
>> > also, this class ETypedElementItemProvider where to extend it or
>> what > to change in the current generated model.
>> >
>> >
>> > all I wanted to add flag icon on an existing icon upon if condition.
>> Much like we want to add multiplicity decorations to a basic image...
>
>
>
> Great, I went through it, and I reached to something, wanted to share
> it with you.
>
> In the edit plugin I override the method overlayImage which is used in
> each getImage method.
>
> and used it easily by setting the image in it with the one i wanted to
> add on the original image. so, task was done there.
>
> Thanks Ed.
[Updated on: Thu, 05 July 2012 02:49] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03999 seconds