user1328572
user1328572

Reputation: 599

how to refresh 2 nodes at different level in JFaceTree viewer in one go

how to refresh 2 nodes at different level in JFaceTree viewer in one go

If we assume, A is one root and B another root, then somewhere down under A, we have C and the same C gets listed somewhere down under B.

Now I want to refresh node C at both places in one go

Upvotes: 0

Views: 33

Answers (1)

greg-449
greg-449

Reputation: 111217

Just call TreeViewer.refresh(Object) on each of the C nodes. The tree is not actually refreshed until the next time the main dispatch loop is run so these updates will appear in one go.

Note: If the C objects appear to TreeViewer to be the same object (equals returns true and the hashCode is the same) you may have trouble with the refresh. Don't use the same object in different places in the tree or if this is unavoidable use an IElementComparer to let the tree viewer distinguish between the objects.

Upvotes: 0

Related Questions