Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 167325

Summary: [Viewers]ViewerCell and ViewerRow should provide API to find neighbors
Product: [Eclipse Project] Platform Reporter: Thomas Schindl <tom.schindl>
Component: UIAssignee: Boris Bokowski <bokowski>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bokowski, bradleyjames, cgross, rmcamara, Tod_Creasey
Version: 3.3   
Target Milestone: 3.3 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 151295    
Attachments:
Description Flags
I banged my head against it now for a while but finally it's working ;-)
none
Addressing Boris requestes
none
Apply to HEAD cleanly
none
Extracted from Mega-Patch in151295 none

Description Thomas Schindl CLA 2006-12-09 12:23:01 EST
This is a very important feature if we want provide keyboard features in tables and trees and the current EditingSupport has TODO items to make this work in a clear way. I'd propose the following new API functions for ViewerCell:
- ViewerCell#getCellLeft()
- ViewerCell#getCellRight()
- ViewerCell#getCellTop()
- ViewerCell#getCellBottom()
- ViewerRow#getRowTop()
- ViewerRow#getRowBottom()

What I'm not 100% sure is if we should provide functions to navigate Tree-Structures:
- ViewerCell#getCellTop(boolean samelevel)
- ViewerCell#getCellBottom(boolean samelevel)
- ViewerRow#getRowTop(boolean samelevel)
- ViewerRow#getRowBottom(boolean samelevel)
Comment 1 Thomas Schindl CLA 2006-12-11 17:41:47 EST
Created attachment 55449 [details]
I banged my head against it now for a while but finally it's working ;-)

Support for Tables is really easy but the one for trees really really took sometime and I hope I have successfully identified all cases.
Comment 2 Boris Bokowski CLA 2006-12-19 12:14:49 EST
+1 but I would like us to use just one method per class together with constants for the direction:

ViewerCell.getNeighbor(int direction)

where direction can be one of
ViewerCell.ABOVE
ViewerCell.BELOW
ViewerCell.LEFT
ViewerCell.RIGHT
Comment 3 Thomas Schindl CLA 2006-12-19 13:35:32 EST
Created attachment 55916 [details]
Addressing Boris requestes

This addresses Boris concerns, fixes internals to speed up the Tree-search, fixes small bugs and provides access cell e.g. in the upper-left of the current cell using BITMASKs. You can give it a try using the snippet contained in the patch:

- TAB to travers horizontal right (at the end jump to the next row)
- SHIFT+TAB to travers horizontal left (at the begining jump to the above row)
- CTRL+TAB to travers vertically to the next row
- CTRL+SHIFT+TAB tor travers vertically to the above row

When I think about the names wouldn't it make sense to use:
- NORTH
- SOUTH
- EAST
- WEST
instead?
Comment 4 Thomas Schindl CLA 2006-12-26 16:26:34 EST
Created attachment 56191 [details]
Apply to HEAD cleanly
Comment 5 Thomas Schindl CLA 2006-12-26 16:35:10 EST
cc'ing chris because this is something Nebula has to implement
Comment 6 Thomas Schindl CLA 2007-01-18 08:47:17 EST
Created attachment 57078 [details]
Extracted from Mega-Patch in151295
Comment 7 Boris Bokowski CLA 2007-01-20 00:25:23 EST
Patch with improved Javadoc released >20070120.  See bug 171126 for outstanding issues with the implementation.