Refresh labels of all tree items. [message #443408] |
Fri, 24 September 2004 15:29 |
Eclipse User |
|
|
|
Originally posted by: roman.korf.web.de
Hi,
I have a treeviewer with some items.
I also have an action that changes a parameter.
When the parameter changes I want to update the labels of all items in the
tree. I don't want to update the tree structure itself because it is too
time consuming. A refresh() would do that.
Anyone an idea how to do this?
|
|
|
Re: Refresh labels of all tree items. [message #443454 is a reply to message #443408] |
Fri, 24 September 2004 15:46 |
Eclipse User |
|
|
|
Originally posted by: roman.korf.web.de
Sorry for the question, I solved it somehow:
The update of the labels recursively:
protected void updateLabels(TreeItem[] items) {
if(items.length == 0)
return;
for(int i = 0; i < items.length; i++) {
// update item.
updateItem(items[i], items[i].getData());
// update items children.
updateLabels(items[i].getItems());
}
}
the initial step when updating:
treeviewer.updateLabels(treeviewer.getTree().getItems());
Roman Korf wrote:
> Hi,
> I have a treeviewer with some items.
> I also have an action that changes a parameter.
> When the parameter changes I want to update the labels of all items in the
> tree. I don't want to update the tree structure itself because it is too
> time consuming. A refresh() would do that.
> Anyone an idea how to do this?
|
|
|
|
Powered by
FUDForum. Page generated in 0.01981 seconds