TreeItem setBackGround() not working.... [message #526680] |
Mon, 12 April 2010 11:11 |
Eclipse User |
|
|
|
Hi,
SWT-- TreeViewr-- TreeItem
In the following code i am trying to change the background color of the TreeItem dynamically on selection of the TreeItem, but its not changing the default color.. still its showing the default blue color....
Please help me on this......
private TreeViewer tableTreeViewerSource;
//adding the listener to the treeviewer
tableTreeViewerSource.addSelectionChangedListener(new ISelectionChangedListener(){
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection selection = (IStructuredSelection)event.getSelection();
Object obj = selection.getFirstElement();
TreeItem sourceItem = ComparatorUIUtils.getMatchedTreeItem(((Componenet)obj).getRe fNumber(), tableTreeViewerSource.getTree().getItems(),null);
//i got the treeitem
//trying to change the color
sourceItem.setBackground(sourceItem.getDisplay().getSystemCo lor(SWT.COLOR_DARK_GREEN));
}
});
I want to change the color of the treeitem..as Green
Please help me on this..
Thanks,
Prasad.
|
|
|
Powered by
FUDForum. Page generated in 0.33069 seconds