Bug 278392

Summary: [Viewers] Improve JavaDoc for TreeViewer.add
Product: [Eclipse Project] Platform Reporter: Marko Tomljenovic <marko.tomljenovic>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: pinnamur
Version: 3.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Marko Tomljenovic CLA 2009-05-29 10:25:05 EDT
I am using a tree viewer whose model can have many thousand elements whith multiple levels.

When a new top level element is added to the content provider model I want to tell the viewer to only refresh this top level element.

The add() method on the viewer needs a parent. But since I am adding a top level element I have no parent and if I use null as parent I get an exception.

And refreshing the complete tree just because of one new element is really not preferrable.
Comment 1 Boris Bokowski CLA 2009-05-29 16:27:38 EDT
Does add(viewer.getInput(), newToplevelElement) work?
Comment 2 Marko Tomljenovic CLA 2009-06-02 02:18:57 EDT
Yes it does, but it should be written down in the javadoc that the parent element of top level elements in the tree is the viewer input!

Thanks anyway.
Comment 3 Boris Bokowski CLA 2009-11-26 09:50:39 EST
Hitesh is now responsible for watching bugs in the [Viewers] component area.
Comment 4 Eclipse Webmaster CLA 2019-09-06 16:11:18 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.