| Summary: | Import/Export checkbox tree states inconsistent | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Lynne Kues <lynne_kues> | ||||
| Component: | UI | Assignee: | Nick Edgar <n.a.edgar> | ||||
| Status: | RESOLVED WORKSFORME | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | martinae, Tod_Creasey | ||||
| Version: | 2.0 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows NT | ||||||
| Whiteboard: | |||||||
| Bug Depends on: | 6734 | ||||||
| Bug Blocks: | |||||||
| Attachments: |
|
||||||
|
Description
Lynne Kues
Agree. In general such trees should maintain the following invariants: - item is white checked IFF all children are checked - item is gray checked IFF some but not all children are checked - item is unchecked IFF all children are unchecked Note that there is special handling in the export dialog for the create directories option. If unchecked, it only creates directories for folders which are white-checked. I may have this wrong though. Tod can clarify. Same scenario exists on tree side also. Say you have the following hierarchy and you check off the root item (ItemA). Now if you uncheck one of its children (say ItemA1), ItemA will be grayed. Now recheck ItemA1. ItemA should be white, but it is not. -ItemA --ItemA1 ---ItemA1a ---ItemA1b --ItemA2 --ItemA3 ---ItemA3a Also if you select the root below (ItemA) and filter types on *.txt the tree check boxes are gray (vs. white). ItemA --itemA.txt --ItemA1 ---itemA1.txt --ItemA2 ---itemA2.txt And lastly, if you have all children of an item selected and then open the Export Wizard, the item will be gray checked (vs. white checked). Basically all callers of grayUpdateHierarchy(Object) in ResourceTreeAndListGroup need to call updateHierarchy(Object) instead. Also found a bug with the initial selection setting for the Export Wizard. I have a project hierarchy as follows: Test (project) -- My Documents (folder) ---- Licences (folder) ------ file.html (file) -- Spec (folder) Select the "My Documents" folder and open the Export Wizard. Expand the Text project. Select the Licences folder. Uncheck file.html. At this point the check box states are incorrect. Created attachment 232 [details]
zip file containing patched classes
Asked TC to review. This is currently working correctly. If you select a folder it becomes white selected. If you then deselect some of its entries it becomes gray selected as you have chosen to longer bring it all in. Now if you select all of the elements in it it stays gray selected as you have only selected the contents - not the folder itself. If we reselect the folder the user will be bringing in the folder as well as the files which is not what they chose to do as they had no selected the folder. sorry for reopening, but the current behaviour is not standard. The behaviour should be similar to VAJ: A container is checked and non-gray (white) when all its children are checked. We would like to reuse this component in the Javadoc generation wizard. also see bug 6734 (JAR packager) If folders are also considered to be selectable elements (e.g. you want to express that a folder is exported), a checkboxviewer without graystates is to use. Then, folders and files are independendly checkable and all combination of checked folders and files are expressable. Martin, could you please clarify what you mean by the last paragraph. If the use case is to only a export a folder directory but the not contained resource (resulting in an new, empty folder), then a bare check tree should be used. -> check state of the container is not derived the check state of the children This is the current behavior. Any whitechecked entry in either pane will be exported. It is currently not possible to export an empty directory. Gray means not exported, white means it is. |