Skip to main content



      Home
Home » Eclipse Projects » Remote Application Platform (RAP) » How to change a treeitems background color of a CheckboxTreeViewer?
How to change a treeitems background color of a CheckboxTreeViewer? [message #97989] Mon, 14 July 2008 10:45 Go to next message
Eclipse UserFriend
Originally posted by: mary.tetracom.com

Hello,

I have CheckboxTreeViewer control. There is a search into a treeitems and
I need to mark the result. I have the following label provider:

public class TreeLabelProvider extends LabelProvider implements
IColorProvider {

public Image getImage(Object element) {
return null;
}

public String getText(Object element) {
return ((CTTreeItem)element).getText();
}

public Color getBackground( Object element ) {
if ( foundObjectsIds != null
&& foundObjectsIds.containsKey( ( ( CTTreeItem )element ).getID() ) ) {

return Display.getDefault().getSystemColor( SWT.COLOR_DARK_BLUE );

} else {
return null;
}
}

public Color getForeground( Object element ) {
return null;
}
}

When I debug, I see that the method is called and a color is returned.
But the found items are not marked.

Any help


Regards
Re: How to change a treeitems background color of a CheckboxTreeViewer? [message #98033 is a reply to message #97989] Mon, 14 July 2008 11:34 Go to previous message
Eclipse UserFriend
Originally posted by: rherrmann.innoopract.com

Hi,

I am aware that there are issues with the foreground color,
described in more detail here:
218420: [TreeItem] setForeground(Color), setForeground(int,
Color), setBackground(int, Color) does not work
https://bugs.eclipse.org/bugs/show_bug.cgi?id=218420
and here:
193933: [TreeItem] Text is not grayed out when disabled if
custom foreground color is set
https://bugs.eclipse.org/bugs/show_bug.cgi?id=193933

Basically they are related to the way the client-side library
represents TreeItems.
I could imagine the for similar reasons, the background color does
not work either.
Feel free to file a bugzilla.

Cheers,
Rüdiger




Marija Kalinova wrote:
> Hello,
> I have CheckboxTreeViewer control. There is a search into a treeitems
> and I need to mark the result. I have the following label provider:
>
> public class TreeLabelProvider extends LabelProvider implements
> IColorProvider {
>
> public Image getImage(Object element) {
> return null;
> }
>
> public String getText(Object element) {
> return ((CTTreeItem)element).getText();
> }
>
> public Color getBackground( Object element ) {
> if ( foundObjectsIds != null && foundObjectsIds.containsKey(
> ( ( CTTreeItem )element ).getID() ) ) {
>
> return Display.getDefault().getSystemColor( SWT.COLOR_DARK_BLUE );
>
> } else {
> return null;
> }
> }
>
> public Color getForeground( Object element ) {
> return null;
> }
> }
>
> When I debug, I see that the method is called and a color is returned.
> But the found items are not marked.
> Any help
>
>
> Regards
>
Previous Topic:Help with creating a facade plugin for RAP/RCP
Next Topic:How to display an HTML page
Goto Forum:
  


Current Time: Sun Jul 13 00:35:07 EDT 2025

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

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

Back to the top