Bug 248222 - [Viewers] TreeViewerRow getNeighbor returns incorrect values
Summary: [Viewers] TreeViewerRow getNeighbor returns incorrect values
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-22 20:53 EDT by Evan Hourigan CLA
Modified: 2019-09-06 16:06 EDT (History)
2 users (show)

See Also:


Attachments
Patch to check if there are no children (1.46 KB, patch)
2008-09-29 15:18 EDT, Thomas Schindl CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Evan Hourigan CLA 2008-09-22 20:53:45 EDT
Build ID: 20080221-1800

Steps To Reproduce:
Use the following model with a JFace TreeViewer:

A
B
C

1. Make row B a child of row A:

A
+ B
C

2. Now remove row B and add under row A:

A
B
C


3.  When you call getNeighbor(ViewerRow.BELOW, false) on the ViewerRow corresponding to item A, it returns null, even though it should return a ViewerRow corresponding to item C.  This is because when it checks if the tree item is expanded, it returns true.  The tree item has no children however, so it should not be expanded.

As a result, all of our NavigationStrategy stuff is broken.
Comment 1 Thomas Schindl CLA 2008-09-23 01:27:49 EDT
> 2. Now remove row B and add under row A:
> 
> A
> B
> C
> 
> 
> 3.  When you call getNeighbor(ViewerRow.BELOW, false) on the ViewerRow
> corresponding to item A, it returns null, even though it should return a
> ViewerRow corresponding to item C.  This is because when it checks if the tree

Shouldn't it return B?

> item is expanded, it returns true.  The tree item has no children however, so
> it should not be expanded.
> 

Isn't then TreeItem the problem? It should not return true when it has no children, right? We could work around by also checking the number of TreeItems beside only the expansion state.

> As a result, all of our NavigationStrategy stuff is broken.
> 

Can you modify http://wiki.eclipse.org/JFaceSnippets#Snippet026TreeViewerTabEditing to show the problem?
Comment 2 Thomas Schindl CLA 2008-09-29 15:18:24 EDT
Created attachment 113798 [details]
Patch to check if there are no children

Evan can you please fetch JFace from HEAD, apply this patch and see if the bug is fixed then?
Comment 3 Thomas Schindl CLA 2010-01-28 17:11:02 EST
multi change because of intenion of stepping back as platform-ui committer
Comment 4 Eclipse Webmaster CLA 2019-09-06 16:06:21 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.