Home » Eclipse Projects » Eclipse Platform » change text color, icon/label in view
change text color, icon/label in view [message #158059] |
Mon, 17 November 2003 19:20  |
Eclipse User |
|
|
|
Originally posted by: jgangemi.yahoo.com
hello -
could anyone point me in the correct direction on how (is this even possible)
i could change the text color in a view? if a project is part of cvs, and the
contents change, i would like to be able to change the color of the file name
to help make it stand out better.
also, when trying to create a GC object w/ a baseImage, such as any label
icon that is associated w/ a java file, xml file, etc i receive an "Invalid
Arugment" exception.
after digging thru the code, it appears that i can only create new GC objects
on bitmaps and not "icons" - why is this so? and what labels an image as an
icon vs a bitmap (i think it has something to do w/ transparency, but not
sure). if i wanted to change the color of one of those labels (say the
"package" label icon that is accociated w/ a java package [it's orange and has
a "plus" sign thru it]) can i build a GC object somehow and manipulate the the
image color that way, or am i going to have to redraw the entire image
"dynamically" (pixel by pixel).
thanks!!!
-jae
|
|
|
Re: change text color, icon/label in view [message #158770 is a reply to message #158059] |
Wed, 19 November 2003 04:57   |
Eclipse User |
|
|
|
Originally posted by: daniel.megert.gmx.net
jae wrote:
>hello -
>
> could anyone point me in the correct direction on how (is this even possible)
>i could change the text color in a view? if a project is part of cvs, and the
>contents change, i would like to be able to change the color of the file name
>to help make it stand out better.
>
>
See IColorProvider
Dani
> also, when trying to create a GC object w/ a baseImage, such as any label
>icon that is associated w/ a java file, xml file, etc i receive an "Invalid
>Arugment" exception.
>
> after digging thru the code, it appears that i can only create new GC objects
>on bitmaps and not "icons" - why is this so? and what labels an image as an
>icon vs a bitmap (i think it has something to do w/ transparency, but not
>sure). if i wanted to change the color of one of those labels (say the
>"package" label icon that is accociated w/ a java package [it's orange and has
>a "plus" sign thru it]) can i build a GC object somehow and manipulate the the
>image color that way, or am i going to have to redraw the entire image
>"dynamically" (pixel by pixel).
>
> thanks!!!
>
>-jae
>
>
|
|
|
Re: change text color, icon/label in view [message #158929 is a reply to message #158770] |
Wed, 19 November 2003 10:04   |
Eclipse User |
|
|
|
Originally posted by: jgangemi.yahoo.com
ok - so once i implement that interface, i can control the colors for the
given element, but then how do i "hook up" the implementation so that the view
knows to use it?
thx!
-jae
On Wed, 19 Nov 2003 10:57:14 +0100, Daniel Megert <daniel.megert@gmx.net>
wrote:
>jae wrote:
>
>>hello -
>>
>> could anyone point me in the correct direction on how (is this even possible)
>>i could change the text color in a view? if a project is part of cvs, and the
>>contents change, i would like to be able to change the color of the file name
>>to help make it stand out better.
>>
>>
>See IColorProvider
>
>Dani
>
>> also, when trying to create a GC object w/ a baseImage, such as any label
>>icon that is associated w/ a java file, xml file, etc i receive an "Invalid
>>Arugment" exception.
>>
>> after digging thru the code, it appears that i can only create new GC objects
>>on bitmaps and not "icons" - why is this so? and what labels an image as an
>>icon vs a bitmap (i think it has something to do w/ transparency, but not
>>sure). if i wanted to change the color of one of those labels (say the
>>"package" label icon that is accociated w/ a java package [it's orange and has
>>a "plus" sign thru it]) can i build a GC object somehow and manipulate the the
>>image color that way, or am i going to have to redraw the entire image
>>"dynamically" (pixel by pixel).
>>
>> thanks!!!
>>
>>-jae
>>
>>
|
|
|
Re: change text color, icon/label in view [message #159137 is a reply to message #158929] |
Wed, 19 November 2003 19:00   |
Eclipse User |
|
|
|
Originally posted by: daniel.megert.gmx.net
jae wrote:
> ok - so once i implement that interface, i can control the colors for the
>given element, but then how do i "hook up" the implementation so that the view
>knows to use it?
>
>
Set it as your viewer's label provider.
Dani
> thx!
>
>-jae
>
>
>On Wed, 19 Nov 2003 10:57:14 +0100, Daniel Megert <daniel.megert@gmx.net>
>wrote:
>
>
>
>>jae wrote:
>>
>>
>>
>>>hello -
>>>
>>> could anyone point me in the correct direction on how (is this even possible)
>>>i could change the text color in a view? if a project is part of cvs, and the
>>>contents change, i would like to be able to change the color of the file name
>>>to help make it stand out better.
>>>
>>>
>>>
>>>
>>See IColorProvider
>>
>>Dani
>>
>>
>>
>>> also, when trying to create a GC object w/ a baseImage, such as any label
>>>icon that is associated w/ a java file, xml file, etc i receive an "Invalid
>>>Arugment" exception.
>>>
>>> after digging thru the code, it appears that i can only create new GC objects
>>>on bitmaps and not "icons" - why is this so? and what labels an image as an
>>>icon vs a bitmap (i think it has something to do w/ transparency, but not
>>>sure). if i wanted to change the color of one of those labels (say the
>>>"package" label icon that is accociated w/ a java package [it's orange and has
>>>a "plus" sign thru it]) can i build a GC object somehow and manipulate the the
>>>image color that way, or am i going to have to redraw the entire image
>>>"dynamically" (pixel by pixel).
>>>
>>> thanks!!!
>>>
>>>-jae
>>>
>>>
>>>
>>>
>
>
>
|
|
|
Re: change text color, icon/label in view [message #159158 is a reply to message #159137] |
Wed, 19 November 2003 21:33   |
Eclipse User |
|
|
|
Originally posted by: jgangemi.yahoo.com
ahhh - i see.
but is it possible to override a label provider for an existing view, rather
then having to create a new view?
i could just subclass the label provider and set it w/ that instead, however
i'm not really sure that's the best approach (just b/c if that class ever
changes, my code breaks).
-jae
On Thu, 20 Nov 2003 01:00:38 +0100, Daniel Megert <daniel.megert@gmx.net>
wrote:
>jae wrote:
>
>> ok - so once i implement that interface, i can control the colors for the
>>given element, but then how do i "hook up" the implementation so that the view
>>knows to use it?
>>
>>
>Set it as your viewer's label provider.
>
>Dani
>
>> thx!
>>
>>-jae
>>
>>
>>On Wed, 19 Nov 2003 10:57:14 +0100, Daniel Megert <daniel.megert@gmx.net>
>>wrote:
>>
>>
>>
>>>jae wrote:
>>>
>>>
>>>
>>>>hello -
>>>>
>>>> could anyone point me in the correct direction on how (is this even possible)
>>>>i could change the text color in a view? if a project is part of cvs, and the
>>>>contents change, i would like to be able to change the color of the file name
>>>>to help make it stand out better.
>>>>
>>>>
>>>>
>>>>
>>>See IColorProvider
>>>
>>>Dani
>>>
>>>
>>>
>>>> also, when trying to create a GC object w/ a baseImage, such as any label
>>>>icon that is associated w/ a java file, xml file, etc i receive an "Invalid
>>>>Arugment" exception.
>>>>
>>>> after digging thru the code, it appears that i can only create new GC objects
>>>>on bitmaps and not "icons" - why is this so? and what labels an image as an
>>>>icon vs a bitmap (i think it has something to do w/ transparency, but not
>>>>sure). if i wanted to change the color of one of those labels (say the
>>>>"package" label icon that is accociated w/ a java package [it's orange and has
>>>>a "plus" sign thru it]) can i build a GC object somehow and manipulate the the
>>>>image color that way, or am i going to have to redraw the entire image
>>>>"dynamically" (pixel by pixel).
>>>>
>>>> thanks!!!
>>>>
>>>>-jae
>>>>
>>>>
>>>>
>>>>
>>
>>
>>
|
|
|
Re: change text color, icon/label in view [message #159442 is a reply to message #159158] |
Thu, 20 November 2003 09:44   |
Eclipse User |
|
|
|
Originally posted by: daniel.megert.gmx.net
jae wrote:
> ahhh - i see.
>
> but is it possible to override a label provider for an existing view, rather
>then having to create a new view?
>
>
No. A viewer has exactly one label provider. You can subclass an
existing label provider and set it to your viewer. Maybe instead of
changing the colour you could use a decorate (see ILabelDecorator).
Dani
> i could just subclass the label provider and set it w/ that instead, however
>i'm not really sure that's the best approach (just b/c if that class ever
>changes, my code breaks).
>
>-jae
>
>On Thu, 20 Nov 2003 01:00:38 +0100, Daniel Megert <daniel.megert@gmx.net>
>wrote:
>
>
>
>>jae wrote:
>>
>>
>>
>>> ok - so once i implement that interface, i can control the colors for the
>>>given element, but then how do i "hook up" the implementation so that the view
>>>knows to use it?
>>>
>>>
>>>
>>>
>>Set it as your viewer's label provider.
>>
>>Dani
>>
>>
>>
>>> thx!
>>>
>>>-jae
>>>
>>>
>>>On Wed, 19 Nov 2003 10:57:14 +0100, Daniel Megert <daniel.megert@gmx.net>
>>>wrote:
>>>
>>>
>>>
>>>
>>>
>>>>jae wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>hello -
>>>>>
>>>>>could anyone point me in the correct direction on how (is this even possible)
>>>>>i could change the text color in a view? if a project is part of cvs, and the
>>>>>contents change, i would like to be able to change the color of the file name
>>>>>to help make it stand out better.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>See IColorProvider
>>>>
>>>>Dani
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>also, when trying to create a GC object w/ a baseImage, such as any label
>>>>>icon that is associated w/ a java file, xml file, etc i receive an "Invalid
>>>>>Arugment" exception.
>>>>>
>>>>>after digging thru the code, it appears that i can only create new GC objects
>>>>>on bitmaps and not "icons" - why is this so? and what labels an image as an
>>>>>icon vs a bitmap (i think it has something to do w/ transparency, but not
>>>>>sure). if i wanted to change the color of one of those labels (say the
>>>>>"package" label icon that is accociated w/ a java package [it's orange and has
>>>>>a "plus" sign thru it]) can i build a GC object somehow and manipulate the the
>>>>>image color that way, or am i going to have to redraw the entire image
>>>>>"dynamically" (pixel by pixel).
>>>>>
>>>>>thanks!!!
>>>>>
>>>>>-jae
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>
>>>
>>>
>>>
>
>
>
|
|
|
Re: change text color, icon/label in view [message #159496 is a reply to message #159442] |
Thu, 20 November 2003 10:57  |
Eclipse User |
|
|
|
Originally posted by: jgangemi.yahoo.com
grrr - ok - i had initially explored the use of the label decorator, but ran
into problems trying to change the color of the image decoration b/c i can't
create a GC object against it. (according to the eclipse code, that "icon" is
transparent, and therefore i can't create a new GC object w/ it).
that pretty much left me having to re-draw the image pixel by pixel to get
the effects i want, which i guess is ok, but i haven't quite figured out how to
accomplish that task yet.
is there any way i could manipulate the text color of a label decoration
instead? i'm guessing no since the decorateText method returns a String.
On Thu, 20 Nov 2003 15:44:08 +0100, Daniel Megert <daniel.megert@gmx.net>
wrote:
>jae wrote:
>
>> ahhh - i see.
>>
>> but is it possible to override a label provider for an existing view, rather
>>then having to create a new view?
>>
>>
>No. A viewer has exactly one label provider. You can subclass an
>existing label provider and set it to your viewer. Maybe instead of
>changing the colour you could use a decorate (see ILabelDecorator).
>
>Dani
>
>> i could just subclass the label provider and set it w/ that instead, however
>>i'm not really sure that's the best approach (just b/c if that class ever
>>changes, my code breaks).
>>
>>-jae
>>
>>On Thu, 20 Nov 2003 01:00:38 +0100, Daniel Megert <daniel.megert@gmx.net>
>>wrote:
>>
>>
>>
>>>jae wrote:
>>>
>>>
>>>
>>>> ok - so once i implement that interface, i can control the colors for the
>>>>given element, but then how do i "hook up" the implementation so that the view
>>>>knows to use it?
>>>>
>>>>
>>>>
>>>>
>>>Set it as your viewer's label provider.
>>>
>>>Dani
>>>
>>>
>>>
>>>> thx!
>>>>
>>>>-jae
>>>>
>>>>
>>>>On Wed, 19 Nov 2003 10:57:14 +0100, Daniel Megert <daniel.megert@gmx.net>
>>>>wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>jae wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>hello -
>>>>>>
>>>>>>could anyone point me in the correct direction on how (is this even possible)
>>>>>>i could change the text color in a view? if a project is part of cvs, and the
>>>>>>contents change, i would like to be able to change the color of the file name
>>>>>>to help make it stand out better.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>See IColorProvider
>>>>>
>>>>>Dani
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>also, when trying to create a GC object w/ a baseImage, such as any label
>>>>>>icon that is associated w/ a java file, xml file, etc i receive an "Invalid
>>>>>>Arugment" exception.
>>>>>>
>>>>>>after digging thru the code, it appears that i can only create new GC objects
>>>>>>on bitmaps and not "icons" - why is this so? and what labels an image as an
>>>>>>icon vs a bitmap (i think it has something to do w/ transparency, but not
>>>>>>sure). if i wanted to change the color of one of those labels (say the
>>>>>>"package" label icon that is accociated w/ a java package [it's orange and has
>>>>>>a "plus" sign thru it]) can i build a GC object somehow and manipulate the the
>>>>>>image color that way, or am i going to have to redraw the entire image
>>>>>>"dynamically" (pixel by pixel).
>>>>>>
>>>>>>thanks!!!
>>>>>>
>>>>>>-jae
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>>>
>>>>
>>
>>
>>
|
|
|
Goto Forum:
Current Time: Fri May 02 01:00:02 EDT 2025
Powered by FUDForum. Page generated in 0.03686 seconds
|