| Summary: | [GalleryTreeViewer] New groups added via refresh() appear collapsed | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Justin Dolezy <justin.dolezy> | ||||
| Component: | Nebula | Assignee: | Nicolas Richeton <nicolas.richeton> | ||||
| Status: | RESOLVED WONTFIX | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P1 | CC: | tom.schindl | ||||
| Version: | unspecified | Keywords: | plan | ||||
| Target Milestone: | --- | ||||||
| Hardware: | Macintosh | ||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Justin Dolezy
Created attachment 113585 [details]
Unit test for this bug
There are 2 tests : one for the GalleryTreeViewer and one for the TreeViewer as reference.
I made some quick tests on this and it seems that the TreeViewer has the same behavior than the GalleryTreeViewer. See attached unit test. Interesting, maybe this is just a documentation deficiency in AbstractTreeViewer.
The public API says this:
/**
* Sets the auto-expand level. The value 0 means that there is no
* auto-expand; 1 means that top-level elements are expanded, but not their
* children; 2 means that top-level elements are expanded, and their
* children, but not grandchildren; and so on.
* <p>
* The value <code>ALL_LEVELS</code> means that all subtrees should be
* expanded.
* </p>
*
* @param level
* non-negative level, or <code>ALL_LEVELS</code> to expand all
* levels of the tree
*/
public void setAutoExpandLevel(int level) {
expandToLevel = level;
}
But then looking at the private field 'expandToLevel' mentions that this auto-expand applies onto to input changes!
/**
* The level to which the tree is automatically expanded each time the
* viewer's input is changed (that is, by <code>setInput</code>). A value
* of 0 means that auto-expand is off.
*
* @see #setAutoExpandLevel
*/
private int expandToLevel = 0;
Maybe the JFace guys should update the documentation here so this is more visible on the public doc?
Tom: Could you give us your opinion on this ? The public javadoc of AbstractTreeViewer may be not be clear enough. Thanks. Since this is exactly the behavior of other jface viewers, resolving as WONTFIX. Please reopen if the jface team changes this. |