changeset 1989:28aeebda6a0b

Automated merge with ssh://jfxsrc.us.oracle.com//javafx/8.0/scrum/controls/jfx/rt
author jgiles
date Tue, 11 Dec 2012 20:52:25 +1300
parents a867b54962e3 28782b36e141
children 16381e29f371
files javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TableColumnHeader.java javafx-ui-controls/src/javafx/scene/control/TreeTableColumn.java
diffstat 20 files changed, 220 insertions(+), 208 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/TreeTableCellBehavior.java	Mon Dec 10 11:57:45 2012 -0800
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/TreeTableCellBehavior.java	Tue Dec 11 20:52:25 2012 +1300
@@ -64,7 +64,7 @@
 
     /** @{@inheritDoc} */
     @Override int getItemCount() {
-        return getTableControl().impl_getTreeItemCount();
+        return getTableControl().getExpandedItemCount();
     }
 
     /** @{@inheritDoc} */
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/TreeTableViewBehavior.java	Mon Dec 10 11:57:45 2012 -0800
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/TreeTableViewBehavior.java	Tue Dec 11 20:52:25 2012 +1300
@@ -137,7 +137,7 @@
 
     /** {@inheritDoc}  */
     @Override protected int getItemCount() {
-        return getControl().impl_getTreeItemCount();
+        return getControl().getExpandedItemCount();
     }
 
     /** {@inheritDoc}  */
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/TreeViewBehavior.java	Mon Dec 10 11:57:45 2012 -0800
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/TreeViewBehavior.java	Tue Dec 11 20:52:25 2012 +1300
@@ -333,7 +333,7 @@
     private void focusLastRow() {
         FocusModel fm = getControl().getFocusModel();
         if (fm == null) return;
-        fm.focus(getControl().impl_getTreeItemCount() - 1);
+        fm.focus(getControl().getExpandedItemCount() - 1);
         
         if (onMoveToLastCell != null) onMoveToLastCell.run();
     }
@@ -484,7 +484,7 @@
         if (fm == null) return;
 
         int focusIndex = fm.getFocusedIndex();
-        if (focusIndex == getControl().impl_getTreeItemCount() - 1) {
+        if (focusIndex == getControl().getExpandedItemCount() - 1) {
             return;
         }
 
@@ -494,14 +494,14 @@
     }
 
     private void selectFirstRow() {
-        if (getControl().impl_getTreeItemCount() > 0) {
+        if (getControl().getExpandedItemCount() > 0) {
             getControl().getSelectionModel().clearAndSelect(0);
             if (onMoveToFirstCell != null) onMoveToFirstCell.run();
         }
     }
 
     private void selectLastRow() {
-        getControl().getSelectionModel().clearAndSelect(getControl().impl_getTreeItemCount() - 1);
+        getControl().getSelectionModel().clearAndSelect(getControl().getExpandedItemCount() - 1);
         onMoveToLastCell.run();
     }
 
@@ -536,7 +536,7 @@
         }
         
         sm.clearSelection();
-        sm.selectRange(leadIndex, getControl().impl_getTreeItemCount() - 1);
+        sm.selectRange(leadIndex, getControl().getExpandedItemCount() - 1);
         
         if (isShiftDown) {
             setAnchor(leadIndex);
@@ -795,7 +795,7 @@
         if (fm == null) return;
 
         int index = fm.getFocusedIndex() + 1;
-        sm.selectRange(index, getControl().impl_getTreeItemCount());
+        sm.selectRange(index, getControl().getExpandedItemCount());
 
         if (onMoveToLastCell != null) onMoveToLastCell.run();
     }
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ComboBoxListViewSkin.java	Mon Dec 10 11:57:45 2012 -0800
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ComboBoxListViewSkin.java	Tue Dec 11 20:52:25 2012 +1300
@@ -124,8 +124,10 @@
         
         // move focus in to the textfield if the comboBox is editable
         comboBox.focusedProperty().addListener(new ChangeListener<Boolean>() {
-            @Override public void changed(ObservableValue<? extends Boolean> ov, Boolean t, Boolean t1) {
-                updateFakeFocus(comboBox.isFocused());
+            @Override public void changed(ObservableValue<? extends Boolean> ov, Boolean t, Boolean hasFocus) {
+                if (comboBox.isEditable()) {
+                    updateFakeFocus(hasFocus);
+                }
             }
         });
         
@@ -350,22 +352,15 @@
         // externally for people listening to the focus property.
         // Also, (for RT-21454) set the currently typed text as the value when focus 
         // is lost from the ComboBox
+        textField.addEventFilter(MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>() {
+            @Override public void handle(MouseEvent t) {
+                comboBox.requestFocus();
+                t.consume();
+            }
+        });
         textField.focusedProperty().addListener(new ChangeListener<Boolean>() {
             @Override public void changed(ObservableValue<? extends Boolean> ov, Boolean t, Boolean hasFocus) {
-                if (hasFocus) {
-                    // Using Platform.runLater here, as without it it seems we
-                    // enter into some form of race condition where we are 
-                    // wanting to set focus on the comboBox whilst the textField
-                    // is still notifying of its focus gain.
-                    // This issue was identified in RT-21088.
-                    Platform.runLater(new Runnable() {
-                        @Override public void run() {
-                            comboBox.requestFocus();
-                        }
-                    });
-                }
-                
-                updateFakeFocus(hasFocus);
+                if (! comboBox.isEditable()) return;
                 
                 // RT-21454 starts here
                 if (! hasFocus) {
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/NestedTableColumnHeader.java	Mon Dec 10 11:57:45 2012 -0800
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/NestedTableColumnHeader.java	Tue Dec 11 20:52:25 2012 +1300
@@ -355,7 +355,10 @@
     private List<Rectangle> dragRects = new ArrayList<Rectangle>();
     
     private boolean isColumnResizingEnabled() {
-        return ! PlatformUtil.isEmbedded();
+        // this used to check if ! PlatformUtil.isEmbedded(), but has been changed
+        // to always return true (for now), as we want to support column resizing
+        // everywhere
+        return true;
     }
 
     private void columnResizingStarted(double startX) {
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TableColumnHeader.java	Mon Dec 10 11:57:45 2012 -0800
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TableColumnHeader.java	Tue Dec 11 20:52:25 2012 +1300
@@ -349,12 +349,14 @@
     }
     
     private boolean isSortingEnabled() {
-        return ! PlatformUtil.isEmbedded();
+        // this used to check if ! PlatformUtil.isEmbedded(), but has been changed
+        // to always return true (for now), as we want to support column sorting
+        // everywhere
+        return true;
     }
     
     private boolean isColumnReorderingEnabled() {
         // we only allow for column reordering if there are more than one column,
-        // and if we are not on an embedded platform
         return ! PlatformUtil.isEmbedded() && getTableViewSkin().getVisibleLeafColumns().size() > 1;
     }
     
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TableViewSkin.java	Mon Dec 10 11:57:45 2012 -0800
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TableViewSkin.java	Tue Dec 11 20:52:25 2012 +1300
@@ -42,6 +42,7 @@
 import javafx.scene.control.ResizeFeaturesBase;
 import javafx.scene.control.TableCell;
 import javafx.scene.control.TableColumnBase;
+import javafx.scene.control.TablePositionBase;
 import javafx.scene.control.TableSelectionModel;
 import javafx.scene.layout.Region;
 
@@ -153,6 +154,11 @@
     }
 
     /** {@inheritDoc} */
+    @Override protected TablePositionBase getFocusedCell() {
+        return tableView.getFocusModel().getFocusedCell();
+    }
+    
+    /** {@inheritDoc} */
     @Override protected TableSelectionModel getSelectionModel() {
         return tableView.getSelectionModel();
     }
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TableViewSkinBase.java	Mon Dec 10 11:57:45 2012 -0800
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TableViewSkinBase.java	Tue Dec 11 20:52:25 2012 +1300
@@ -39,12 +39,6 @@
 import javafx.scene.control.Label;
 import javafx.scene.control.SelectionModel;
 
-// TODO remove references
-import javafx.scene.control.TableColumn;
-import javafx.scene.control.TableRow;
-import javafx.scene.control.TableView;
-import javafx.scene.control.TableView.TableViewFocusModel;
-
 import javafx.scene.layout.Region;
 import javafx.scene.layout.StackPane;
 import javafx.util.Callback;
@@ -55,7 +49,6 @@
 import javafx.beans.WeakInvalidationListener;
 import javafx.beans.property.BooleanProperty;
 import javafx.beans.property.ObjectProperty;
-import javafx.beans.value.ObservableObjectValue;
 import javafx.beans.value.WeakChangeListener;
 import javafx.collections.ObservableMap;
 import javafx.geometry.HPos;
@@ -64,13 +57,16 @@
 import javafx.scene.control.IndexedCell;
 import javafx.scene.control.ResizeFeaturesBase;
 import javafx.scene.control.TableColumnBase;
+import javafx.scene.control.TableFocusModel;
+import javafx.scene.control.TablePositionBase;
 import javafx.scene.control.TableSelectionModel;
 
 public abstract class TableViewSkinBase<S, C extends Control, B extends BehaviorBase<C>, I extends IndexedCell> extends VirtualContainerBase<C, B, I> {
     
 //    protected abstract void requestControlFocus(); // tableView.requestFocus();
     protected abstract TableSelectionModel getSelectionModel(); // tableView.getSelectionModel()
-    protected abstract TableViewFocusModel getFocusModel(); // tableView.getSelectionModel()
+    protected abstract TableFocusModel getFocusModel(); // tableView.getSelectionModel()
+    protected abstract TablePositionBase getFocusedCell();
     protected abstract ObservableList<? extends TableColumnBase/*<S,?>*/> getVisibleLeafColumns();
     protected abstract int getVisibleLeafIndex(TableColumnBase tc);
     protected abstract TableColumnBase getVisibleLeafColumn(int col);
@@ -334,7 +330,7 @@
      * if this is a horizontal container, then the scrolling will be to the right.
      */
     public int onScrollPageDown() {
-        TableRow lastVisibleCell = (TableRow) flow.getLastVisibleCellWithinViewPort();
+        IndexedCell lastVisibleCell = flow.getLastVisibleCellWithinViewPort();
         if (lastVisibleCell == null) return -1;
         
         int lastVisibleCellIndex = lastVisibleCell.getIndex();
@@ -348,7 +344,7 @@
             // if the last visible cell is selected, we want to shift that cell up
             // to be the top-most cell, or at least as far to the top as we can go.
             flow.showAsFirst(lastVisibleCell);
-            lastVisibleCell = (TableRow) flow.getLastVisibleCellWithinViewPort();
+            lastVisibleCell = flow.getLastVisibleCellWithinViewPort();
         } 
 
         int newSelectionIndex = lastVisibleCell.getIndex();
@@ -361,7 +357,7 @@
      * if this is a horizontal container, then the scrolling will be to the left.
      */
     public int onScrollPageUp() {
-        TableRow firstVisibleCell = (TableRow) flow.getFirstVisibleCellWithinViewPort();
+        IndexedCell firstVisibleCell = flow.getFirstVisibleCellWithinViewPort();
         if (firstVisibleCell == null) return -1;
         
         int firstVisibleCellIndex = firstVisibleCell.getIndex();
@@ -375,7 +371,7 @@
             // if the first visible cell is selected, we want to shift that cell down
             // to be the bottom-most cell, or at least as far to the bottom as we can go.
             flow.showAsLast(firstVisibleCell);
-            firstVisibleCell = (TableRow) flow.getFirstVisibleCellWithinViewPort();
+            firstVisibleCell = flow.getFirstVisibleCellWithinViewPort();
         } 
 
         int newSelectionIndex = firstVisibleCell.getIndex();
@@ -383,7 +379,7 @@
         return newSelectionIndex;
     }
     
-     boolean isColumnPartiallyOrFullyVisible(TableColumn col) {
+     boolean isColumnPartiallyOrFullyVisible(TableColumnBase col) {
         if (col == null || !col.isVisible()) return false;
         
         double scrollX = flow.getHbar().getValue(); 
@@ -656,14 +652,14 @@
     }
 
     protected void onFocusPreviousCell() {
-        TableViewFocusModel fm = getFocusModel();
+        TableFocusModel fm = getFocusModel();
         if (fm == null) return;
 
         flow.show(fm.getFocusedIndex());
     }
 
     protected void onFocusNextCell() {
-        TableViewFocusModel fm = getFocusModel();
+        TableFocusModel fm = getFocusModel();
         if (fm == null) return;
 
         flow.show(fm.getFocusedIndex());
@@ -695,14 +691,14 @@
     // and the newly selected cell belongs to a column which is not totally
     // visible.
     private void scrollHorizontally() {
-        TableViewFocusModel fm = getFocusModel();
+        TableFocusModel fm = getFocusModel();
         if (fm == null) return;
 
-        TableColumn col = fm.getFocusedCell().getTableColumn();
+        TableColumnBase col = getFocusedCell().getTableColumn();
         scrollHorizontally(col);
     }
     
-    private void scrollHorizontally(TableColumn col) {
+    private void scrollHorizontally(TableColumnBase col) {
         if (col == null || !col.isVisible()) return;
 
         // work out where this column header is, and it's width (start -> end)
@@ -765,7 +761,7 @@
     }
     
     private boolean isCellFocused(int row) {
-        TableViewFocusModel fm = getFocusModel();
+        TableFocusModel fm = getFocusModel();
         if (fm == null) return false;
 
         int columnCount = getVisibleLeafColumns().size();
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TreeTableViewSkin.java	Mon Dec 10 11:57:45 2012 -0800
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TreeTableViewSkin.java	Tue Dec 11 20:52:25 2012 +1300
@@ -44,6 +44,7 @@
 import javafx.scene.control.ResizeFeaturesBase;
 import javafx.scene.control.SelectionModel;
 import javafx.scene.control.TableColumnBase;
+import javafx.scene.control.TablePositionBase;
 import javafx.scene.control.TableSelectionModel;
 import javafx.scene.control.TableView;
 import javafx.scene.control.TreeItem;
@@ -133,7 +134,7 @@
         registerChangeListener(treeTableView.rootProperty(), "ROOT");
         registerChangeListener(treeTableView.showRootProperty(), "SHOW_ROOT");
         registerChangeListener(treeTableView.rowFactoryProperty(), "ROW_FACTORY");
-        registerChangeListener(treeTableView.impl_treeItemCountProperty(), "TREE_ITEM_COUNT");
+        registerChangeListener(treeTableView.expandedItemCountProperty(), "TREE_ITEM_COUNT");
         
         updateItemCount();
     }
@@ -202,7 +203,7 @@
                 // from the TreeItem root is an event where the count has changed.
                 EventType eventType = e.getEventType();
                 while (eventType != null) {
-                    if (eventType.equals(TreeItem.<S>treeItemCountChangeEvent())) {
+                    if (eventType.equals(TreeItem.<S>expandedItemCountChangeEvent())) {
                         needItemCountUpdate = true;
                         requestLayout();
                         break;
@@ -252,10 +253,13 @@
     }
 
     /** {@inheritDoc} */
-    @Override protected TableView.TableViewFocusModel getFocusModel() {
-//        return treeTableView.getFocusModel();
-        // TODO enable
-        return null;
+    @Override protected TreeTableView.TreeTableViewFocusModel getFocusModel() {
+        return treeTableView.getFocusModel();
+    }
+    
+    /** {@inheritDoc} */
+    @Override protected TablePositionBase getFocusedCell() {
+        return treeTableView.getFocusModel().getFocusedCell();
     }
 
     /** {@inheritDoc} */
@@ -352,7 +356,7 @@
     
     /** {@inheritDoc} */
     @Override public int getItemCount() {
-        return treeTableView.impl_getTreeItemCount();
+        return treeTableView.getExpandedItemCount();
     }
     
     /** {@inheritDoc} */
@@ -518,7 +522,7 @@
 
         @Override public int size() {
             if (size == -1) {
-                size = treeTable.impl_getTreeItemCount();
+                size = treeTable.getExpandedItemCount();
             }
             return size;
         }
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TreeViewSkin.java	Mon Dec 10 11:57:45 2012 -0800
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TreeViewSkin.java	Tue Dec 11 20:52:25 2012 +1300
@@ -167,7 +167,7 @@
                 // from the TreeItem root is an event where the count has changed.
                 EventType eventType = e.getEventType();
                 while (eventType != null) {
-                    if (eventType.equals(TreeItem.<T>treeItemCountChangeEvent())) {
+                    if (eventType.equals(TreeItem.<T>expandedItemCountChangeEvent())) {
                         needItemCountUpdate = true;
                         requestLayout();
                         break;
@@ -197,7 +197,7 @@
     }
 
     @Override public int getItemCount() {
-        return getSkinnable().impl_getTreeItemCount();
+        return getSkinnable().getExpandedItemCount();
     }
 
     private void updateItemCount() {
--- a/javafx-ui-controls/src/javafx/scene/control/ListCell.java	Mon Dec 10 11:57:45 2012 -0800
+++ b/javafx-ui-controls/src/javafx/scene/control/ListCell.java	Tue Dec 11 20:52:25 2012 +1300
@@ -102,29 +102,7 @@
      */
     private final InvalidationListener editingListener = new InvalidationListener() {
         @Override public void invalidated(Observable value) {
-            final int index = getIndex();
-            final ListView list = getListView();
-            final int editIndex = list == null ? -1 : list.getEditingIndex();
-            final boolean editing = isEditing();
-
-            // Check that the list is specified, and my index is not -1
-            if (index != -1 && list != null) {
-                // If my index is the index being edited and I'm not currently in
-                // the edit mode, then I need to enter the edit mode
-                if (index == editIndex && !editing) {
-                    startEdit();
-                } else if (index != editIndex && editing) {
-                    // If my index is not the one being edited then I need to cancel
-                    // the edit. The tricky thing here is that as part of this call
-                    // I cannot end up calling list.edit(-1) the way that the standard
-                    // cancelEdit method would do. Yet, I need to call cancelEdit
-                    // so that subclasses which override cancelEdit can execute. So,
-                    // I have to use a kind of hacky flag workaround.
-                    updateEditingIndex = false;
-                    cancelEdit();
-                    updateEditingIndex = true;
-                }
-            }
+            updateEditing();
         }
     };
     private boolean updateEditingIndex = true;
@@ -473,6 +451,32 @@
         
         setFocused(fm.isFocused(index));
     }
+    
+    private void updateEditing() {
+        final int index = getIndex();
+        final ListView list = getListView();
+        final int editIndex = list == null ? -1 : list.getEditingIndex();
+        final boolean editing = isEditing();
+
+        // Check that the list is specified, and my index is not -1
+        if (index != -1 && list != null) {
+            // If my index is the index being edited and I'm not currently in
+            // the edit mode, then I need to enter the edit mode
+            if (index == editIndex && !editing) {
+                startEdit();
+            } else if (index != editIndex && editing) {
+                // If my index is not the one being edited then I need to cancel
+                // the edit. The tricky thing here is that as part of this call
+                // I cannot end up calling list.edit(-1) the way that the standard
+                // cancelEdit method would do. Yet, I need to call cancelEdit
+                // so that subclasses which override cancelEdit can execute. So,
+                // I have to use a kind of hacky flag workaround.
+                updateEditingIndex = false;
+                cancelEdit();
+                updateEditingIndex = true;
+            }
+        }
+    }
      
 
     
--- a/javafx-ui-controls/src/javafx/scene/control/TreeCell.java	Mon Dec 10 11:57:45 2012 -0800
+++ b/javafx-ui-controls/src/javafx/scene/control/TreeCell.java	Tue Dec 11 20:52:25 2012 +1300
@@ -239,25 +239,26 @@
                 weakTreeViewRef = null;
             }
 
-            if (get() != null) {
-                sm = get().getSelectionModel();
+            TreeView treeView = get();
+            if (treeView != null) {
+                sm = treeView.getSelectionModel();
                 if (sm != null) {
                     // listening for changes to treeView.selectedIndex and IndexedCell.index,
                     // to determine if this cell is selected
                     sm.getSelectedIndices().addListener(weakSelectedListener);
                 }
 
-                fm = get().getFocusModel();
+                fm = treeView.getFocusModel();
                 if (fm != null) {
                     // similar to above, but this time for focus
                     fm.focusedIndexProperty().addListener(weakFocusedListener);
                 }
 
-                get().editingItemProperty().addListener(weakEditingListener);
-                get().focusModelProperty().addListener(weakFocusModelPropertyListener);
-                get().selectionModelProperty().addListener(weakSelectionModelPropertyListener);
+                treeView.editingItemProperty().addListener(weakEditingListener);
+                treeView.focusModelProperty().addListener(weakFocusModelPropertyListener);
+                treeView.selectionModelProperty().addListener(weakSelectionModelPropertyListener);
                 
-                weakTreeViewRef = new WeakReference<TreeView<T>>(get());
+                weakTreeViewRef = new WeakReference<TreeView<T>>(treeView);
             }
 
             updateItem();
@@ -368,7 +369,7 @@
 
         if (tree != null) {
             // reset the editing index on the TreeView
-            tree.edit(null);
+            if (updateEditingIndex) tree.edit(null);
             tree.requestFocus();
         
             tree.fireEvent(new TreeView.EditEvent<T>(tree,
@@ -406,7 +407,7 @@
         if (tv == null) return;
         
         // Compute whether the index for this cell is for a real item
-        boolean valid = getIndex() >=0 && getIndex() < tv.impl_getTreeItemCount();
+        boolean valid = getIndex() >=0 && getIndex() < tv.getExpandedItemCount();
 
         // Cause the cell to update itself
         if (valid) {
@@ -419,8 +420,10 @@
             // likely that events will be fired where the item is null, even
             // though calling cell.getTreeItem().getValue() returns the value
             // as expected
-            updateTreeItem(_treeItem);
-            updateItem(_treeItem == null ? null : _treeItem.getValue(), false);
+            if (_treeItem == null || ! _treeItem.equals(getTreeItem())) {
+                updateTreeItem(_treeItem);
+                updateItem(_treeItem == null ? null : _treeItem.getValue(), false);
+            }
         } else {
             updateTreeItem(null);
             updateItem(null, true);
@@ -445,14 +448,32 @@
         setFocused(getTreeView().getFocusModel().isFocused(getIndex()));
     }
 
+    private boolean updateEditingIndex = true;
     private void updateEditing() {
-        if (getIndex() == -1 || getTreeView() == null || getTreeItem() == null) return;
+        final int index = getIndex();
+        final TreeView tree = getTreeView();
+        final TreeItem treeItem = getTreeItem();
+        final TreeItem editItem = tree == null ? null : tree.getEditingItem();
+        final boolean editing = isEditing();
         
-        TreeItem editItem = getTreeView().getEditingItem();
-        if (! isEditing() && getTreeItem().equals(editItem)) {
+        if (index == -1 || tree == null || treeItem == null) return;
+        
+        final boolean match = treeItem.equals(editItem);
+        
+        // If my tree item is the item being edited and I'm not currently in
+        // the edit mode, then I need to enter the edit mode
+        if (match && !editing) {
             startEdit();
-        } else if (isEditing() && ! getTreeItem().equals(editItem)) {
+        } else if (match && editing) {
+            // If my tree item is not the one being edited then I need to cancel
+            // the edit. The tricky thing here is that as part of this call
+            // I cannot end up calling tree.edit(null) the way that the standard
+            // cancelEdit method would do. Yet, I need to call cancelEdit
+            // so that subclasses which override cancelEdit can execute. So,
+            // I have to use a kind of hacky flag workaround.
+            updateEditingIndex = false;
             cancelEdit();
+            updateEditingIndex = true;
         }
     }
 
--- a/javafx-ui-controls/src/javafx/scene/control/TreeItem.java	Mon Dec 10 11:57:45 2012 -0800
+++ b/javafx-ui-controls/src/javafx/scene/control/TreeItem.java	Tue Dec 11 20:52:25 2012 +1300
@@ -238,11 +238,11 @@
      * @param <T> The type of the value contained within the TreeItem.
      */
     @SuppressWarnings("unchecked")
-    public static <T> EventType<TreeModificationEvent<T>> treeItemCountChangeEvent() {
-        return (EventType<TreeModificationEvent<T>>) TREE_ITEM_COUNT_CHANGE_EVENT;
+    public static <T> EventType<TreeModificationEvent<T>> expandedItemCountChangeEvent() {
+        return (EventType<TreeModificationEvent<T>>) EXPANDED_ITEM_COUNT_CHANGE_EVENT;
     }
-    private static final EventType TREE_ITEM_COUNT_CHANGE_EVENT
-            = new EventType(treeNotificationEvent(), "TreeItemCountChangeEvent");
+    private static final EventType EXPANDED_ITEM_COUNT_CHANGE_EVENT
+            = new EventType(treeNotificationEvent(), "ExpandedItemCountChangeEvent");
 
     /**
      * An EventType used when the TreeItem receives a modification to its
@@ -255,7 +255,7 @@
         return (EventType<TreeModificationEvent<T>>) BRANCH_EXPANDED_EVENT;
     }
     private static final EventType<?> BRANCH_EXPANDED_EVENT
-            = new EventType(treeItemCountChangeEvent(), "BranchExpandedEvent");
+            = new EventType(expandedItemCountChangeEvent(), "BranchExpandedEvent");
 
     /**
      * An EventType used when the TreeItem receives a modification to its
@@ -268,7 +268,7 @@
         return (EventType<TreeModificationEvent<T>>) BRANCH_COLLAPSED_EVENT;
     }
     private static final EventType<?> BRANCH_COLLAPSED_EVENT
-            = new EventType(treeItemCountChangeEvent(), "BranchCollapsedEvent");
+            = new EventType(expandedItemCountChangeEvent(), "BranchCollapsedEvent");
 
     /**
      * An EventType used when the TreeItem receives a direct modification to its
@@ -281,7 +281,7 @@
         return (EventType<TreeModificationEvent<T>>) CHILDREN_MODIFICATION_EVENT;
     }
     private static final EventType<?> CHILDREN_MODIFICATION_EVENT
-            = new EventType(treeItemCountChangeEvent(), "ChildrenModificationEvent");
+            = new EventType(expandedItemCountChangeEvent(), "ChildrenModificationEvent");
 
     /**
      * An EventType used when the TreeItem receives a modification to its
@@ -344,7 +344,7 @@
         setValue(value);
         setGraphic(graphic);
         
-        addEventHandler(TreeItem.<Object>treeItemCountChangeEvent(), itemListener);
+        addEventHandler(TreeItem.<Object>expandedItemCountChangeEvent(), itemListener);
     }
     
     private final EventHandler<TreeModificationEvent<Object>> itemListener = 
--- a/javafx-ui-controls/src/javafx/scene/control/TreeTableCell.java	Mon Dec 10 11:57:45 2012 -0800
+++ b/javafx-ui-controls/src/javafx/scene/control/TreeTableCell.java	Tue Dec 11 20:52:25 2012 +1300
@@ -476,7 +476,7 @@
         }
         
         // get the total number of items in the data model
-        int itemCount = getTreeTableView().impl_getTreeItemCount();
+        int itemCount = getTreeTableView().getExpandedItemCount();
         
         if (getIndex() >= itemCount) {
             updateItem(null, true);
--- a/javafx-ui-controls/src/javafx/scene/control/TreeTableColumn.java	Mon Dec 10 11:57:45 2012 -0800
+++ b/javafx-ui-controls/src/javafx/scene/control/TreeTableColumn.java	Tue Dec 11 20:52:25 2012 +1300
@@ -518,7 +518,7 @@
         
         // Get the table
         final TreeTableView<S> table = getTreeTableView();
-        if (table == null || index >= table.impl_getTreeItemCount()) return null;
+        if (table == null || index >= table.getExpandedItemCount()) return null;
         
         // Get the rowData
         TreeItem<S> item = table.getTreeItem(index);
@@ -798,7 +798,7 @@
 
             TreeTableView treeTable = getTreeTableView();
             int row = pos.getRow();
-            if (row < 0 || row >= treeTable.impl_getTreeItemCount()) return null;
+            if (row < 0 || row >= treeTable.getExpandedItemCount()) return null;
 
             return treeTable.getTreeItem(row);
         }
--- a/javafx-ui-controls/src/javafx/scene/control/TreeTableRow.java	Mon Dec 10 11:57:45 2012 -0800
+++ b/javafx-ui-controls/src/javafx/scene/control/TreeTableRow.java	Tue Dec 11 20:52:25 2012 +1300
@@ -325,7 +325,7 @@
         if (tv == null) return;
         
         // Compute whether the index for this cell is for a real item
-        boolean valid = getIndex() >=0 && getIndex() < tv.impl_getTreeItemCount();
+        boolean valid = getIndex() >=0 && getIndex() < tv.getExpandedItemCount();
 
         // get the new treeItem that is about to go in to the TreeCell
         TreeItem<T> treeItem = valid ? tv.getTreeItem(getIndex()) : null;
--- a/javafx-ui-controls/src/javafx/scene/control/TreeTableView.java	Mon Dec 10 11:57:45 2012 -0800
+++ b/javafx-ui-controls/src/javafx/scene/control/TreeTableView.java	Tue Dec 11 20:52:25 2012 +1300
@@ -42,6 +42,8 @@
 import javafx.beans.property.BooleanProperty;
 import javafx.beans.property.IntegerProperty;
 import javafx.beans.property.ObjectProperty;
+import javafx.beans.property.ReadOnlyIntegerProperty;
+import javafx.beans.property.ReadOnlyIntegerWrapper;
 import javafx.beans.property.ReadOnlyObjectProperty;
 import javafx.beans.property.ReadOnlyObjectWrapper;
 import javafx.beans.property.SimpleBooleanProperty;
@@ -271,7 +273,7 @@
         getStyleClass().setAll(DEFAULT_STYLE_CLASS);
 
         setRoot(root);
-        updateTreeItemCount(root);
+        updateExpandedItemCount(root);
 
         // install default selection and focus models - it's unlikely this will be changed
         // by many users.
@@ -483,7 +485,7 @@
     // used in the tree item modification event listener. Used by the 
     // layoutChildren method to determine whether the tree item count should
     // be recalculated.
-    private boolean treeItemCountDirty = true;
+    private boolean expandedItemCountDirty = true;
 
     // this is the only publicly writable list for columns. This represents the
     // columns as they are given initially by the developer.
@@ -525,7 +527,7 @@
             EventType eventType = e.getEventType();
             boolean match = false;
             while (eventType != null) {
-                if (eventType.equals(TreeItem.<S>treeItemCountChangeEvent())) {
+                if (eventType.equals(TreeItem.<S>expandedItemCountChangeEvent())) {
                     match = true;
                     break;
                 }
@@ -533,7 +535,7 @@
             }
             
             if (match) {
-                treeItemCountDirty = true;
+                expandedItemCountDirty = true;
                 requestLayout();
             }
         }
@@ -617,7 +619,7 @@
                 weakOldItem = new WeakReference<TreeItem<S>>(root);
             }
 
-            treeItemCountDirty = true;
+            expandedItemCountDirty = true;
             updateRootExpanded();
         }
     };
@@ -681,7 +683,7 @@
             showRoot = new SimpleBooleanProperty(this, "showRoot", true) {
                 @Override protected void invalidated() {
                     updateRootExpanded();
-                    updateTreeItemCount(getRoot());
+                    updateExpandedItemCount(getRoot());
                 }
             };
         }
@@ -783,39 +785,27 @@
     
     
     // --- Tree node count
-    private IntegerProperty treeItemCount = new SimpleIntegerProperty(this, "impl_treeItemCount", 0);
-
-    private void setTreeItemCount(int value) {
-        impl_treeItemCountProperty().set(value);
-    }
-
     /**
      * <p>Represents the number of tree nodes presently able to be visible in the
-     * TreeTableView. This is essentially the count of all expanded tree nodes, and
+     * TreeTableView. This is essentially the count of all expanded tree items, and
      * their children.
      *
-     * <p>For example, if just the root node is visible, the treeItemCount will
+     * <p>For example, if just the root node is visible, the expandedItemCount will
      * be one. If the root had three children and the root was expanded, the value
      * will be four.
-     * 
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
      */
-    @Deprecated
-    public final int impl_getTreeItemCount() {
-        if (treeItemCountDirty) {
-            updateTreeItemCount(getRoot());
+    private ReadOnlyIntegerWrapper expandedItemCount = new ReadOnlyIntegerWrapper(this, "expandedItemCount", 0);
+    public final ReadOnlyIntegerProperty expandedItemCountProperty() {
+        return expandedItemCount.getReadOnlyProperty();
+    }
+    private void setExpandedItemCount(int value) {
+        expandedItemCount.set(value);
+    }
+    public final int getExpandedItemCount() {
+        if (expandedItemCountDirty) {
+            updateExpandedItemCount(getRoot());
         }
-        return treeItemCount.get();
-    }
-
-    /**
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
-     */
-    @Deprecated
-    public final IntegerProperty impl_treeItemCountProperty() {
-        return treeItemCount;
+        return expandedItemCount.get();
     }
     
     
@@ -1156,8 +1146,8 @@
     
     /** {@inheritDoc} */
     @Override protected void layoutChildren() {
-        if (treeItemCountDirty) {
-            updateTreeItemCount(getRoot());
+        if (expandedItemCountDirty) {
+            updateExpandedItemCount(getRoot());
         }
         
         super.layoutChildren();
@@ -1201,7 +1191,7 @@
      *      be found.
      */
     public int getRow(TreeItem<S> item) {
-        return TreeUtil.getRow(item, getRoot(), treeItemCountDirty, isShowRoot());
+        return TreeUtil.getRow(item, getRoot(), expandedItemCountDirty, isShowRoot());
     }
 
     /**
@@ -1213,7 +1203,7 @@
     public TreeItem<S> getTreeItem(int row) {
         // normalize the requested row based on whether showRoot is set
         int r = isShowRoot() ? row : (row + 1);
-        return TreeUtil.getItem(getRoot(), r, treeItemCountDirty);
+        return TreeUtil.getItem(getRoot(), r, expandedItemCountDirty);
     }
     
     /**
@@ -1312,9 +1302,9 @@
      *                                                                         *
      **************************************************************************/
     
-    private void updateTreeItemCount(TreeItem treeItem) {
-        setTreeItemCount(TreeUtil.updateTreeItemCount(treeItem, treeItemCountDirty, isShowRoot()));
-        treeItemCountDirty = false;
+    private void updateExpandedItemCount(TreeItem treeItem) {
+        setExpandedItemCount(TreeUtil.updateExpandedItemCount(treeItem, expandedItemCountDirty, isShowRoot()));
+        expandedItemCountDirty = false;
     }
 
     private void updateRootExpanded() {
@@ -1695,12 +1685,12 @@
         
         private void updateTreeEventListener(TreeItem<S> oldRoot, TreeItem<S> newRoot) {
             if (oldRoot != null && weakTreeItemListener != null) {
-                oldRoot.removeEventHandler(TreeItem.<S>treeItemCountChangeEvent(), weakTreeItemListener);
+                oldRoot.removeEventHandler(TreeItem.<S>expandedItemCountChangeEvent(), weakTreeItemListener);
             }
             
             if (newRoot != null) {
                 weakTreeItemListener = new WeakEventHandler(treeItemListener);
-                newRoot.addEventHandler(TreeItem.<S>treeItemCountChangeEvent(), weakTreeItemListener);
+                newRoot.addEventHandler(TreeItem.<S>expandedItemCountChangeEvent(), weakTreeItemListener);
             }
         }
         
@@ -2204,7 +2194,7 @@
         }
 
         private int getRowCount() {
-            return treeTableView.impl_getTreeItemCount();
+            return treeTableView.getExpandedItemCount();
         }
 
         @Override public TreeItem<S> getModelItem(int index) {
@@ -2212,7 +2202,7 @@
         }
 
         @Override protected int getItemCount() {
-            return treeTableView.impl_getTreeItemCount();
+            return treeTableView.getExpandedItemCount();
         }
     }
     
@@ -2265,12 +2255,12 @@
         
         private void updateTreeEventListener(TreeItem<S> oldRoot, TreeItem<S> newRoot) {
             if (oldRoot != null && weakTreeItemListener != null) {
-                oldRoot.removeEventHandler(TreeItem.<S>treeItemCountChangeEvent(), weakTreeItemListener);
+                oldRoot.removeEventHandler(TreeItem.<S>expandedItemCountChangeEvent(), weakTreeItemListener);
             }
             
             if (newRoot != null) {
                 weakTreeItemListener = new WeakEventHandler(treeItemListener);
-                newRoot.addEventHandler(TreeItem.<S>treeItemCountChangeEvent(), weakTreeItemListener);
+                newRoot.addEventHandler(TreeItem.<S>expandedItemCountChangeEvent(), weakTreeItemListener);
             }
         }
         
@@ -2328,7 +2318,7 @@
         @Override protected int getItemCount() {
 //            if (tableView.getItems() == null) return -1;
 //            return tableView.getItems().size();
-            return treeTableView.impl_getTreeItemCount();
+            return treeTableView.getExpandedItemCount();
         }
 
         /** {@inheritDoc} */
--- a/javafx-ui-controls/src/javafx/scene/control/TreeUtil.java	Mon Dec 10 11:57:45 2012 -0800
+++ b/javafx-ui-controls/src/javafx/scene/control/TreeUtil.java	Tue Dec 11 20:52:25 2012 +1300
@@ -39,7 +39,7 @@
         return node.getExpandedDescendentCount(treeItemCountDirty);
     }
     
-    static int updateTreeItemCount(TreeItem treeItem, boolean treeItemCountDirty, boolean isShowRoot) {
+    static int updateExpandedItemCount(TreeItem treeItem, boolean treeItemCountDirty, boolean isShowRoot) {
         if (treeItem == null) {
             return 0;
         } else if (! treeItem.isExpanded()) {
--- a/javafx-ui-controls/src/javafx/scene/control/TreeView.java	Mon Dec 10 11:57:45 2012 -0800
+++ b/javafx-ui-controls/src/javafx/scene/control/TreeView.java	Tue Dec 11 20:52:25 2012 +1300
@@ -44,6 +44,8 @@
 import com.sun.javafx.scene.control.skin.VirtualContainerBase;
 import java.lang.ref.WeakReference;
 import javafx.beans.DefaultProperty;
+import javafx.beans.property.ReadOnlyIntegerProperty;
+import javafx.beans.property.ReadOnlyIntegerWrapper;
 import javafx.beans.property.SimpleBooleanProperty;
 import javafx.beans.property.ReadOnlyObjectProperty;
 import javafx.beans.property.ReadOnlyObjectWrapper;
@@ -231,7 +233,7 @@
         getStyleClass().setAll("tree-view");
 
         setRoot(root);
-        updateTreeItemCount(root);
+        updateExpandedItemCount(root);
 
         // install default selection and focus models - it's unlikely this will be changed
         // by many users.
@@ -251,7 +253,7 @@
     // used in the tree item modification event listener. Used by the 
     // layoutChildren method to determine whether the tree item count should
     // be recalculated.
-    private boolean treeItemCountDirty = true;
+    private boolean expandedItemCountDirty = true;
     
     
     /***************************************************************************
@@ -270,7 +272,7 @@
             EventType eventType = e.getEventType();
             boolean match = false;
             while (eventType != null) {
-                if (eventType.equals(TreeItem.<T>treeItemCountChangeEvent())) {
+                if (eventType.equals(TreeItem.<T>expandedItemCountChangeEvent())) {
                     match = true;
                     break;
                 }
@@ -278,7 +280,7 @@
             }
             
             if (match) {
-                treeItemCountDirty = true;
+                expandedItemCountDirty = true;
                 requestLayout();
             }
         }
@@ -353,7 +355,7 @@
                 weakOldItem = new WeakReference<TreeItem<T>>(root);
             }
 
-            treeItemCountDirty = true;
+            expandedItemCountDirty = true;
             updateRootExpanded();
         }
     };
@@ -417,7 +419,7 @@
             showRoot = new SimpleBooleanProperty(this, "showRoot", true) {
                 @Override protected void invalidated() {
                     updateRootExpanded();
-                    updateTreeItemCount(getRoot());
+                    updateExpandedItemCount(getRoot());
                 }
             };
         }
@@ -490,42 +492,31 @@
     }
     
     
-    // --- Tree node count
-    private IntegerProperty treeItemCount = new SimpleIntegerProperty(this, "impl_treeItemCount", 0);
-
-    private void setTreeItemCount(int value) {
-        impl_treeItemCountProperty().set(value);
+    // --- Expanded node count
+    /**
+     * <p>Represents the number of tree nodes presently able to be visible in the
+     * TreeView. This is essentially the count of all expanded tree items, and
+     * their children.
+     *
+     * <p>For example, if just the root node is visible, the expandedItemCount will
+     * be one. If the root had three children and the root was expanded, the value
+     * will be four.
+     */
+    private ReadOnlyIntegerWrapper expandedItemCount = new ReadOnlyIntegerWrapper(this, "expandedItemCount", 0);
+    public final ReadOnlyIntegerProperty expandedItemCountProperty() {
+        return expandedItemCount.getReadOnlyProperty();
+    }
+    private void setExpandedItemCount(int value) {
+        expandedItemCount.set(value);
+    }
+    public final int getExpandedItemCount() {
+        if (expandedItemCountDirty) {
+            updateExpandedItemCount(getRoot());
+        }
+        return expandedItemCount.get();
     }
 
-    /**
-     * <p>Represents the number of tree nodes presently able to be visible in the
-     * TreeView. This is essentially the count of all expanded tree nodes, and
-     * their children.
-     *
-     * <p>For example, if just the root node is visible, the treeItemCount will
-     * be one. If the root had three children and the root was expanded, the value
-     * will be four.
-     * 
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
-     */
-    @Deprecated
-    public final int impl_getTreeItemCount() {
-        if (treeItemCountDirty) {
-            updateTreeItemCount(getRoot());
-        }
-        return treeItemCount.get();
-    }
 
-    /**
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
-     */
-    @Deprecated
-    public final IntegerProperty impl_treeItemCountProperty() {
-        return treeItemCount;
-    }
-    
     
     // --- Editable
     private BooleanProperty editable;
@@ -701,8 +692,8 @@
     
     /** {@inheritDoc} */
     @Override protected void layoutChildren() {
-        if (treeItemCountDirty) {
-            updateTreeItemCount(getRoot());
+        if (expandedItemCountDirty) {
+            updateExpandedItemCount(getRoot());
         }
         
         super.layoutChildren();
@@ -746,7 +737,7 @@
      *      be found.
      */
     public int getRow(TreeItem<T> item) {
-        return TreeUtil.getRow(item, getRoot(), treeItemCountDirty, isShowRoot());
+        return TreeUtil.getRow(item, getRoot(), expandedItemCountDirty, isShowRoot());
     }
 
     /**
@@ -758,7 +749,7 @@
     public TreeItem<T> getTreeItem(int row) {
         // normalize the requested row based on whether showRoot is set
         int r = isShowRoot() ? row : (row + 1);
-        return TreeUtil.getItem(getRoot(), r, treeItemCountDirty);
+        return TreeUtil.getItem(getRoot(), r, expandedItemCountDirty);
     }
 
     /** {@inheritDoc} */
@@ -772,9 +763,9 @@
      *                                                                         *
      **************************************************************************/  
     
-    private void updateTreeItemCount(TreeItem treeItem) {
-        setTreeItemCount(TreeUtil.updateTreeItemCount(treeItem, treeItemCountDirty, isShowRoot()));
-        treeItemCountDirty = false;
+    private void updateExpandedItemCount(TreeItem treeItem) {
+        setExpandedItemCount(TreeUtil.updateExpandedItemCount(treeItem, expandedItemCountDirty, isShowRoot()));
+        expandedItemCountDirty = false;
     }
 
     private void updateRootExpanded() {
@@ -898,12 +889,12 @@
         
         private void updateTreeEventListener(TreeItem<T> oldRoot, TreeItem<T> newRoot) {
             if (oldRoot != null && weakTreeItemListener != null) {
-                oldRoot.removeEventHandler(TreeItem.<T>treeItemCountChangeEvent(), weakTreeItemListener);
+                oldRoot.removeEventHandler(TreeItem.<T>expandedItemCountChangeEvent(), weakTreeItemListener);
             }
             
             if (newRoot != null) {
                 weakTreeItemListener = new WeakEventHandler(treeItemListener);
-                newRoot.addEventHandler(TreeItem.<T>treeItemCountChangeEvent(), weakTreeItemListener);
+                newRoot.addEventHandler(TreeItem.<T>expandedItemCountChangeEvent(), weakTreeItemListener);
             }
         }
         
@@ -1011,7 +1002,7 @@
             
             // Fix for RT-15419. We eagerly update the tree item count, such that
             // selection occurs on the row
-            treeView.updateTreeItemCount(treeView.getRoot());
+            treeView.updateExpandedItemCount(treeView.getRoot());
             
             // We have no option but to iterate through the model and select the
             // first occurrence of the given object. Once we find the first one, we
@@ -1053,14 +1044,14 @@
         
         /** {@inheritDoc} */
         @Override protected int getItemCount() {
-            return treeView == null ? 0 : treeView.impl_getTreeItemCount();
+            return treeView == null ? 0 : treeView.getExpandedItemCount();
         }
 
         /** {@inheritDoc} */
         @Override public TreeItem<T> getModelItem(int index) {
             if (treeView == null) return null;
 
-            if (index < 0 || index >= treeView.impl_getTreeItemCount()) return null;
+            if (index < 0 || index >= treeView.getExpandedItemCount()) return null;
 
             return treeView.getTreeItem(index);
         }
@@ -1094,12 +1085,12 @@
         
         private void updateTreeEventListener(TreeItem<T> oldRoot, TreeItem<T> newRoot) {
             if (oldRoot != null && weakTreeItemListener != null) {
-                oldRoot.removeEventHandler(TreeItem.<T>treeItemCountChangeEvent(), weakTreeItemListener);
+                oldRoot.removeEventHandler(TreeItem.<T>expandedItemCountChangeEvent(), weakTreeItemListener);
             }
             
             if (newRoot != null) {
                 weakTreeItemListener = new WeakEventHandler(treeItemListener);
-                newRoot.addEventHandler(TreeItem.<T>treeItemCountChangeEvent(), weakTreeItemListener);
+                newRoot.addEventHandler(TreeItem.<T>expandedItemCountChangeEvent(), weakTreeItemListener);
             }
         }
         
@@ -1154,13 +1145,13 @@
         private WeakEventHandler weakTreeItemListener;
 
         @Override protected int getItemCount() {
-            return treeView == null ? -1 : treeView.impl_getTreeItemCount();
+            return treeView == null ? -1 : treeView.getExpandedItemCount();
         }
 
         @Override protected TreeItem<T> getModelItem(int index) {
             if (treeView == null) return null;
 
-            if (index < 0 || index >= treeView.impl_getTreeItemCount()) return null;
+            if (index < 0 || index >= treeView.getExpandedItemCount()) return null;
 
             return treeView.getTreeItem(index);
         }
--- a/javafx-ui-controls/test/javafx/scene/control/TreeViewTest.java	Mon Dec 10 11:57:45 2012 -0800
+++ b/javafx-ui-controls/test/javafx/scene/control/TreeViewTest.java	Tue Dec 11 20:52:25 2012 +1300
@@ -233,7 +233,7 @@
         // despite the fact there are children in this tree, in reality none are
         // visible as the root node has no children (only siblings), and the
         // root node is not visible.
-        assertEquals(0, treeView.impl_getTreeItemCount());
+        assertEquals(0, treeView.getExpandedItemCount());
         
         assertEquals(-1, treeView.getRow(root));
         assertEquals(-1, treeView.getRow(child1));