Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Overriding getBackground in the generated itemprovider
Overriding getBackground in the generated itemprovider [message #426572] Wed, 14 January 2009 08:04 Go to next message
AJ  is currently offline AJ Friend
Messages: 77
Registered: July 2009
Member
I am overriding the ItemProviderAdapter.getBackground() method in my
generated itemprovider and I would like to know if there is a way to
access it via the EObject adapter like when one want to access the getText
and getImage methods.

IItemLabelProvider itemLabelProvider =
(IItemLabelProvider)adapterFactory.adapt(object, IItemLabelProvider.class);
itemLabelProvider.getImage(object)


In other words, is there way I can obtain the ItemProviderAdapter the same
way as shown above for the IItemLabelProvider?

TIA!
Re: Overriding getBackground in the generated itemprovider [message #426577 is a reply to message #426572] Wed, 14 January 2009 12:47 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Ben,

Comments below.


Ben wrote:
> I am overriding the ItemProviderAdapter.getBackground() method in my
> generated itemprovider and I would like to know if there is a way to
> access it via the EObject adapter like when one want to access the
> getText and getImage methods.
>
> IItemLabelProvider itemLabelProvider =
> (IItemLabelProvider)adapterFactory.adapt(object,
> IItemLabelProvider.class);
> itemLabelProvider.getImage(object)
>
>
> In other words, is there way I can obtain the ItemProviderAdapter the
> same way as shown above for the IItemLabelProvider?
Like IItemColorProvider. Note that in the GenModel's Edit properties
you can enable Color Providers (not to mention Font and Table). This
should update the registration in the plugin.xml but since that doesn't
merge, you have to update it manual or delete it and regenerate it...
>
> TIA!
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Overriding getBackground in the generated itemprovider [message #426578 is a reply to message #426577] Wed, 14 January 2009 12:53 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Ben,

I should mention too, that AdapterFactoryLabelProvider of course has
convenient methods to hide all the details...


Ed Merks wrote:
> Ben,
>
> Comments below.
>
>
> Ben wrote:
>> I am overriding the ItemProviderAdapter.getBackground() method in my
>> generated itemprovider and I would like to know if there is a way to
>> access it via the EObject adapter like when one want to access the
>> getText and getImage methods.
>>
>> IItemLabelProvider itemLabelProvider =
>> (IItemLabelProvider)adapterFactory.adapt(object,
>> IItemLabelProvider.class);
>> itemLabelProvider.getImage(object)
>>
>>
>> In other words, is there way I can obtain the ItemProviderAdapter the
>> same way as shown above for the IItemLabelProvider?
> Like IItemColorProvider. Note that in the GenModel's Edit properties
> you can enable Color Providers (not to mention Font and Table). This
> should update the registration in the plugin.xml but since that
> doesn't merge, you have to update it manual or delete it and
> regenerate it...
>>
>> TIA!
>>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Strange EMF Editor behavior
Next Topic:How to reload a resource that has been modified on the file system
Goto Forum:
  


Current Time: Thu Apr 25 04:25:23 GMT 2024

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

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

Back to the top