|
|
|
|
|
|
Re: Setting the text color of the tree label provider [message #419540 is a reply to message #419538] |
Mon, 26 May 2008 15:53 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Mircea,
Comments below.
Mircea Luchian wrote:
> Thanks Ed,
>
> What I did was to implement the ITableColorProvider. It works fine (I
> have a CustomAdapterFactoryLabelProvider that extends
> AdapterFactoryLabelProvider and implements ITableColorProvider).
That's exactly what the existing (in EMF 2.4) class does.
> What fundamental difference would the method you described have vs
> implementing the ITableColorProvider interface?
Like the IItemLabelProvider interfaces, it delegates control of the
colors to the item providers themselves so that each generated item
provider can control the colors directly.
>
> Mircea
>
> Ed Merks wrote:
>> Mircea,
>>
>> Note that AdapterFactoryLabelProvider.ColorProvider will help.
>> Perhaps you'll want your item providers to support
>> ITableItemColorProvider; you'll need to declare that in your adapter
>> factory too and you'll likely want to update the plugin.xml
>> registration to indicate your factory supports that...
>>
>>
>> Mircea Luchian wrote:
>>> It's ITableColorProvider.
>>>
>>> Mircea Luchian wrote:
>>>> Would you happen to know in which plugin this interface might be? I
>>>> didn't find it in the source code of the eclipse plugins.
>>>>
>>>> Mircea
>>>>
>>>> Tom Schindl wrote:
>>>>> Your LabelProvider has to implement ITableColorLabelProvider and
>>>>> then you can control the color. I don't know if
>>>>> AdapterFactoryLabelProvider already implements this none mandatory
>>>>> interface.
>>>>>
>>>>> Tom
>>>>>
>>>>> Mircea Luchian schrieb:
>>>>>> Hello,
>>>>>>
>>>>>> I have a custom AdapterFactoryLabelProvider for my EMF tabletree.
>>>>>> I customize the text with no problem, however I want to set it's
>>>>>> color. I cannot use it in public String getColumnText(Object
>>>>>> object, int columnIndex) because the function returns only a String.
>>>>>> How can I change the text color? Do I need to overrite another
>>>>>> function in another class?
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Mircea
>>>>>
>>>>>
>>>>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03568 seconds