Refactoring HasDataPresenter to save pending changes in a PendingState, pushing them to the view in a finally command at the end of the event loop. This change reduces the number of times that the view is updated in the same event loop and eliminates some special case logic designed to deal with concurrent updates to the view.  The pattern is fairly straightforward.  When we receive new data, a new row count, a change in selection, or a change in the keyboard selected row, we update the pending state.  In a finally command, we resolve the pending state by comparing it to the current state.  If none of the rows changed, we just update the keyboard selected row using DOM manipulation.  If less than 30% of the rows changed, we replace the changed rows.  If more than 30% of the rows changed, we redraw the entire table.

This change also fixes some bugs. CellTree now replaces the correct data when a range is replaced.  Previously, CellTree assumed that the new data always started at index 0.  CellBrowser now uses the keyboardSelectedRow index to determine which row is open in each list in the CellBrowser.  This removes a lot of logic from CellBrowser and fixes a UI bug where a row would appear hovered (yellow) before becoming open (gray).  It also reduces the number of times we render each list in the CellBrowser.  Mouse support has been fixed in CellTable using similar code to what already existed in CellTree. Clicking on a natively focusable element in CellTable no longer steals focus out to the Cell.

Sorry about the big patch, but these changes are interrelated.  I found a few of the bugs mentioned while working on the patch, and they have also been reported by users.

Review at http://gwt-code-reviews.appspot.com/1078801

Review by: sbrubaker@google.com

git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@9203 8db76d5a-ed1c-0410-87a9-c151d255dfc7
15 files changed