changeset 312:c6b688029bed

Automated merge with ssh://jfxsrc.us.oracle.com//javafx/2.1/MASTER/jfx/rt
author David Grieve<david.grieve@oracle.com>
date Tue, 24 Jan 2012 10:46:20 -0500
parents 627b0b1f20b6 a5e9c6a82052
children 3c8653f1768b
files
diffstat 30 files changed, 1651 insertions(+), 497 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-designtime/src/javafx/scene/layout/GridPaneDesignInfo.java	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-designtime/src/javafx/scene/layout/GridPaneDesignInfo.java	Tue Jan 24 10:46:20 2012 -0500
@@ -72,6 +72,9 @@
 
         // Compute row height
         double[] rowHeights = pane.getRowHeights();
+        if (rowHeights == null) {
+            rowHeights = new double[] {0};
+        }
         double minY = top;
         double height = rowHeights[rowIndex];
 
@@ -81,6 +84,9 @@
 
         // Compute column width
         double[] columnWidths = pane.getColumnWidths();
+        if (columnWidths == null) {
+            columnWidths = new double[] {0};
+        }
         double minX = left;
         double width = columnWidths[columnIndex];
 
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/CellSkinBase.java	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/CellSkinBase.java	Tue Jan 24 10:46:20 2012 -0500
@@ -53,6 +53,7 @@
      * is settable from CSS
      */
     private DoubleProperty cellSize;
+    private boolean cellSizeSet = false;
 
     public final double getCellSize() {
         return cellSize == null ? DEFAULT_CELL_SIZE : cellSize.get();
@@ -68,7 +69,8 @@
 
                 @Override
                 public void set(double value) {
-                    
+                    cellSizeSet = true;
+                    super.set(value);
                 }
                 
                 @Override
@@ -101,6 +103,10 @@
         consumeMouseEvents(false);
     }
 
+    @Override
+    protected double computePrefHeight(double width) {
+        return cellSizeSet ? getCellSize(): super.computePrefHeight(width);
+    }
 
 
     /***************************************************************************
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ComboBoxBaseSkin.java	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ComboBoxBaseSkin.java	Tue Jan 24 10:46:20 2012 -0500
@@ -117,14 +117,14 @@
             updateDisplayArea();
         }
         
-        final Insets padding = getPadding();
-        final Insets arrowButtonPadding = arrowButton.getPadding();
+        final Insets padding = getInsets();
+        final Insets arrowButtonPadding = arrowButton.getInsets();
 
         // x, y, w, h are the content area that will hold the label and arrow */
         final double x = padding.getLeft();
         final double y = padding.getTop();
-        final double w = getWidth() - (padding.getLeft() + padding.getRight());
-        final double h = getHeight() - (padding.getTop() + padding.getBottom());
+        final double w = getSkinnable().getWidth() - (padding.getLeft() + padding.getRight());
+        final double h = getSkinnable().getHeight() - (padding.getTop() + padding.getBottom());
 
         final double arrowWidth = arrow.prefWidth(-1);
         final double arrowButtonWidth = arrowButtonPadding.getLeft() + arrowWidth + arrowButtonPadding.getRight();
@@ -143,15 +143,16 @@
     }
     
     @Override protected double computePrefHeight(double width) {
-        final Insets padding = getPadding();
-        final Insets arrowButtonPadding = arrowButton.getPadding();
-        double arrowHeight = arrowButtonPadding.getTop() + arrow.prefHeight(-1) + arrowButtonPadding.getBottom();
+        final Insets padding = getInsets();
 
-        double ph = displayNode == null ? 24 : displayNode.prefHeight(width);
-        
-        return padding.getTop()
-                + Math.max(ph, arrowHeight)
-                + padding.getBottom();
+        if (displayNode == null) {
+            final int DEFAULT_HEIGHT = 20;
+            final Insets arrowButtonPadding = arrowButton.getInsets();
+            double arrowHeight = arrowButtonPadding.getTop() + arrow.prefHeight(-1) + arrowButtonPadding.getBottom();
+            return padding.getTop() + Math.max(DEFAULT_HEIGHT, arrowHeight) + padding.getBottom();
+        } else {
+            return displayNode.prefHeight(width);
+        }
     }
 
     @Override protected double computeMaxWidth(double height) {
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ComboBoxListViewSkin.java	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ComboBoxListViewSkin.java	Tue Jan 24 10:46:20 2012 -0500
@@ -25,6 +25,7 @@
 
 package com.sun.javafx.scene.control.skin;
 
+import com.sun.javafx.scene.control.WeakListChangeListener;
 import javafx.scene.control.ComboBox;
 import com.sun.javafx.scene.control.behavior.ComboBoxListViewBehavior;
 import java.util.List;
@@ -32,6 +33,7 @@
 import javafx.beans.Observable;
 import javafx.beans.value.ChangeListener;
 import javafx.beans.value.ObservableValue;
+import javafx.collections.ListChangeListener;
 import javafx.collections.ObservableList;
 import javafx.event.EventHandler;
 import javafx.event.EventTarget;
@@ -53,6 +55,8 @@
     
     private final ListView<T> listView;
     
+    private ObservableList<T> listViewItems;
+    
     public ComboBoxListViewSkin(final ComboBox<T> comboBox) {
         super(comboBox, new ComboBoxListViewBehavior<T>(comboBox));
         this.comboBox = comboBox;
@@ -67,38 +71,45 @@
             }
         });
         
-        updateItemsListener(null, comboBox.getItems());
-        comboBox.itemsProperty().addListener(new ChangeListener<ObservableList<T>>() {
-            @Override 
-            public void changed(ObservableValue<? extends ObservableList<T>> ov, ObservableList<T> t, ObservableList<T> t1) {
-                updateItemsListener(t, t1);
-            }
-        });
+        updateListViewItems();
         
+        registerChangeListener(comboBox.itemsProperty(), "ITEMS");
         registerChangeListener(comboBox.promptTextProperty(), "PROMPT_TEXT");
     }
     
-    private boolean itemCountDirty = false;
-    private InvalidationListener itemsListener = new InvalidationListener() {
-        @Override public void invalidated(Observable o) {
+    public void updateListViewItems() {
+        if (listViewItems != null) {
+            listViewItems.removeListener(weakListViewItemsListener);
+        }
+
+        this.listViewItems = comboBox.getItems();
+        listView.setItems(listViewItems);
+
+        if (listViewItems != null) {
+            listViewItems.addListener(weakListViewItemsListener);
+        }
+        
+        itemCountDirty = true;
+        requestLayout();
+    }
+    
+    private boolean itemCountDirty;
+    private final ListChangeListener listViewItemsListener = new ListChangeListener() {
+        @Override public void onChanged(ListChangeListener.Change c) {
             itemCountDirty = true;
             requestLayout();
         }
     };
     
-    private void updateItemsListener(ObservableList<T> oldList, ObservableList<T> newList) {
-        if (oldList != null) {
-            oldList.removeListener(itemsListener);
-        }
-        if (newList != null) {
-            newList.addListener(itemsListener);
-        }
-    }
-
+    private final WeakListChangeListener weakListViewItemsListener =
+            new WeakListChangeListener(listViewItemsListener);
+    
     @Override protected void handleControlPropertyChanged(String p) {
         super.handleControlPropertyChanged(p);
         
-        if ("PROMPT_TEXT".equals(p)) {
+        if (p == "ITEMS") {
+            updateListViewItems();
+        } else if ("PROMPT_TEXT".equals(p)) {
             updateDisplayNode();
         }
     }
@@ -161,7 +172,7 @@
                 textField.setText(stringValue);
             }
         } else {
-            int index = comboBox.getSelectionModel().getSelectedIndex();        
+            int index = getSelectedIndex();
             listCellLabel.updateListView(listView);
             listCellLabel.updateIndex(index);
         }
@@ -183,6 +194,12 @@
         }
     }
     
+    private int getSelectedIndex() {
+        T value = comboBox.getValue();
+        int index = comboBox.getItems().indexOf(value);
+        return index;
+    }
+    
     private ListCell<T> getListCellLabel() {
         if (listCellLabel != null) return listCellLabel;
         
@@ -254,13 +271,12 @@
             }
         };
 
-        listView.itemsProperty().bind(comboBox.itemsProperty());
         listView.cellFactoryProperty().bind(comboBox.cellFactoryProperty());
         listView.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
 
         listView.getSelectionModel().selectedIndexProperty().addListener(new InvalidationListener() {
             @Override public void invalidated(Observable o) {
-                int index = listView.getSelectionModel().getSelectedIndex();
+                int index = getSelectedIndex();
                 comboBox.getSelectionModel().select(index);
                 comboBox.setValue(listView.getSelectionModel().getSelectedItem());
                 updateDisplayNode();
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ContextMenuContent.java	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ContextMenuContent.java	Tue Jan 24 10:46:20 2012 -0500
@@ -284,12 +284,13 @@
     }
 
     private double getScreenHeight() {
-        if (contextMenu == null || contextMenu.getOwnerWindow() == null) {
+        if (contextMenu == null || contextMenu.getOwnerWindow() == null ||
+                contextMenu.getOwnerWindow().getScene() == null) {
             return -1;
         }
         return snapSize(com.sun.javafx.Utils.getScreen(
-                contextMenu.getOwnerWindow().getScene().getRoot()).getVisualBounds().getHeight());
-
+            contextMenu.getOwnerWindow().getScene().getRoot()).getVisualBounds().getHeight());
+        
     }
 
     private double getContentHeight() {
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/LabeledImpl.java	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/LabeledImpl.java	Tue Jan 24 10:46:20 2012 -0500
@@ -48,6 +48,7 @@
         // method below
         setFont(labeled.getFont()); // set font or rely on skin's css?
         setText(labeled.getText());
+        setTextFill(labeled.getTextFill());
         setGraphic(labeled.getGraphic());
         setAlignment(labeled.getAlignment());
         setContentDisplay(labeled.getContentDisplay());
@@ -61,8 +62,7 @@
                 if (valueModel == labeled.textProperty()) {
                     setText(labeled.getText());
                                         
-                } else if (valueModel == labeled.alignmentProperty()) {
-                    //setAlignment(labeled.getAlignment());
+                } else if (valueModel == labeled.textFillProperty()) {
                     
                     //
                     // Fix for RT-10554. Since this Label's properties are set by the
@@ -70,6 +70,12 @@
                     // set by the user and CSS won't override the value.
                     //
                     StyleableProperty styleable = 
+                        StyleableProperty.getStyleableProperty(labeled.textFillProperty());
+                    styleable.set(LabeledImpl.this, labeled.getTextFill());
+                                        
+                } else if (valueModel == labeled.alignmentProperty()) {
+                    //setAlignment(labeled.getAlignment());
+                    StyleableProperty styleable = 
                         StyleableProperty.getStyleableProperty(labeled.alignmentProperty());
                     styleable.set(LabeledImpl.this, labeled.getAlignment());
                     
@@ -125,6 +131,7 @@
             }
         };
         labeled.textProperty().addListener(shuttler);
+        labeled.textFillProperty().addListener(shuttler);
         labeled.alignmentProperty().addListener(shuttler);
         labeled.textAlignmentProperty().addListener(shuttler);
         labeled.textOverrunProperty().addListener(shuttler);
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/LabeledSkinBase.java	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/LabeledSkinBase.java	Tue Jan 24 10:46:20 2012 -0500
@@ -124,11 +124,18 @@
         // Configure the Text node with all of the attributes from the
         // Labeled which apply to it.
         text = new Text();
+        //
+        // RT-16589: by binding text.fontProperty() to labeled.fontProperty(), 
+        // we achieve two things. First, the text's font stays in sync with
+        // labeled's and, second, it prevents text's font from being updated 
+        // by CSS. 
+        //
+        text.fontProperty().bind(labeled.fontProperty());
+        
         textClip = new Rectangle();
         text.setClip(textClip);
 
         updateFill();
-        updateFont();
         updateTextAlignment();
         updateUnderline();
         updateChildren();
@@ -180,7 +187,6 @@
         } else if (p == "TEXT_FILL") {
             updateFill();
         } else if (p == "FONT") {
-            updateFont();
             textMetricsChanged();
             invalidateWidths();
             ellipsisWidth = Double.NEGATIVE_INFINITY;
@@ -481,17 +487,6 @@
     }
 
     /**
-     * Updates the font used to render the text. Although changing the font
-     * does affect the metrics used for text layout, this method does not
-     * call requestLayout or invalidate the text, since it may be called
-     * from the constructor and such work would be duplicative and wasted.
-     */
-    private void updateFont() {
-        final Font font = getSkinnable().getFont();
-        text.setFont(font == null ? Font.getDefault() : font);
-    }
-
-    /**
      * Updates the text alignment of the Text node. Although changing the font
      * does affect the metrics used for text layout, this method does not
      * call requestLayout or invalidate the text, since it may be called
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ListCellSkin.java	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ListCellSkin.java	Tue Jan 24 10:46:20 2012 -0500
@@ -40,14 +40,12 @@
     @Override protected double computePrefWidth(double height) {
         double pref = super.computePrefWidth(height);
         ListView listView = getSkinnable().getListView();
-        return listView == null ? 0 :
-            listView.getOrientation() == Orientation.VERTICAL ? pref : Math.max(pref, getCellSize());
+        return listView == null ? 0 : pref;
     }
 
     @Override protected double computePrefHeight(double width) {
         double pref = super.computePrefHeight(width);
         ListView listView = getSkinnable().getListView();
-        return listView == null ? 0 :
-            listView.getOrientation() == Orientation.VERTICAL ? Math.max(pref, getCellSize()) : pref;
+        return listView == null ? 0 : pref;
     }
 }
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/MenuBarSkin.java	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/MenuBarSkin.java	Tue Jan 24 10:46:20 2012 -0500
@@ -185,17 +185,18 @@
                     case DOWN:
                     case SPACE:
                     case ENTER:
-                        if (control.getScene().getWindow().isFocused()) {
-                            if (focusedMenuIndex != -1) {
-                                if (!isMenuEmpty(getSkinnable().getMenus().get(focusedMenuIndex))) {
-                                    openMenu = getSkinnable().getMenus().get(focusedMenuIndex);
-                                    openMenu.show();
-                                } else {
-                                    openMenu = null;
-                                }
-                                event.consume();
-                            }
-                        }
+                        // RT-18859: Doing nothing for down, space and enter 
+//                        if (control.getScene().getWindow().isFocused()) {
+//                            if (focusedMenuIndex != -1) {
+//                                if (!isMenuEmpty(getSkinnable().getMenus().get(focusedMenuIndex))) {
+//                                    openMenu = getSkinnable().getMenus().get(focusedMenuIndex);
+//                                    openMenu.show();
+//                                } else {
+//                                    openMenu = null;
+//                                }
+//                                event.consume();
+//                            }
+//                        }
                         break;
                 }
                
@@ -268,6 +269,7 @@
     private boolean menusContainCustomMenuItem() {
         for (Menu menu : getSkinnable().getMenus()) {
             if (menuContainsCustomMenuItem(menu)) {
+                System.err.println("Warning: MenuBar ignored property useSystemMenuBar because menus contain CustomMenuItem");
                 return true;
             }
         }
@@ -287,6 +289,16 @@
         return false;
     }
 
+    private int getMenuBarButtonIndex(MenuBarButton m) {
+        for (int i= 0; i < container.getChildren().size(); i++) {
+            MenuBarButton menuButton = (MenuBarButton)container.getChildren().get(i);
+            if (m == menuButton) {
+                return i;
+            }
+        }
+        return -1;
+    }
+    
     private void rebuildUI() {
         for(Node n : container.getChildren()) {
             //Stop observing menu's showing & disable property for changes.
@@ -301,38 +313,41 @@
         container.getChildren().clear();
 
 
-        if (Toolkit.getToolkit().getSystemMenu().isSupported() && getSkinnable().isUseSystemMenuBar()) {
-            if (menusContainCustomMenuItem()) {
-                System.err.println("Warning: MenuBar ignored property useSystemMenuBar because menus contain CustomMenuItem");
-            } else {
-                Scene scene = getSkinnable().getScene();
-                if (scene != null) {
-                    Window window = scene.getWindow();
-                    if (window instanceof Stage) {
-                        // Set the system menu bar if not set by another
-                        // MenuBarSkin instance on this stage.
-                        Stage stage = (Stage)window;
-                        if (systemMenuMap == null ||
-                            systemMenuMap.get(stage) == null ||
-                            systemMenuMap.get(stage) == this) {
+        if (Toolkit.getToolkit().getSystemMenu().isSupported() && getSkinnable().getScene() != null) {
+            Scene scene = getSkinnable().getScene();
+            if (scene.getWindow() instanceof Stage) {
+                Stage stage = (Stage)scene.getWindow();
+                if (getSkinnable().isUseSystemMenuBar() && !menusContainCustomMenuItem()) {
+                    // Set the system menu bar if not set by another
+                    // MenuBarSkin instance on this stage.
+                    if (systemMenuMap == null ||
+                        systemMenuMap.get(stage) == null ||
+                        systemMenuMap.get(stage) == this) {
 
-                            if (systemMenuMap == null) {
-                                initSystemMenuBar();
-                            }
-                            if (wrappedMenus == null) {
-                                wrappedMenus = new ArrayList<MenuBase>();
-                                systemMenuMap.put(stage, this);
-                            }
+                        if (systemMenuMap == null) {
+                            initSystemMenuBar();
+                        }
+                        if (wrappedMenus == null) {
+                            wrappedMenus = new ArrayList<MenuBase>();
+                            systemMenuMap.put(stage, this);
+                        } else {
                             wrappedMenus.clear();
-                            for (Menu menu : getSkinnable().getMenus()) {
-                                wrappedMenus.add(GlobalMenuAdapter.adapt(menu));
-                            }
-                            setSystemMenu(stage);
+                        }
+                        for (Menu menu : getSkinnable().getMenus()) {
+                            wrappedMenus.add(GlobalMenuAdapter.adapt(menu));
+                        }
+                        setSystemMenu(stage);
 
-                            return;
-                        }
+                        return;
                     }
                 }
+                if (systemMenuMap != null && systemMenuMap.get(stage) == this) {
+                    // This MenuBar was previously installed in the
+                    // system menu bar. Remove it.
+                    wrappedMenus = null;
+                    systemMenuMap.remove(stage);
+                    setSystemMenu(stage);
+                }
             }
         }
 
@@ -418,6 +433,8 @@
                         } else {
                             openMenu = null;
                         }
+                        // update FocusedIndex
+                        focusedMenuIndex = getMenuBarButtonIndex(menuButton);
                     }
                 }
             });
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/NestedTableColumnHeader.java	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/NestedTableColumnHeader.java	Tue Jan 24 10:46:20 2012 -0500
@@ -31,6 +31,8 @@
 import javafx.beans.InvalidationListener;
 import javafx.beans.Observable;
 import javafx.beans.WeakInvalidationListener;
+import javafx.beans.binding.Bindings;
+import javafx.beans.binding.ObjectBinding;
 import javafx.collections.ListChangeListener;
 import javafx.collections.ObservableList;
 import javafx.event.EventHandler;
@@ -249,7 +251,13 @@
             rect.setHeight(getHeight() - label.getHeight());
             rect.setFill(Color.TRANSPARENT);
             rect.setVisible(false);
-            rect.setCursor(Cursor.H_RESIZE);
+            rect.cursorProperty().bind(new ObjectBinding<Cursor>() {
+                { super.bind(c.resizableProperty()); }
+                
+                @Override protected Cursor computeValue() {
+                    return c.isResizable() ? Cursor.H_RESIZE : Cursor.DEFAULT;
+                }
+            });
             rect.setSmooth(false);
             rect.setOnMousePressed(new EventHandler<MouseEvent>() {
                 @Override public void handle(MouseEvent me) {
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/SplitPaneSkin.java	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/SplitPaneSkin.java	Tue Jan 24 10:46:20 2012 -0500
@@ -123,7 +123,7 @@
             requestLayout();
         }
     };
-   
+
     private void addDivider(SplitPane.Divider d) {
         ContentDivider c = new ContentDivider(d);
         c.setInitialPos(d.getPosition());
@@ -142,6 +142,7 @@
             c.getDivider().positionProperty().removeListener(posPropertyListener);
             dividers.remove();
         }
+        lastDividerUpdate = 0;
     }
 
     private void initializeDivderEventHandlers(final ContentDivider divider) {
@@ -327,6 +328,7 @@
             return size;
         }
 
+        size = snapSize(size);
         int portion = (int)(size)/available.size();
         int remainder;
 
@@ -379,7 +381,8 @@
         if (available.isEmpty()) {
             return size;
         }
-
+        
+        size = snapSize(size);
         int portion = (int)(size)/available.size();
         int remainder;
 
@@ -481,6 +484,9 @@
     }
 
     private double previousArea = -1;
+    private double previousWidth = -1;
+    private double previousHeight = -1;
+    private int lastDividerUpdate = 0;
     private boolean resize = false;
 
     @Override protected void layoutChildren() {
@@ -492,17 +498,91 @@
         double w = getWidth() - (getInsets().getLeft() + getInsets().getRight());
         double h = getHeight() - (getInsets().getTop() + getInsets().getBottom());
 
-        // If we are resizing the window save the current area into
-        // resizableWithParentArea.  We use this value during layout.
         if (contentDividers.size() > 0 && previousArea != -1 && previousArea != (getWidth() * getHeight())) {
+            //This algorithm adds/subracts a little to each panel on every resize
+            List<Content> resizeList = new ArrayList<Content>();
+            for (Content c: contentRegions) {
+                if (c.isResizableWithParent()) {
+                    resizeList.add(c);
+                }
+            }
+                        
+            double delta = horizontal ? (getWidth() - previousWidth) : (getHeight() - previousHeight);
+            boolean growing = delta > 0;
+            
+            delta = Math.abs(delta);            
+
+            if (!resizeList.isEmpty()) {
+                int portion = (int)(delta)/resizeList.size();
+                int remainder = (int)delta%resizeList.size();
+                int size = 0;
+                if (portion == 0) {
+                    portion = remainder;
+                    size = remainder;
+                    remainder = 0;
+                } else {
+                    size = portion * resizeList.size();
+                }
+
+                while (size > 0 && !resizeList.isEmpty()) {
+                    if (growing) {
+                        lastDividerUpdate++;
+                    } else {
+                        lastDividerUpdate--;
+                        if (lastDividerUpdate < 0) {
+                            lastDividerUpdate = contentRegions.size() - 1;
+                        }
+                    }
+                    int id = lastDividerUpdate%contentRegions.size();
+                    Content content = contentRegions.get(id);
+                    if (content.isResizableWithParent() && resizeList.contains(content)) {
+                        double area = content.getArea();
+                        if (growing) {
+                            double max = horizontal ? content.maxWidth(-1) : content.maxHeight(-1);
+                            if ((area + portion) <= max) {
+                                area += portion;
+                            } else {
+                                resizeList.remove(content);
+                                continue;
+                            }
+                        } else {
+                            double min = horizontal ? content.minWidth(-1) : content.minHeight(-1);
+                            if ((area - portion) >= min) {
+                                area -= portion;
+                            } else {
+                                resizeList.remove(content);
+                                continue;
+                            }
+                        }
+                        content.setArea(area);
+                        size -= portion;
+                        if (size == 0 && remainder != 0) {
+                            portion = remainder;
+                            size = remainder;
+                            remainder = 0;
+                        } else if (size == 0) {
+                            break;
+                        }
+                    }
+                }
+            }
+
             previousArea = getWidth() * getHeight();
+            previousWidth = getWidth();
+            previousHeight = getHeight();
+
+            // If we are resizing the window save the current area into
+            // resizableWithParentArea.  We use this value during layout.
             for (Content c: contentRegions) {
                 c.setResizableWithParentArea(c.getArea());
                 c.setAvailable(0);
             }
             resize = true;
+        } else {
+            previousArea = getWidth() * getHeight();
+            previousWidth = getWidth();
+            previousHeight = getHeight();
         }
-        previousArea = getWidth() * getHeight();
         
         // If the window is less than the min size we want to resize
         // proportionally
@@ -550,7 +630,9 @@
                     // Last panel
                     space = (horizontal ? w : h) - (previousDivider != null ? getAbsoluteDividerPos(previousDivider) + dividerWidth : 0);
                 }
-                contentRegions.get(i).setArea(space);
+                if (!resize) {
+                    contentRegions.get(i).setArea(space);
+                }
                 previousDivider = divider;
             }
 
@@ -613,7 +695,7 @@
                         extraSpace += (c.getArea() - c.getResizableWithParentArea());
                     } else {
                         // We are making the SplitPane smaller and will need to
-                        // find distribute the space requested.
+                        // distribute the space requested.
                         spaceRequested += (c.getResizableWithParentArea() - c.getArea());
                     }
                     c.setAvailable(0);
@@ -633,13 +715,23 @@
             }
 
             if (extraSpace > 0) {
-                double space = distributeTo(storageList, extraSpace);
-                if (space == 0) {
-                    spaceRequested -= extraSpace;
-                } else {
-                    spaceRequested -= space;
+                extraSpace = distributeTo(storageList, extraSpace);
+                // After distributing add any panels that may still need space to the
+                // spaceRequestor list.
+                spaceRequested = 0;
+                spaceRequestor.clear();
+                available = 0;
+                availableList.clear();
+                for (Content c: contentRegions) {
+                    if (c.getAvailable() < 0) {
+                        spaceRequested += c.getAvailable();
+                        spaceRequestor.add(c);
+                    } else {
+                        available += c.getAvailable();
+                        availableList.add(c);
+                    }
                 }
-                extraSpace = space;
+                spaceRequested = Math.abs(spaceRequested);
             }
 
             if (available >= spaceRequested) {
@@ -648,15 +740,15 @@
                     requestor.setArea(min);
                     requestor.setAvailable(0);
                 }
-                // We have some space requested but it is not from the space requestors.
-                // This is probably from resizing the SplitPane lets add this to
-                // extraSpace and try and redistribute it.
+                // After setting all the space requestors to their min we have to
+                // redistribute the space requested to any panel that still
+                // has available space.
                 if (spaceRequested > 0 && !spaceRequestor.isEmpty()) {
                     distributeFrom(spaceRequested, availableList);
                 }
 
-                // Only for resizing.  At this point we should have all the
-                // area available computed.  We can total them up and see
+                // Only for resizing.  We should have all the panel areas
+                // available computed.  We can total them up and see
                 // how much space we have left or went over and redistribute.
                 if (resize) {
                     double total = 0;
@@ -894,11 +986,11 @@
         }
 
         @Override protected double computePrefWidth(double height) {
-            return getInsets().getLeft() + getInsets().getRight();
+            return snapSpace(getInsets().getLeft()) + snapSpace(getInsets().getRight());
         }
 
         @Override protected double computePrefHeight(double width) {
-            return getInsets().getTop() + getInsets().getBottom();
+            return snapSpace(getInsets().getTop()) + snapSpace(getInsets().getBottom());
         }
 
         @Override protected double computeMaxWidth(double height) {
@@ -982,7 +1074,7 @@
         }
 
         public boolean isResizableWithParent() {
-            return true;//SplitPane.isResizableWithParent(content);
+            return SplitPane.isResizableWithParent(content);
         }
 
         public double getResizableWithParentArea() {
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TabPaneSkin.java	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TabPaneSkin.java	Tue Jan 24 10:46:20 2012 -0500
@@ -999,6 +999,7 @@
             getSkinnable().tabMinHeightProperty().addListener(controlListener);
             getSkinnable().tabMaxHeightProperty().addListener(controlListener);
             getProperties().put(Tab.class, tab);
+            getProperties().put(ContextMenu.class, tab.getContextMenu());
             
             setOnContextMenuRequested(new EventHandler<ContextMenuEvent>() {
                 @Override public void handle(ContextMenuEvent me) {
@@ -1057,7 +1058,11 @@
             tab.selectedProperty().removeListener(tabListener);
             tab.textProperty().removeListener(tabListener);
             tab.graphicProperty().removeListener(tabListener);
-            tab.contextMenuProperty().removeListener(tabListener);
+            ContextMenu menu = tab.getContextMenu();
+            if (menu != null) {
+                menu.getItems().clear();                
+            }
+            tab.contextMenuProperty().removeListener(tabListener);            
             tab.tooltipProperty().removeListener(tabListener);
             tab.styleProperty().removeListener(tabListener);
             getSkinnable().tabClosingPolicyProperty().removeListener(controlListener);
@@ -1066,7 +1071,9 @@
             getSkinnable().tabMinWidthProperty().removeListener(controlListener);
             getSkinnable().tabMaxWidthProperty().removeListener(controlListener);
             getSkinnable().tabMinHeightProperty().removeListener(controlListener);
-            getSkinnable().tabMaxHeightProperty().removeListener(controlListener);  
+            getSkinnable().tabMaxHeightProperty().removeListener(controlListener);            
+            inner.getChildren().clear();
+            getChildren().clear();
         }
 
         private boolean animating = false;
@@ -1518,6 +1525,8 @@
                         showControlButtons = true;
                     } else {
                         setVisible(false);
+                        popup.getItems().clear();
+                        popup = null;
                     }
                     setAnimationLock(false);
                     // This needs to be called when we are in the left tabPosition
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TextFieldSkin.java	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TextFieldSkin.java	Tue Jan 24 10:46:20 2012 -0500
@@ -292,7 +292,7 @@
         textNode.impl_caretShapeProperty().addListener(new InvalidationListener() {
             @Override public void invalidated(Observable observable) {
                 caretPath.getElements().setAll(textNode.impl_caretShapeProperty().get());
-                caretWidth = caretPath.getLayoutBounds().getWidth();
+                caretWidth = Math.round(caretPath.getLayoutBounds().getWidth());
             }
         });
 
@@ -627,19 +627,20 @@
         if (textNode != null) {
             double textY;
             Insets insets = getInsets();
+            FontMetrics fm = fontMetrics.get();
             switch (getSkinnable().getAlignment().getVpos()) {
               case TOP:
-                textY = insets.getTop() + fontMetrics.get().getMaxAscent();
+                textY = insets.getTop() + fm.getMaxAscent();
                 break;
 
               case CENTER:
-                textY = (getHeight() - insets.getBottom() - insets.getTop()
-                         + fontMetrics.get().getLineHeight()) / 2;
+                textY = (insets.getTop() + fm.getMaxAscent() +
+                         getHeight() - insets.getBottom() - fm.getMaxDescent()) / 2;
                 break;
 
               case BOTTOM:
               default:
-                textY = getHeight() - insets.getBottom() - fontMetrics.get().getMaxDescent();
+                textY = getHeight() - insets.getBottom() - fm.getMaxDescent();
             }
             textNode.setY(textY);
             if (promptNode != null) {
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/caspian/caspian.css	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/caspian/caspian.css	Tue Jan 24 10:46:20 2012 -0500
@@ -898,38 +898,24 @@
     -fx-skin: "com.sun.javafx.scene.control.skin.MenuBarSkin";
     -fx-padding: 0.0em 0.666667em 0.0em 0.666667em; /* 0 8 0 8 */
     -fx-spacing: 0.166667em; /* 2 */
-    -fx-text-fill: -fx-mid-text-color, white;
-    -fx-background-color:
-/*         bottom shape: */
-        linear-gradient(to bottom, derive(-fx-base,-30%), black),
-/*         top shape: */
-        linear-gradient(to bottom, derive(-fx-base,-50%), derive(-fx-base,-70%));
+    -fx-base: derive(#d0d0d0,-70%);
+    -fx-background-color: linear-gradient(to bottom, derive(-fx-color,50%), derive(-fx-color,-30%)), -fx-body-color;
     -fx-background-insets: 0, 1 0 1 0;
     -fx-background-radius: 0, 0 ;
 }
 
-.menu-bar Text {
-    -fx-font-smoothing-type: lcd;
-}
-
-.menu-bar .menu .label {
+/* Show nothing for background of normal menu button in a menu bar */
+.menu-bar .menu-button {
+    -fx-background-radius: 0;
+    -fx-background-color: transparent;
+    -fx-background-insets: 0; 
+}
+/* Change padding of menu buttons when in menu bar */
+.menu-bar .menu-button .label {
     -fx-padding: 0.333em 0.5em 0.333em 0.5em; /* 4 6 4 6*/
-/*    -fx-effect: dropshadow(two-pass-box , rgba(0, 0, 0, 0.6), 1, 0.0 , 0, 1);*/
-}
-
-.menu-bar .menu-button:disabled .label {
-    -fx-opacity: -fx-disabled-opacity;
-}
-
-.menu-bar .menu {
-    -fx-background-color: null;
-    -fx-text-fill: white;
-    -fx-background-insets: 0;
-    -fx-background-radius: 0;
-    -fx-padding: 0.0em;
-}
-
-.menu-bar .menu .showing {
+}
+
+.menu-bar .menu-button:hover, .menu-bar .menu-button:focused, .menu-bar .menu-button.showing {
     -fx-background: -fx-accent;
     -fx-background-color: -fx-selection-bar;
     -fx-text-fill: -fx-selection-bar-text;
@@ -950,8 +936,7 @@
 
 .menu-bar:show-mnemonics .mnemonic-underline {
     -fx-stroke: -fx-text-fill;
-} 
-
+}
 
 /*******************************************************************************
  *                                                                             *
@@ -1990,7 +1975,11 @@
     -fx-background-insets: 0 0 -1 0, 0, 1, 2;
     -fx-background-radius: 5, 5, 4, 3;
     -fx-padding: 0.0em; /* 0 */
-}
+    -fx-text-fill: -fx-text-base-color;
+}
+
+/* TODO workaround for RT-19062 */
+.menu-button .label { -fx-text-fill: -fx-text-base-color; }
 
 .menu-button Text {
     -fx-font-smoothing-type: lcd;
@@ -3357,6 +3346,7 @@
     -fx-background-color: transparent;
     -fx-text-fill: -fx-text-base-color;
     -fx-padding: 0 0 0 7;
+    -fx-cell-size: 1.66667em; /* 20 */
 }
 
 .combo-box-popup .list-view {
@@ -3366,7 +3356,6 @@
 }
 
 .combo-box-popup .list-view .list-cell {
-    -fx-cell-size: 14;
     -fx-padding: 4 0 4 5;
     
     /* No alternate highlighting */
--- a/javafx-ui-controls/src/javafx/scene/chart/Axis.java	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-ui-controls/src/javafx/scene/chart/Axis.java	Tue Jan 24 10:46:20 2012 -0500
@@ -1176,6 +1176,13 @@
      */
     @Deprecated @Override public long impl_getPseudoClassState() {
         long mask = super.impl_getPseudoClassState();
+        if (getSide() == null) {
+            // RT-18270 XYChart has not initialized Side values and it could be null
+            // note: We do not have initial default property on creation, as the default
+            // depends on whether it is x, or y axis. hence if we get here - we are 
+            // probably installed directly inside a scene. 
+            setSide(Side.BOTTOM);
+        } 
         switch(getSide()) {
             case TOP:
                 mask |= TOP_PSEUDOCLASS_STATE;
--- a/javafx-ui-controls/src/javafx/scene/control/ComboBox.java	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-ui-controls/src/javafx/scene/control/ComboBox.java	Tue Jan 24 10:46:20 2012 -0500
@@ -27,6 +27,7 @@
 
 import com.sun.javafx.css.StyleManager;
 import com.sun.javafx.scene.control.WeakListChangeListener;
+import com.sun.javafx.scene.control.skin.ComboBoxListViewSkin;
 import com.sun.javafx.scene.control.skin.ListViewSkin;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -147,10 +148,14 @@
         valueProperty().addListener(new ChangeListener<T>() {
             @Override public void changed(ObservableValue<? extends T> ov, T t, T t1) {
                 if (getItems() == null) return;
-                int index = getItems().indexOf(t1);
-                if (index > -1) {
-                    getSelectionModel().select(index);
-                }
+                getSelectionModel().setSelectedItem(t1);
+            }
+        });
+        
+        editableProperty().addListener(new InvalidationListener() {
+            @Override public void invalidated(Observable o) {
+                // when editable changes, we reset the selection / value states
+                getSelectionModel().clearSelection();
             }
         });
     }
@@ -174,6 +179,10 @@
             if (getSelectionModel() instanceof ComboBoxSelectionModel) {
                 ((ComboBoxSelectionModel)getSelectionModel()).updateItemsObserver(null, getItems());
             }
+            if (getSkin() instanceof ComboBoxListViewSkin) {
+                ComboBoxListViewSkin skin = (ComboBoxListViewSkin) getSkin();
+                skin.updateListViewItems();
+            }
         }
     };
     public final void setItems(ObservableList<T> value) { itemsProperty().set(value); }
@@ -253,6 +262,8 @@
      *                                                                         *
      **************************************************************************/    
     
+    // Listen to changes in the selectedItem property of the SelectionModel.
+    // When it changes, set the selectedItem in the value property.
     private ChangeListener<T> selectedItemListener = new ChangeListener<T>() {
         @Override public void changed(ObservableValue<? extends T> ov, T t, T t1) {
             if (! valueProperty().isBound()) {
--- a/javafx-ui-controls/src/javafx/scene/control/ComboBoxBase.java	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-ui-controls/src/javafx/scene/control/ComboBoxBase.java	Tue Jan 24 10:46:20 2012 -0500
@@ -26,14 +26,9 @@
 package javafx.scene.control;
 
 import com.sun.javafx.css.StyleManager;
-import javafx.beans.property.BooleanProperty;
-import javafx.beans.property.ObjectProperty;
-import javafx.beans.property.ObjectPropertyBase;
-import javafx.beans.property.SimpleBooleanProperty;
-import javafx.beans.property.SimpleObjectProperty;
-import javafx.beans.property.SimpleStringProperty;
-import javafx.beans.property.StringProperty;
+import javafx.beans.property.*;
 import javafx.event.ActionEvent;
+import javafx.event.Event;
 import javafx.event.EventHandler;
 
 /**
@@ -100,6 +95,9 @@
      * Specifies whether the ComboBox allows for user input. When editable is 
      * true, the ComboBox has a text input area that a user may type in to. This
      * input is then available via the {@link #valueProperty() value} property.
+     * 
+     * <p>Note that when the editable property changes, the value property is 
+     * reset, along with any other relevant state.
      */
     public BooleanProperty editableProperty() { return editable; }
     public final void setEditable(boolean value) { editableProperty().set(value); }
@@ -116,13 +114,32 @@
      * Represents the current state of the ComboBox popup, and whether it is 
      * currently visible on screen (although it may be hidden behind other windows).
      */
-    public BooleanProperty showingProperty() { return showing; }
-    public final boolean isShowing() { return showingProperty().get(); }
-    private BooleanProperty showing = new SimpleBooleanProperty(this, "showing", false) {
-        @Override protected void invalidated() {
-            impl_pseudoClassStateChanged(PSEUDO_CLASS_SHOWING);
+    private ReadOnlyBooleanWrapper showing;
+    public ReadOnlyBooleanProperty showingProperty() { return showingPropertyImpl().getReadOnlyProperty(); }
+    public final boolean isShowing() { return showingPropertyImpl().get(); }
+    private void setShowing(boolean value) {
+        showingPropertyImpl().set(value);
+    }
+    private ReadOnlyBooleanWrapper showingPropertyImpl() {
+        if (showing == null) {
+            showing = new ReadOnlyBooleanWrapper(false) {
+                @Override protected void invalidated() {
+                    impl_pseudoClassStateChanged(PSEUDO_CLASS_SHOWING);
+                }
+
+                @Override
+                public Object getBean() {
+                    return ComboBoxBase.this;
+                }
+
+                @Override
+                public String getName() {
+                    return "showing";
+                }
+            };
         }
-    };
+        return showing;
+    }
     
     
     // --- prompt text
@@ -207,8 +224,8 @@
      * form of popup or dialog window.
      */
     public void show() {
-        if (!isDisabled() && ! showingProperty().isBound()) {
-            showing.set(true);
+        if (!isDisabled()) {
+            setShowing(true);
         }
     }
 
@@ -216,9 +233,7 @@
      * Closes the popup / dialog that was shown when {@link #show()} was called.
      */
     public void hide() {
-        if (! showingProperty().isBound()) {
-            showing.set(false);
-        }
+        setShowing(false);
     }
     
     /**
--- a/javafx-ui-controls/src/javafx/scene/control/ListView.java	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-ui-controls/src/javafx/scene/control/ListView.java	Tue Jan 24 10:46:20 2012 -0500
@@ -898,17 +898,19 @@
         // watching for changes to the items list content
         private final ListChangeListener<T> itemsContentObserver = new ListChangeListener<T>() {
             @Override public void onChanged(Change<? extends T> c) {
-                if (listView.getItems() == null || listView.getItems().isEmpty()) {
-                    setSelectedIndex(-1);
-                    focus(-1);
-                } else if (getSelectedIndex() == -1 && getSelectedItem() != null) {
-                    int newIndex = listView.getItems().indexOf(getSelectedItem());
-                    if (newIndex != -1) {
-                        setSelectedIndex(newIndex);
+                while (c.next()) {
+                    if (listView.getItems() == null || listView.getItems().isEmpty()) {
+                        setSelectedIndex(-1);
+                        focus(-1);
+                    } else if (getSelectedIndex() == -1 && getSelectedItem() != null) {
+                        int newIndex = listView.getItems().indexOf(getSelectedItem());
+                        if (newIndex != -1) {
+                            setSelectedIndex(newIndex);
+                        }
                     }
+
+                    updateSelection(c);
                 }
-
-                updateSelection(c);
             }
         };
         
@@ -972,9 +974,15 @@
 //            if (c.wasPermutated()) {
 //                System.out.println("\tWas permutated");
 //            }
+            c.reset();
             while (c.next()) {
                 if (c.wasReplaced()) {
-                    // no-op
+                    // Fix for RT-18969: the list had setAll called on it
+                    int index = getSelectedIndex();
+                    if (index < getItemCount() && index >= 0) {
+                        clearSelection(index);
+                        select(index);
+                    }
                 } else if (c.wasAdded() || c.wasRemoved()) {
                     int shift = c.wasAdded() ? c.getAddedSize() : -c.getRemovedSize();
                     shiftSelection(c.getFrom(), shift);
--- a/javafx-ui-controls/src/javafx/scene/control/PasswordField.java	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-ui-controls/src/javafx/scene/control/PasswordField.java	Tue Jan 24 10:46:20 2012 -0500
@@ -33,11 +33,17 @@
         getStyleClass().add("password-field");
     }
 
+    /**
+     * Does nothing for PasswordField.
+     */
     @Override
     public void cut() {
         // No-op
     }
 
+    /**
+     * Does nothing for PasswordField.
+     */
     @Override
     public void copy() {
         // No-op
--- a/javafx-ui-controls/src/javafx/scene/control/SplitPane.java	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-ui-controls/src/javafx/scene/control/SplitPane.java	Tue Jan 24 10:46:20 2012 -0500
@@ -118,6 +118,42 @@
 
 public class SplitPane extends Control {
 
+    /********************************************************************
+     *  static methods
+     ********************************************************************/
+    private static final String RESIZABLE_WITH_PARENT = "resizable-with-parent";
+
+    /**
+     * Sets a node in the SplitPane to be resizable or not when the SplitPane is
+     * resized.  By default all node are resizable.  Setting value to false will
+     * prevent the node from being resized.
+     * @param node A node in the SplitPane.
+     * @param value true if the node is resizable or false if not resizable.
+     */
+    public static void setResizableWithParent(Node node, Boolean value) {
+        if (value == null) {
+            node.getProperties().remove(RESIZABLE_WITH_PARENT);
+        } else {
+            node.getProperties().put(RESIZABLE_WITH_PARENT, value);
+        }
+    }
+
+    /**
+     * Return true if the node is resizable when the parent container is resized false otherwise.
+     * @param node A node in the SplitPane.
+     * @default true
+     * @return true if the node is resizable false otherwise.
+     */
+    public static Boolean isResizableWithParent(Node node) {
+        if (node.hasProperties()) {
+            Object value = node.getProperties().get(RESIZABLE_WITH_PARENT);
+            if (value != null) {
+                return (Boolean)value;
+            }
+        }
+        return true;
+    }
+    
     /***************************************************************************
      *                                                                         *
      * Constructors                                                            *
--- a/javafx-ui-controls/src/javafx/scene/control/TableView.java	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-ui-controls/src/javafx/scene/control/TableView.java	Tue Jan 24 10:46:20 2012 -0500
@@ -1852,7 +1852,12 @@
         private void updateSelection(ListChangeListener.Change<? extends S> c) {
             while (c.next()) {
                 if (c.wasReplaced()) {
-                    // no-op
+                    // Fix for RT-18969: the items list had setAll called on it
+                    if (getSelectedIndex() < getRowCount()) {
+                        int selectedIndex = getSelectedIndex();
+                        clearSelection(selectedIndex);
+                        select(selectedIndex);
+                    }
                 } else if (c.wasAdded() || c.wasRemoved()) {
                     int position = c.getFrom();
                     int shift = c.wasAdded() ? c.getAddedSize() : -c.getRemovedSize();
--- a/javafx-ui-controls/src/javafx/scene/control/TextField.java	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-ui-controls/src/javafx/scene/control/TextField.java	Tue Jan 24 10:46:20 2012 -0500
@@ -205,6 +205,8 @@
     /**
      * The action handler associated with this text field, or
      * <tt>null</tt> if no action handler is assigned.
+     *
+     * The action handler is normally called when the user types the ENTER key.
      */
     private ObjectProperty<EventHandler<ActionEvent>> onAction = new ObjectPropertyBase<EventHandler<ActionEvent>>() {
         @Override
--- a/javafx-ui-controls/test/javafx/scene/control/ComboBoxTest.java	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-ui-controls/test/javafx/scene/control/ComboBoxTest.java	Tue Jan 24 10:46:20 2012 -0500
@@ -26,9 +26,11 @@
 
 public class ComboBoxTest {
     private ComboBox<String> comboBox;
+    private SelectionModel<String> sm;
     
     @Before public void setup() {
         comboBox = new ComboBox<String>();
+        sm = comboBox.getSelectionModel();
     }
     
     /*********************************************************************
@@ -40,7 +42,7 @@
     }
     
     @Test public void noArgConstructorSetsNonNullSelectionModel() {
-        assertNotNull(comboBox.getSelectionModel());
+        assertNotNull(sm);
     }
     
     @Test public void noArgConstructorSetsNonNullItems() {
@@ -48,11 +50,11 @@
     }
     
     @Test public void noArgConstructor_selectedItemIsNull() {
-        assertNull(comboBox.getSelectionModel().getSelectedItem());
+        assertNull(sm.getSelectedItem());
     }
     
     @Test public void noArgConstructor_selectedIndexIsNegativeOne() {
-        assertEquals(-1, comboBox.getSelectionModel().getSelectedIndex());
+        assertEquals(-1, sm.getSelectedIndex());
     }
     
     @Test public void noArgConstructor_valueIsNull() {
@@ -171,124 +173,124 @@
         SelectionModel<String> sm = new ComboBox.ComboBoxSelectionModel<String>(comboBox);
         ObjectProperty<SelectionModel<String>> other = new SimpleObjectProperty<SelectionModel<String>>(sm);
         comboBox.selectionModelProperty().bind(other);
-        assertSame(sm, comboBox.getSelectionModel());
+        assertSame(sm, sm);
     }
 
     @Test public void selectionModelCanBeChanged() {
         SelectionModel<String> sm = new ComboBox.ComboBoxSelectionModel<String>(comboBox);
         comboBox.setSelectionModel(sm);
-        assertSame(sm, comboBox.getSelectionModel());
+        assertSame(sm, sm);
     }
     
     @Test public void canSetSelectedItemToAnItemEvenWhenThereAreNoItems() {
         final String randomString = new String("I AM A CRAZY RANDOM STRING");
-        comboBox.getSelectionModel().select(randomString);
-        assertEquals(-1, comboBox.getSelectionModel().getSelectedIndex());
-        assertSame(randomString, comboBox.getSelectionModel().getSelectedItem());
+        sm.select(randomString);
+        assertEquals(-1, sm.getSelectedIndex());
+        assertSame(randomString, sm.getSelectedItem());
     }
         
     @Test public void canSetSelectedItemToAnItemNotInTheDataModel() {
         comboBox.getItems().addAll("Apple", "Orange", "Banana");
         final String randomString = new String("I AM A CRAZY RANDOM STRING");
-        comboBox.getSelectionModel().select(randomString);
-        assertEquals(-1, comboBox.getSelectionModel().getSelectedIndex());
-        assertSame(randomString, comboBox.getSelectionModel().getSelectedItem());
+        sm.select(randomString);
+        assertEquals(-1, sm.getSelectedIndex());
+        assertSame(randomString, sm.getSelectedItem());
     }
         
     @Test public void settingTheSelectedItemToAnItemInItemsResultsInTheCorrectSelectedIndex() {
         comboBox.getItems().addAll("Apple", "Orange", "Banana");
-        comboBox.getSelectionModel().select("Orange");
-        assertEquals(1, comboBox.getSelectionModel().getSelectedIndex());
-        assertSame("Orange", comboBox.getSelectionModel().getSelectedItem());
+        sm.select("Orange");
+        assertEquals(1, sm.getSelectedIndex());
+        assertSame("Orange", sm.getSelectedItem());
     }
     
     @Test public void settingTheSelectedItemToANonexistantItemAndThenSettingItemsWhichContainsItResultsInCorrectSelectedIndex() {
-        comboBox.getSelectionModel().select("Orange");
+        sm.select("Orange");
         comboBox.getItems().addAll("Apple", "Orange", "Banana");
-        assertEquals(1, comboBox.getSelectionModel().getSelectedIndex());
-        assertSame("Orange", comboBox.getSelectionModel().getSelectedItem());
+        assertEquals(1, sm.getSelectedIndex());
+        assertSame("Orange", sm.getSelectedItem());
     }
     
     @Test public void ensureSelectionClearsWhenAllItemsAreRemoved_selectIndex0() {
         comboBox.getItems().addAll("Apple", "Orange", "Banana");
-        comboBox.getSelectionModel().select(0);
+        sm.select(0);
         comboBox.getItems().clear();
-        assertEquals(-1, comboBox.getSelectionModel().getSelectedIndex());
-        assertEquals(null, comboBox.getSelectionModel().getSelectedItem());
+        assertEquals(-1, sm.getSelectedIndex());
+        assertEquals(null, sm.getSelectedItem());
     }
     
     @Test public void ensureSelectionClearsWhenAllItemsAreRemoved_selectIndex2() {
         comboBox.getItems().addAll("Apple", "Orange", "Banana");
-        comboBox.getSelectionModel().select(2);
+        sm.select(2);
         comboBox.getItems().clear();
-        assertEquals(-1, comboBox.getSelectionModel().getSelectedIndex());
-        assertEquals(null, comboBox.getSelectionModel().getSelectedItem());
+        assertEquals(-1, sm.getSelectedIndex());
+        assertEquals(null, sm.getSelectedItem());
     }
     
     @Test public void ensureSelectedItemRemainsAccurateWhenItemsAreCleared() {
         comboBox.getItems().addAll("Apple", "Orange", "Banana");
-        comboBox.getSelectionModel().select(2);
+        sm.select(2);
         comboBox.getItems().clear();
-        assertNull(comboBox.getSelectionModel().getSelectedItem());
-        assertEquals(-1, comboBox.getSelectionModel().getSelectedIndex());
+        assertNull(sm.getSelectedItem());
+        assertEquals(-1, sm.getSelectedIndex());
         
         comboBox.getItems().addAll("Kiwifruit", "Mandarin", "Pineapple");
-        comboBox.getSelectionModel().select(2);
-        assertEquals("Pineapple", comboBox.getSelectionModel().getSelectedItem());
+        sm.select(2);
+        assertEquals("Pineapple", sm.getSelectedItem());
     }
     
     @Test public void ensureSelectionShiftsDownWhenOneNewItemIsAdded() {
         comboBox.getItems().addAll("Apple", "Orange", "Banana");
-        comboBox.getSelectionModel().select(1);
-        assertEquals(1, comboBox.getSelectionModel().getSelectedIndex());
-        assertEquals("Orange", comboBox.getSelectionModel().getSelectedItem());
+        sm.select(1);
+        assertEquals(1, sm.getSelectedIndex());
+        assertEquals("Orange", sm.getSelectedItem());
         
         comboBox.getItems().add(0, "Kiwifruit");
-        assertEquals(2, comboBox.getSelectionModel().getSelectedIndex());
-        assertEquals("Orange", comboBox.getSelectionModel().getSelectedItem());
+        assertEquals(2, sm.getSelectedIndex());
+        assertEquals("Orange", sm.getSelectedItem());
     }
     
     @Test public void ensureSelectionShiftsDownWhenMultipleNewItemAreAdded() {
         comboBox.getItems().addAll("Apple", "Orange", "Banana");
-        comboBox.getSelectionModel().select(1);
-        assertEquals(1, comboBox.getSelectionModel().getSelectedIndex());
-        assertEquals("Orange", comboBox.getSelectionModel().getSelectedItem());
+        sm.select(1);
+        assertEquals(1, sm.getSelectedIndex());
+        assertEquals("Orange", sm.getSelectedItem());
         
         comboBox.getItems().addAll(0, Arrays.asList("Kiwifruit", "Pineapple", "Mandarin"));
-        assertEquals("Orange", comboBox.getSelectionModel().getSelectedItem());
-        assertEquals(4, comboBox.getSelectionModel().getSelectedIndex());
+        assertEquals("Orange", sm.getSelectedItem());
+        assertEquals(4, sm.getSelectedIndex());
     }
     
     @Test public void ensureSelectionShiftsUpWhenOneItemIsRemoved() {
         comboBox.getItems().addAll("Apple", "Orange", "Banana");
-        comboBox.getSelectionModel().select(1);
-        assertEquals(1, comboBox.getSelectionModel().getSelectedIndex());
-        assertEquals("Orange", comboBox.getSelectionModel().getSelectedItem());
+        sm.select(1);
+        assertEquals(1, sm.getSelectedIndex());
+        assertEquals("Orange", sm.getSelectedItem());
         
         comboBox.getItems().remove("Apple");
-        assertEquals(0, comboBox.getSelectionModel().getSelectedIndex());
-        assertEquals("Orange", comboBox.getSelectionModel().getSelectedItem());
+        assertEquals(0, sm.getSelectedIndex());
+        assertEquals("Orange", sm.getSelectedItem());
     }
     
     @Test public void ensureSelectionShiftsUpWheMultipleItemsAreRemoved() {
         comboBox.getItems().addAll("Apple", "Orange", "Banana");
-        comboBox.getSelectionModel().select(2);
-        assertEquals(2, comboBox.getSelectionModel().getSelectedIndex());
-        assertEquals("Banana", comboBox.getSelectionModel().getSelectedItem());
+        sm.select(2);
+        assertEquals(2, sm.getSelectedIndex());
+        assertEquals("Banana", sm.getSelectedItem());
         
         comboBox.getItems().removeAll(Arrays.asList("Apple", "Orange"));
-        assertEquals(0, comboBox.getSelectionModel().getSelectedIndex());
-        assertEquals("Banana", comboBox.getSelectionModel().getSelectedItem());
+        assertEquals(0, sm.getSelectedIndex());
+        assertEquals("Banana", sm.getSelectedItem());
     }
     
     @Test public void ensureSelectionIsCorrectWhenItemsChange() {
         comboBox.setItems(FXCollections.observableArrayList("Item 1"));
-        comboBox.getSelectionModel().select(0);
-        assertEquals("Item 1", comboBox.getSelectionModel().getSelectedItem());
+        sm.select(0);
+        assertEquals("Item 1", sm.getSelectedItem());
         
         comboBox.setItems(FXCollections.observableArrayList("Item 2"));
-        assertEquals(-1, comboBox.getSelectionModel().getSelectedIndex());
-        assertEquals(null, comboBox.getSelectionModel().getSelectedItem());
+        assertEquals(-1, sm.getSelectedIndex());
+        assertEquals(null, sm.getSelectedItem());
     }
     
     @Test(expected=NullPointerException.class) 
@@ -323,92 +325,92 @@
     @Test public void ensureSelectionModelUpdatesValueProperty_withSelectIndex() {
         comboBox.getItems().addAll("Apple", "Orange", "Banana");
         assertNull(comboBox.getValue());
-        comboBox.getSelectionModel().select(0);
+        sm.select(0);
         assertEquals("Apple", comboBox.getValue());
     }
     
     @Test public void ensureSelectionModelUpdatesValueProperty_withSelectItem() {
         comboBox.getItems().addAll("Apple", "Orange", "Banana");
         assertNull(comboBox.getValue());
-        comboBox.getSelectionModel().select("Apple");
+        sm.select("Apple");
         assertEquals("Apple", comboBox.getValue());
     }
     
     @Test public void ensureSelectionModelUpdatesValueProperty_withSelectPrevious() {
         comboBox.getItems().addAll("Apple", "Orange", "Banana");
         assertNull(comboBox.getValue());
-        comboBox.getSelectionModel().select(2);
-        comboBox.getSelectionModel().selectPrevious();
+        sm.select(2);
+        sm.selectPrevious();
         assertEquals("Orange", comboBox.getValue());
     }
     
     @Test public void ensureSelectionModelUpdatesValueProperty_withSelectNext() {
         comboBox.getItems().addAll("Apple", "Orange", "Banana");
         assertNull(comboBox.getValue());
-        comboBox.getSelectionModel().select("Apple");
-        comboBox.getSelectionModel().selectNext();
+        sm.select("Apple");
+        sm.selectNext();
         assertEquals("Orange", comboBox.getValue());
     }
     
     @Test public void ensureSelectionModelUpdatesValueProperty_withSelectFirst() {
         comboBox.getItems().addAll("Apple", "Orange", "Banana");
         assertNull(comboBox.getValue());
-        comboBox.getSelectionModel().selectFirst();
+        sm.selectFirst();
         assertEquals("Apple", comboBox.getValue());
     }
     
     @Test public void ensureSelectionModelUpdatesValueProperty_withSelectLast() {
         comboBox.getItems().addAll("Apple", "Orange", "Banana");
         assertNull(comboBox.getValue());
-        comboBox.getSelectionModel().selectLast();
+        sm.selectLast();
         assertEquals("Banana", comboBox.getValue());
     }
     
     @Test public void ensureSelectionModelClearsValueProperty() {
         comboBox.getItems().addAll("Apple", "Orange", "Banana");
         assertNull(comboBox.getValue());
-        comboBox.getSelectionModel().select(0);
+        sm.select(0);
         assertEquals("Apple", comboBox.getValue());
         
-        comboBox.getSelectionModel().clearSelection();
+        sm.clearSelection();
         assertNull(comboBox.getValue());
     }
     
     @Test public void ensureSelectionModelClearsValuePropertyWhenNegativeOneSelected() {
         comboBox.getItems().addAll("Apple", "Orange", "Banana");
         assertNull(comboBox.getValue());
-        comboBox.getSelectionModel().select(0);
+        sm.select(0);
         assertEquals("Apple", comboBox.getValue());
         
-        comboBox.getSelectionModel().select(-1);
+        sm.select(-1);
         assertNull("Expected null, actual value: " + comboBox.getValue(), comboBox.getValue());
     }
     
     @Test public void ensureValueIsCorrectWhenItemsIsAddedToWithExistingSelection() {
         comboBox.getItems().addAll("Apple", "Orange", "Banana");
-        comboBox.getSelectionModel().select(1);
+        sm.select(1);
         
         comboBox.getItems().add(0, "Kiwifruit");
         
-        assertEquals(2, comboBox.getSelectionModel().getSelectedIndex());
-        assertEquals("Orange", comboBox.getSelectionModel().getSelectedItem());
+        assertEquals(2, sm.getSelectedIndex());
+        assertEquals("Orange", sm.getSelectedItem());
         assertEquals("Orange", comboBox.getValue());
     }
     
     @Test public void ensureValueIsCorrectWhenItemsAreRemovedWithExistingSelection() {
         comboBox.getItems().addAll("Apple", "Orange", "Banana");
-        comboBox.getSelectionModel().select(1);
+        sm.select(1);
         
         comboBox.getItems().remove("Apple");
         
-        assertEquals(0, comboBox.getSelectionModel().getSelectedIndex());
-        assertEquals("Orange", comboBox.getSelectionModel().getSelectedItem());
+        assertEquals(0, sm.getSelectedIndex());
+        assertEquals("Orange", sm.getSelectedItem());
         assertEquals("Orange", comboBox.getValue());
     }
     
     @Test public void ensureValueIsUpdatedByCorrectSelectionModelWhenSelectionModelIsChanged() {
         comboBox.getItems().addAll("Apple", "Orange", "Banana");
-        SelectionModel sm1 = comboBox.getSelectionModel();
+        SelectionModel sm1 = sm;
         sm1.select(1);
         assertEquals("Orange", comboBox.getValue());
         
@@ -428,32 +430,32 @@
         StringProperty sp = new SimpleStringProperty("empty");
         comboBox.valueProperty().bind(sp);
         
-        comboBox.getSelectionModel().select(1);
+        sm.select(1);
         assertEquals("empty", comboBox.getValue());
     }
     
     @Test public void ensureSelectionModelUpdatesWhenValueChanges() {
         comboBox.getItems().addAll("Apple", "Orange", "Banana");
-        assertNull(comboBox.getSelectionModel().getSelectedItem());
+        assertNull(sm.getSelectedItem());
         comboBox.setValue("Orange");
-        assertEquals("Orange", comboBox.getSelectionModel().getSelectedItem());
+        assertEquals("Orange", sm.getSelectedItem());
     }
     
     @Test public void ensureSelectionModelUpdatesWhenValueChangesToNull() {
         comboBox.getItems().addAll("Apple", "Orange", "Banana");
         comboBox.setValue("Kiwifruit");
-        assertNull(comboBox.getSelectionModel().getSelectedItem());
+        assertEquals("Kiwifruit", sm.getSelectedItem());
         assertEquals("Kiwifruit", comboBox.getValue());
         comboBox.setValue(null);
-        assertEquals(null, comboBox.getSelectionModel().getSelectedItem());
-        assertEquals(-1, comboBox.getSelectionModel().getSelectedIndex());
+        assertEquals(null, sm.getSelectedItem());
+        assertEquals(-1, sm.getSelectedIndex());
         assertEquals(null, comboBox.getValue());
     }
     
     @Test public void ensureValueEqualsSelectedItemWhenNotInItemsList() {
         comboBox.getItems().addAll("Apple", "Orange", "Banana");
-        comboBox.getSelectionModel().setSelectedItem("pineapple");
-        assertEquals("pineapple", comboBox.getSelectionModel().getSelectedItem());
+        sm.setSelectedItem("pineapple");
+        assertEquals("pineapple", sm.getSelectedItem());
         assertEquals("pineapple", comboBox.getValue());
     }
     
@@ -666,4 +668,30 @@
         strPr.setValue("newvalue");
         assertTrue("PromptText cannot be bound", comboBox.getValue().equals("newvalue"));
     }
+    
+    
+    /*********************************************************************
+     * Tests for bug reports                                             *
+     ********************************************************************/    
+    
+    @Test public void test_rt18972() {
+        comboBox.getItems().addAll("Apple", "Orange", "Banana");
+        sm.select(1);
+        assertTrue(sm.isSelected(1));
+        
+        comboBox.setEditable(true);
+        comboBox.setValue("New Value");
+        
+        // there should be no selection in the selection model, as "New Value" 
+        // isn't an item in the list, however, it is a totally valid value for
+        // the value property
+        assertFalse(sm.isSelected(1));      
+        assertEquals("New Value", sm.getSelectedItem());
+        assertEquals("New Value", comboBox.getValue());
+        
+        comboBox.setEditable(false);
+        assertEquals(-1, sm.getSelectedIndex());
+        assertEquals("New Value", sm.getSelectedItem());
+        assertEquals("New Value", comboBox.getValue());
+    }
 }
--- a/javafx-ui-controls/test/javafx/scene/control/KeyEventFirer.java	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-ui-controls/test/javafx/scene/control/KeyEventFirer.java	Tue Jan 24 10:46:20 2012 -0500
@@ -54,17 +54,17 @@
     }
     
     private KeyEvent createEvent(KeyCode keyCode, EventType<KeyEvent> evtType, KeyModifier... modifiers) {
-        List<KeyModifier> modifiersList = Arrays.asList(modifiers);
-        
+        List<KeyModifier> ml = Arrays.asList(modifiers);
+
         return KeyEvent.impl_keyEvent(
                 target, // EventTarget
                 null,     // Character (unused unless KeyCode == KEY_TYPED
                 null,     // text
                 keyCode.impl_getCode(), // KeyCode
-                modifiersList.contains(KeyModifier.SHIFT),    // shiftDown
-                modifiersList.contains(KeyModifier.CTRL),     // ctrlDown
-                modifiersList.contains(KeyModifier.ALT),      // altDown
-                modifiersList.contains(KeyModifier.META),     // metaData
+                ml.contains(KeyModifier.SHIFT),                                   // shiftDown
+                ml.contains(KeyModifier.CTRL),                                    // ctrlDown
+                ml.contains(KeyModifier.ALT),                                     // altDown
+                ml.contains(KeyModifier.META) || ml.contains(KeyModifier.CMD),    // metaData
                 evtType);  // eventType
     }
 }
--- a/javafx-ui-controls/test/javafx/scene/control/ListViewKeyInputTest.java	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-ui-controls/test/javafx/scene/control/ListViewKeyInputTest.java	Tue Jan 24 10:46:20 2012 -0500
@@ -18,6 +18,7 @@
 import org.junit.Ignore;
 import org.junit.Test;
 
+@Ignore("Disabling tests as they fail with OOM in continuous builds")
 public class ListViewKeyInputTest {
     private ListView<String> listView;
     private MultipleSelectionModel<String> sm;
--- a/javafx-ui-controls/test/javafx/scene/control/ListViewTest.java	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-ui-controls/test/javafx/scene/control/ListViewTest.java	Tue Jan 24 10:46:20 2012 -0500
@@ -9,6 +9,8 @@
 
 import javafx.beans.property.ObjectProperty;
 import javafx.beans.property.SimpleObjectProperty;
+import javafx.beans.value.ChangeListener;
+import javafx.beans.value.ObservableValue;
 import javafx.collections.FXCollections;
 import javafx.collections.ObservableList;
 
@@ -17,9 +19,11 @@
 
 public class ListViewTest {
     private ListView<String> listView;
+    private MultipleSelectionModel<String> sm;
     
     @Before public void setup() {
         listView = new ListView<String>();
+        sm = listView.getSelectionModel();
     }
     
     /*********************************************************************
@@ -31,7 +35,7 @@
     }
     
     @Test public void noArgConstructorSetsNonNullSelectionModel() {
-        assertNotNull(listView.getSelectionModel());
+        assertNotNull(sm);
     }
     
     @Test public void noArgConstructorSetsNonNullItems() {
@@ -39,11 +43,11 @@
     }
     
     @Test public void noArgConstructor_selectedItemIsNull() {
-        assertNull(listView.getSelectionModel().getSelectedItem());
+        assertNull(sm.getSelectedItem());
     }
     
     @Test public void noArgConstructor_selectedIndexIsNegativeOne() {
-        assertEquals(-1, listView.getSelectionModel().getSelectedIndex());
+        assertEquals(-1, sm.getSelectedIndex());
     }
     
     @Test public void singleArgConstructorSetsTheStyleClass() {
@@ -90,124 +94,124 @@
         MultipleSelectionModel<String> sm = new ListView.ListViewBitSetSelectionModel<String>(listView);
         ObjectProperty<MultipleSelectionModel<String>> other = new SimpleObjectProperty<MultipleSelectionModel<String>>(sm);
         listView.selectionModelProperty().bind(other);
-        assertSame(sm, listView.getSelectionModel());
+        assertSame(sm, sm);
     }
 
     @Test public void selectionModelCanBeChanged() {
         MultipleSelectionModel<String> sm = new ListView.ListViewBitSetSelectionModel<String>(listView);
         listView.setSelectionModel(sm);
-        assertSame(sm, listView.getSelectionModel());
+        assertSame(sm, sm);
     }
     
     @Test public void canSetSelectedItemToAnItemEvenWhenThereAreNoItems() {
         final String randomString = new String("I AM A CRAZY RANDOM STRING");
-        listView.getSelectionModel().select(randomString);
-        assertEquals(-1, listView.getSelectionModel().getSelectedIndex());
-        assertSame(randomString, listView.getSelectionModel().getSelectedItem());
+        sm.select(randomString);
+        assertEquals(-1, sm.getSelectedIndex());
+        assertSame(randomString, sm.getSelectedItem());
     }
         
     @Test public void canSetSelectedItemToAnItemNotInTheDataModel() {
         listView.getItems().addAll("Apple", "Orange", "Banana");
         final String randomString = new String("I AM A CRAZY RANDOM STRING");
-        listView.getSelectionModel().select(randomString);
-        assertEquals(-1, listView.getSelectionModel().getSelectedIndex());
-        assertSame(randomString, listView.getSelectionModel().getSelectedItem());
+        sm.select(randomString);
+        assertEquals(-1, sm.getSelectedIndex());
+        assertSame(randomString, sm.getSelectedItem());
     }
         
     @Test public void settingTheSelectedItemToAnItemInItemsResultsInTheCorrectSelectedIndex() {
         listView.getItems().addAll("Apple", "Orange", "Banana");
-        listView.getSelectionModel().select("Orange");
-        assertEquals(1, listView.getSelectionModel().getSelectedIndex());
-        assertSame("Orange", listView.getSelectionModel().getSelectedItem());
+        sm.select("Orange");
+        assertEquals(1, sm.getSelectedIndex());
+        assertSame("Orange", sm.getSelectedItem());
     }
     
     @Test public void settingTheSelectedItemToANonexistantItemAndThenSettingItemsWhichContainsItResultsInCorrectSelectedIndex() {
-        listView.getSelectionModel().select("Orange");
+        sm.select("Orange");
         listView.getItems().addAll("Apple", "Orange", "Banana");
-        assertEquals(1, listView.getSelectionModel().getSelectedIndex());
-        assertSame("Orange", listView.getSelectionModel().getSelectedItem());
+        assertEquals(1, sm.getSelectedIndex());
+        assertSame("Orange", sm.getSelectedItem());
     }
     
     @Test public void ensureSelectionClearsWhenAllItemsAreRemoved_selectIndex0() {
         listView.getItems().addAll("Apple", "Orange", "Banana");
-        listView.getSelectionModel().select(0);
+        sm.select(0);
         listView.getItems().clear();
-        assertEquals(-1, listView.getSelectionModel().getSelectedIndex());
-        assertEquals(null, listView.getSelectionModel().getSelectedItem());
+        assertEquals(-1, sm.getSelectedIndex());
+        assertEquals(null, sm.getSelectedItem());
     }
     
     @Test public void ensureSelectionClearsWhenAllItemsAreRemoved_selectIndex2() {
         listView.getItems().addAll("Apple", "Orange", "Banana");
-        listView.getSelectionModel().select(2);
+        sm.select(2);
         listView.getItems().clear();
-        assertEquals(-1, listView.getSelectionModel().getSelectedIndex());
-        assertEquals(null, listView.getSelectionModel().getSelectedItem());
+        assertEquals(-1, sm.getSelectedIndex());
+        assertEquals(null, sm.getSelectedItem());
     }
     
     @Test public void ensureSelectedItemRemainsAccurateWhenItemsAreCleared() {
         listView.getItems().addAll("Apple", "Orange", "Banana");
-        listView.getSelectionModel().select(2);
+        sm.select(2);
         listView.getItems().clear();
-        assertNull(listView.getSelectionModel().getSelectedItem());
-        assertEquals(-1, listView.getSelectionModel().getSelectedIndex());
+        assertNull(sm.getSelectedItem());
+        assertEquals(-1, sm.getSelectedIndex());
         
         listView.getItems().addAll("Kiwifruit", "Mandarin", "Pineapple");
-        listView.getSelectionModel().select(2);
-        assertEquals("Pineapple", listView.getSelectionModel().getSelectedItem());
+        sm.select(2);
+        assertEquals("Pineapple", sm.getSelectedItem());
     }
     
     @Test public void ensureSelectionShiftsDownWhenOneNewItemIsAdded() {
         listView.getItems().addAll("Apple", "Orange", "Banana");
-        listView.getSelectionModel().select(1);
-        assertEquals(1, listView.getSelectionModel().getSelectedIndex());
-        assertEquals("Orange", listView.getSelectionModel().getSelectedItem());
+        sm.select(1);
+        assertEquals(1, sm.getSelectedIndex());
+        assertEquals("Orange", sm.getSelectedItem());
         
         listView.getItems().add(0, "Kiwifruit");
-        assertEquals(2, listView.getSelectionModel().getSelectedIndex());
-        assertEquals("Orange", listView.getSelectionModel().getSelectedItem());
+        assertEquals(2, sm.getSelectedIndex());
+        assertEquals("Orange", sm.getSelectedItem());
     }
     
     @Test public void ensureSelectionShiftsDownWhenMultipleNewItemAreAdded() {
         listView.getItems().addAll("Apple", "Orange", "Banana");
-        listView.getSelectionModel().select(1);
-        assertEquals(1, listView.getSelectionModel().getSelectedIndex());
-        assertEquals("Orange", listView.getSelectionModel().getSelectedItem());
+        sm.select(1);
+        assertEquals(1, sm.getSelectedIndex());
+        assertEquals("Orange", sm.getSelectedItem());
         
         listView.getItems().addAll(0, Arrays.asList("Kiwifruit", "Pineapple", "Mandarin"));
-        assertEquals("Orange", listView.getSelectionModel().getSelectedItem());
-        assertEquals(4, listView.getSelectionModel().getSelectedIndex());
+        assertEquals("Orange", sm.getSelectedItem());
+        assertEquals(4, sm.getSelectedIndex());
     }
     
     @Test public void ensureSelectionShiftsUpWhenOneItemIsRemoved() {
         listView.getItems().addAll("Apple", "Orange", "Banana");
-        listView.getSelectionModel().select(1);
-        assertEquals(1, listView.getSelectionModel().getSelectedIndex());
-        assertEquals("Orange", listView.getSelectionModel().getSelectedItem());
+        sm.select(1);
+        assertEquals(1, sm.getSelectedIndex());
+        assertEquals("Orange", sm.getSelectedItem());
         
         listView.getItems().remove("Apple");
-        assertEquals(0, listView.getSelectionModel().getSelectedIndex());
-        assertEquals("Orange", listView.getSelectionModel().getSelectedItem());
+        assertEquals(0, sm.getSelectedIndex());
+        assertEquals("Orange", sm.getSelectedItem());
     }
     
     @Test public void ensureSelectionShiftsUpWheMultipleItemsAreRemoved() {
         listView.getItems().addAll("Apple", "Orange", "Banana");
-        listView.getSelectionModel().select(2);
-        assertEquals(2, listView.getSelectionModel().getSelectedIndex());
-        assertEquals("Banana", listView.getSelectionModel().getSelectedItem());
+        sm.select(2);
+        assertEquals(2, sm.getSelectedIndex());
+        assertEquals("Banana", sm.getSelectedItem());
         
         listView.getItems().removeAll(Arrays.asList("Apple", "Orange"));
-        assertEquals(0, listView.getSelectionModel().getSelectedIndex());
-        assertEquals("Banana", listView.getSelectionModel().getSelectedItem());
+        assertEquals(0, sm.getSelectedIndex());
+        assertEquals("Banana", sm.getSelectedItem());
     }
     
     @Test public void ensureSelectionIsCorrectWhenItemsChange() {
         listView.setItems(FXCollections.observableArrayList("Item 1"));
-        listView.getSelectionModel().select(0);
-        assertEquals("Item 1", listView.getSelectionModel().getSelectedItem());
+        sm.select(0);
+        assertEquals("Item 1", sm.getSelectedItem());
         
         listView.setItems(FXCollections.observableArrayList("Item 2"));
-        assertEquals(-1, listView.getSelectionModel().getSelectedIndex());
-        assertEquals(null, listView.getSelectionModel().getSelectedItem());
+        assertEquals(-1, sm.getSelectedIndex());
+        assertEquals(null, sm.getSelectedItem());
     }
     
     @Test public void test_rt15793() {
@@ -301,10 +305,10 @@
     
     @Test public void test_rt18385() {
         listView.getItems().addAll("row1", "row2", "row3");
-        listView.getSelectionModel().select(1);
+        sm.select(1);
         listView.getItems().add("Another Row");
-        assertEquals(1, listView.getSelectionModel().getSelectedIndices().size());
-        assertEquals(1, listView.getSelectionModel().getSelectedItems().size());
+        assertEquals(1, sm.getSelectedIndices().size());
+        assertEquals(1, sm.getSelectedItems().size());
     }
     
     @Test public void test_rt18339_onlyEditWhenListViewIsEditable_editableIsFalse() {
@@ -321,8 +325,39 @@
     
     @Test public void test_rt14451() {
         listView.getItems().addAll("Apple", "Orange", "Banana");
-        listView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
-        listView.getSelectionModel().selectRange(0, 2); // select from 0 (inclusive) to 2 (exclusive)
-        assertEquals(2, listView.getSelectionModel().getSelectedIndices().size());
+        sm.setSelectionMode(SelectionMode.MULTIPLE);
+        sm.selectRange(0, 2); // select from 0 (inclusive) to 2 (exclusive)
+        assertEquals(2, sm.getSelectedIndices().size());
+    }
+    
+    private int hitCount = 0;
+    @Test public void test_rt18969() {
+        hitCount = 0;
+        ObservableList<String> emptyModel = FXCollections.observableArrayList();
+        listView.setItems(emptyModel);
+        assertTrue(listView.getItems().isEmpty());
+        
+        sm.selectedItemProperty().addListener(new ChangeListener<String>() {
+            @Override public void changed(ObservableValue<? extends String> observable, String oldValue, final String newValue) {
+                hitCount++;
+            }
+        });
+        
+        ObservableList<String> mod = FXCollections.observableArrayList();
+        mod.add(System.currentTimeMillis()+"");
+        listView.getItems().setAll(mod);
+        
+        sm.select(0);
+        assertTrue(sm.isSelected(0));
+        assertEquals(1, hitCount);
+        
+        // the list is totally changing (it is being cleared), so we should 
+        // be nulling out the selection model state
+        mod = FXCollections.observableArrayList();
+        mod.add(System.currentTimeMillis()+"");
+        listView.getItems().setAll(mod);
+        
+        // it should be three, as there is a null event in between
+        assertEquals(3, hitCount);
     }
 }
--- a/javafx-ui-controls/test/javafx/scene/control/SplitPaneTest.java	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-ui-controls/test/javafx/scene/control/SplitPaneTest.java	Tue Jan 24 10:46:20 2012 -0500
@@ -14,11 +14,14 @@
 import javafx.beans.property.SimpleDoubleProperty;
 import javafx.beans.property.SimpleObjectProperty;
 import javafx.geometry.Orientation;
+import javafx.scene.Scene;
 import javafx.scene.layout.StackPane;
+import javafx.stage.Stage;
 import static org.junit.Assert.*;
 
 
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 
 /**
@@ -30,6 +33,9 @@
     private SplitPane.Divider divider1;
     private SplitPane.Divider divider2;
     private Toolkit tk;
+    private Scene scene;
+    private Stage stage;
+    private StackPane root;
 
     @Before public void setup() {
         tk = (StubToolkit)Toolkit.getToolkit();//This step is not needed (Just to make sure StubToolkit is loaded into VM)
@@ -37,8 +43,13 @@
         splitPane.setSkin(new SplitPaneSkin(splitPane));
         divider1 = new SplitPane.Divider();
         divider2 = new SplitPane.Divider();
+
+        root = new StackPane();
+        scene = new Scene(root);
+        stage = new Stage();
+        stage.setScene(scene);
     }
-    
+
     /*********************************************************************
      * Helper methods (NOTE TESTS)                                       *
      ********************************************************************/
@@ -50,19 +61,29 @@
         add2NodesToSplitPane();
         splitPane.getItems().add(new Button("Button Three"));
     }
-    
+
     private void add4NodesToSplitPane() {
         add3NodesToSplitPane();
         splitPane.getItems().add(new Button("Button Four"));
     }
+
+    private void show() {
+        stage.show();
+    }
+
+
+    private double convertDividerPostionToAbsolutePostion(double pos, double edge) {        
+        return (Math.round(pos * edge)) - 3;  // 3 is half the divider width.
+    }
+    
     /*********************************************************************
      * Tests for default values                                         *
      ********************************************************************/
-    
+
     @Test public void defaultConstructorShouldSetStyleClassTo_splitpane() {
         assertStyleClassContains(splitPane, "split-pane");
     }
-    
+
     @Test public void defaultFocusTraversibleIsFalse() {
         assertFalse(splitPane.isFocusTraversable());
     }
@@ -81,11 +102,11 @@
         assertEquals(splitPane.getDividers().get(1).getPosition(), 0.5, 0.0);
         assertEquals(splitPane.getDividers().get(1).getPosition(), 0.5, 0.0);
     }
-    
+
     /*********************************************************************
      * Tests for property binding                                        *
      ********************************************************************/
-    
+
     @Test public void checkHBarPolicyPropertyBind() {
         ObjectProperty objPr = new SimpleObjectProperty<Orientation>(Orientation.VERTICAL);
         splitPane.orientationProperty().bind(objPr);
@@ -93,7 +114,7 @@
         objPr.setValue(Orientation.HORIZONTAL);
         assertSame("orientationProperty cannot be bound", splitPane.orientationProperty().getValue(), Orientation.HORIZONTAL);
     }
-    
+
     @Test public void checkDividerPositionPropertyBind() {
         DoubleProperty objPr = new SimpleDoubleProperty(0.6);
         divider1.positionProperty().bind(objPr);
@@ -126,8 +147,8 @@
         assertEquals("position", divider1.positionProperty().getName());
     }
 
-    
-    
+
+
     /*********************************************************************
      * Check for Pseudo classes                                          *
      ********************************************************************/
@@ -158,7 +179,7 @@
     }
 
 
-    
+
     /*********************************************************************
      * CSS related Tests                                                 *
      ********************************************************************/
@@ -189,28 +210,28 @@
         splitPane.setOrientation(Orientation.HORIZONTAL);
         assertSame(splitPane.orientationProperty().getValue(), Orientation.HORIZONTAL);
     }
-    
+
     @Test public void setOrientationAndSeeValue() {
         splitPane.setOrientation(Orientation.VERTICAL);
         assertSame(splitPane.getOrientation(), Orientation.VERTICAL);
     }
-    
+
     @Test public void setPositionAndSeeValueIsReflectedInModel() {
         divider1.setPosition(0.2);
         assertEquals(divider1.positionProperty().getValue(), 0.2, 0.0);
     }
-    
+
     @Test public void setPositionAndSeeValue() {
         divider1.setPosition(0.3);
         assertEquals(divider1.getPosition(), 0.3, 0.0);
     }
-    
+
     @Test public void addingNnodesToSplitPaneCreatesNminus1Dividers() {
         add3NodesToSplitPane();
         assertNotNull(splitPane.getDividers());
         assertEquals(splitPane.getDividers().size(), 2, 0.0);
     }
-    
+
     @Test public void setMultipleDividerPositionsAndValidate() {
         add3NodesToSplitPane();
         splitPane.setDividerPosition(0, 0.4);
@@ -220,7 +241,7 @@
         assertEquals(splitPane.getDividers().get(0).getPosition(), 0.4, 0.0);
         assertEquals(splitPane.getDividers().get(1).getPosition(), 0.6, 0.0);
     }
-    
+
     @Test public void addingNonExistantDividerPositionToSplitPaneCachesItAndAppliesWhenNewNodeAreAdded() {
         add2NodesToSplitPane();
         splitPane.setDividerPosition(2, 0.4);//2 is a non existant divider position, but still position value 0.4 is cached
@@ -232,35 +253,862 @@
         assertEquals(splitPane.getDividers().get(2).getPosition(), 0.4, 0.0);
     }
 
-    @Test public void checkDividerPositions_RT18805() {        
-        final Button l = new Button("Left Button");
-        final Button c = new Button("Center Button");
-        final Button r = new Button("Right Button");
+    @Test public void zeroDivider() {
+        StackPane spCenter = new StackPane();
+        splitPane.getItems().addAll(spCenter);
+
+        root.setPrefSize(400, 400);
+        root.getChildren().add(splitPane);
+        show();
+
+        root.impl_reapplyCSS();
+        root.autosize();
+        root.layout();
+
+        assertEquals(0, splitPane.getDividers().size());
+        assertEquals(398, spCenter.getLayoutBounds().getWidth(), 1e-100);
+    }
+
+    @Test public void oneDividerPanelsAreEquallySized() {
+        StackPane spLeft = new StackPane();
+        StackPane spRight = new StackPane();
+
+        splitPane.getItems().addAll(spLeft, spRight);
+
+        root.setPrefSize(400, 400);
+        root.getChildren().add(splitPane);
+        show();
+
+        root.impl_reapplyCSS();
+        root.autosize();
+        root.layout();
+
+        double w = 398; // The width minus the insets.
+        double pos[] = splitPane.getDividerPositions();
+        double p0 = convertDividerPostionToAbsolutePostion(pos[0], w);
+
+        assertEquals(196, p0, 1e-100);
+        assertEquals(196, spLeft.getLayoutBounds().getWidth(), 1e-100);
+        assertEquals(196, spRight.getLayoutBounds().getWidth(), 1e-100);
+    }
+    
+    @Test public void twoDividersHaveTheSamePosition() {
+        StackPane spLeft = new StackPane();
+        StackPane spCenter = new StackPane();
+        StackPane spRight = new StackPane();
+
+        splitPane.getItems().addAll(spLeft, spCenter, spRight);
+
+        root.setPrefSize(400, 400);
+        root.getChildren().add(splitPane);
+        show();
+
+        root.impl_reapplyCSS();
+        root.autosize();
+        root.layout();
+
+        double w = 398; // The width minus the insets.
+        double pos[] = splitPane.getDividerPositions();
+        double p0 = convertDividerPostionToAbsolutePostion(pos[0], w);
+        double p1 = convertDividerPostionToAbsolutePostion(pos[1], w);
+
+        assertEquals(196, p0, 1e-100);
+        assertEquals(202, p1, 1e-100);
+        assertEquals(196, spLeft.getLayoutBounds().getWidth(), 1e-100);
+        assertEquals(0, spCenter.getLayoutBounds().getWidth(), 1e-100);
+        assertEquals(190, spRight.getLayoutBounds().getWidth(), 1e-100);
+    }
+
+    @Test public void twoDividersHaveTheDifferentPositions() {
+        StackPane spLeft = new StackPane();
+        StackPane spCenter = new StackPane();
+        StackPane spRight = new StackPane();
+
+        splitPane.setDividerPosition(0, 0.20);
+        splitPane.setDividerPosition(1, 0.80);
+        splitPane.getItems().addAll(spLeft, spCenter, spRight);
+
+        root.setPrefSize(400, 400);
+        root.getChildren().add(splitPane);
+        show();
+
+        root.impl_reapplyCSS();
+        root.autosize();
+        root.layout();
+
+        double w = 398; // The width minus the insets.
+        double pos[] = splitPane.getDividerPositions();
+        double p0 = convertDividerPostionToAbsolutePostion(pos[0], w);
+        double p1 = convertDividerPostionToAbsolutePostion(pos[1], w);
+
+        assertEquals(77, p0, 1e-100);
+        assertEquals(315, p1, 1e-100);
+        assertEquals(77, spLeft.getLayoutBounds().getWidth(), 1e-100);
+        assertEquals(232, spCenter.getLayoutBounds().getWidth(), 1e-100);
+        assertEquals(77, spRight.getLayoutBounds().getWidth(), 1e-100);
+    }
+
+    @Test public void threePanelsAllAreSetToMin() {
+        StackPane spLeft = new StackPane();
+        StackPane spCenter = new StackPane();
+        StackPane spRight = new StackPane();
+
+        spLeft.setMinWidth(28);
+        spCenter.setMinWidth(29);
+        spRight.setMinWidth(29);
+        
+        splitPane.setDividerPosition(0, 0.20);
+        splitPane.setDividerPosition(1, 0.80);
+        splitPane.getItems().addAll(spLeft, spCenter, spRight);
+
+        root.setPrefSize(100, 100);
+        root.getChildren().add(splitPane);
+        show();
+
+        root.impl_reapplyCSS();
+        root.autosize();
+        root.layout();
+
+        double w = 98; // The width minus the insets.
+        double pos[] = splitPane.getDividerPositions();
+        double p0 = convertDividerPostionToAbsolutePostion(pos[0], w);
+        double p1 = convertDividerPostionToAbsolutePostion(pos[1], w);
+
+        assertEquals(28, p0, 1e-100);
+        assertEquals(63, p1, 1e-100);
+        assertEquals(28, spLeft.getLayoutBounds().getWidth(), 1e-100);
+        assertEquals(29, spCenter.getLayoutBounds().getWidth(), 1e-100);
+        assertEquals(29, spRight.getLayoutBounds().getWidth(), 1e-100);
+    }
+
+    @Test public void threePanelsAllAreSetToMax() {
+        StackPane spLeft = new StackPane();
+        StackPane spCenter = new StackPane();
+        StackPane spRight = new StackPane();
+
+        spLeft.setMaxWidth(28);
+        spCenter.setMaxWidth(29);
+        spRight.setMaxWidth(29);
+
+        splitPane.setDividerPosition(0, 0.20);
+        splitPane.setDividerPosition(1, 0.80);
+        splitPane.getItems().addAll(spLeft, spCenter, spRight);
+
+        root.setPrefSize(100, 100);
+        root.getChildren().add(splitPane);
+        show();
+
+        root.impl_reapplyCSS();
+        root.autosize();
+        root.layout();
+
+        double w = 98; // The width minus the insets.
+        double pos[] = splitPane.getDividerPositions();
+        double p0 = convertDividerPostionToAbsolutePostion(pos[0], w);
+        double p1 = convertDividerPostionToAbsolutePostion(pos[1], w);
+
+        assertEquals(28, p0, 1e-100);
+        assertEquals(63, p1, 1e-100);
+        assertEquals(28, spLeft.getLayoutBounds().getWidth(), 1e-100);
+        assertEquals(29, spCenter.getLayoutBounds().getWidth(), 1e-100);
+        assertEquals(29, spRight.getLayoutBounds().getWidth(), 1e-100);
+    }
+
+    @Test public void threePanelsSetToMinMaxMin() {
+        StackPane spLeft = new StackPane();
+        StackPane spCenter = new StackPane();
+        StackPane spRight = new StackPane();
+
+        spLeft.setMinWidth(28);
+        spCenter.setMaxWidth(29);
+        spRight.setMinWidth(29);
+
+        splitPane.setDividerPosition(0, 0.20);
+        splitPane.setDividerPosition(1, 0.80);
+        splitPane.getItems().addAll(spLeft, spCenter, spRight);
+
+        root.setPrefSize(100, 100);
+        root.getChildren().add(splitPane);
+        show();
+
+        root.impl_reapplyCSS();
+        root.autosize();
+        root.layout();
+
+        double w = 98; // The width minus the insets.
+        double pos[] = splitPane.getDividerPositions();
+        double p0 = convertDividerPostionToAbsolutePostion(pos[0], w);
+        double p1 = convertDividerPostionToAbsolutePostion(pos[1], w);
+
+        assertEquals(28, p0, 1e-100);
+        assertEquals(63, p1, 1e-100);
+        assertEquals(28, spLeft.getLayoutBounds().getWidth(), 1e-100);
+        assertEquals(29, spCenter.getLayoutBounds().getWidth(), 1e-100);
+        assertEquals(29, spRight.getLayoutBounds().getWidth(), 1e-100);
+    }
+
+    @Test public void setDividerLessThanMin() {
+        StackPane spLeft = new StackPane();
+        StackPane spRight = new StackPane();
+
+        spLeft.setMinWidth(80);
+        splitPane.getItems().addAll(spLeft, spRight);
+        splitPane.setDividerPositions(0);
+        
+        root.setPrefSize(100, 100);
+        root.getChildren().add(splitPane);
+        show();
+
+        root.impl_reapplyCSS();
+        root.autosize();
+        root.layout();
+
+        double w = 98; // The width minus the insets.
+        double pos[] = splitPane.getDividerPositions();
+        double p0 = convertDividerPostionToAbsolutePostion(pos[0], w);
+
+        assertEquals(80, p0, 1e-100);
+        assertEquals(80, spLeft.getLayoutBounds().getWidth(), 1e-100);
+        assertEquals(12, spRight.getLayoutBounds().getWidth(), 1e-100);
+    }
+
+    @Test public void setDividerLessThanMax() {
+        StackPane spLeft = new StackPane();
+        StackPane spRight = new StackPane();
+
+        spLeft.setMaxWidth(80);
+        splitPane.getItems().addAll(spLeft, spRight);
+        splitPane.setDividerPositions(1);
+        
+        root.setPrefSize(100, 100);
+        root.getChildren().add(splitPane);
+        show();
+
+        root.impl_reapplyCSS();
+        root.autosize();
+        root.layout();
+
+        double w = 98; // The width minus the insets.
+        double pos[] = splitPane.getDividerPositions();
+        double p0 = convertDividerPostionToAbsolutePostion(pos[0], w);
+
+        assertEquals(80, p0, 1e-100);
+        assertEquals(80, spLeft.getLayoutBounds().getWidth(), 1e-100);
+        assertEquals(12, spRight.getLayoutBounds().getWidth(), 1e-100);
+    }
+
+    @Test public void checkDividerPositions_RT18805() {
+        Button l = new Button("Left Button");
+        Button c = new Button("Center Button");
+        Button r = new Button("Left Button");
 
         StackPane spLeft = new StackPane();
+        StackPane spCenter = new StackPane();
+        StackPane spRight = new StackPane();
+
         spLeft.getChildren().add(l);
+        spCenter.getChildren().add(c);
+        spRight.getChildren().add(r);
+
         spLeft.setMinWidth(100);
         spLeft.setMaxWidth(150);
-
-        StackPane spCenter = new StackPane();
-        spCenter.getChildren().add(c);
-
-        StackPane spRight = new StackPane();
-        spRight.getChildren().add(r);
-        spRight.setMinWidth(100);
+        spRight.setMaxWidth(100);
         spRight.setMaxWidth(150);
 
+        splitPane.getItems().addAll(spLeft, spCenter, spRight);
 
+        root.setPrefSize(600, 400);
+        root.getChildren().add(splitPane);
+        show();
+
+        root.impl_reapplyCSS();
+        root.autosize();
+        root.layout();
+
+        double w = 598; // The width minus the insets.
+        double pos[] = splitPane.getDividerPositions();
+        double p0 = convertDividerPostionToAbsolutePostion(pos[0], w);
+        double p1 = convertDividerPostionToAbsolutePostion(pos[1], w);
+
+        assertEquals(150, p0, 1e-100);
+        assertEquals(442, p1, 1e-100);
+        assertEquals(150, spLeft.getLayoutBounds().getWidth(), 1e-100);
+        assertEquals(286, spCenter.getLayoutBounds().getWidth(), 1e-100);
+        assertEquals(150, spRight.getLayoutBounds().getWidth(), 1e-100);
+    }
+
+    @Test public void growSplitPaneBy5px_RT18855() {
+        StackPane spLeft = new StackPane();
+        StackPane spCenter = new StackPane();
+        StackPane spRight = new StackPane();
+
+        spLeft.setMinWidth(77);
+        spRight.setMinWidth(77);
+
+        splitPane.setDividerPosition(0, 0.20);
+        splitPane.setDividerPosition(1, 0.80);
         splitPane.getItems().addAll(spLeft, spCenter, spRight);
-        StackPane sp = new StackPane();
-        sp.setPrefSize(600, 400);
-        sp.getChildren().add(splitPane);
 
-        sp.autosize();
-        sp.layout();
+        root.setPrefSize(400, 400);
+        root.getChildren().add(splitPane);
+        show();
+
+        root.impl_reapplyCSS();
+        root.autosize();
+        root.layout();
+
+        double w = 398; // The width minus the insets.
         double pos[] = splitPane.getDividerPositions();
-        assertEquals(pos[0], 0.25, 0.0);
-        assertEquals(pos[1], 0.75, 0.0);
+        double p0 = convertDividerPostionToAbsolutePostion(pos[0], w);
+        double p1 = convertDividerPostionToAbsolutePostion(pos[1], w);
+
+        assertEquals(77, p0, 1e-100);
+        assertEquals(315, p1, 1e-100);
+        assertEquals(77, spLeft.getLayoutBounds().getWidth(), 1e-100);
+        assertEquals(232, spCenter.getLayoutBounds().getWidth(), 1e-100);
+        assertEquals(77, spRight.getLayoutBounds().getWidth(), 1e-100);
+
+        root.impl_reapplyCSS();
+        root.resize(405, 400);
+        root.layout();
+
+        w = 403;
+        pos = splitPane.getDividerPositions();
+        p0 = convertDividerPostionToAbsolutePostion(pos[0], w);
+        p1 = convertDividerPostionToAbsolutePostion(pos[1], w);
+        
+        assertEquals(78, p0, 1e-100);
+        assertEquals(319, p1, 1e-100);
+        assertEquals(78, spLeft.getLayoutBounds().getWidth(), 1e-100);
+        assertEquals(235, spCenter.getLayoutBounds().getWidth(), 1e-100);
+        assertEquals(78, spRight.getLayoutBounds().getWidth(), 1e-100);
     }
-    
+
+    @Test public void growSplitPaneBy5pxWithFixedDividers_RT18806() {
+        StackPane spLeft = new StackPane();
+        StackPane spCenter = new StackPane();
+        StackPane spRight = new StackPane();
+
+        spLeft.setMinWidth(77);
+        spRight.setMinWidth(77);
+
+        splitPane.setDividerPosition(0, 0.20);
+        splitPane.setDividerPosition(1, 0.80);
+        splitPane.getItems().addAll(spLeft, spCenter, spRight);
+
+        SplitPane.setResizableWithParent(spLeft, false);
+        SplitPane.setResizableWithParent(spRight, false);
+
+        root.setPrefSize(400, 400);
+        root.getChildren().add(splitPane);
+        show();
+
+        root.impl_reapplyCSS();
+        root.autosize();
+        root.layout();
+
+        double w = 398; // The width minus the insets.
+        double pos[] = splitPane.getDividerPositions();
+        double p0 = convertDividerPostionToAbsolutePostion(pos[0], w);
+        double p1 = convertDividerPostionToAbsolutePostion(pos[1], w);
+
+        assertEquals(77, p0, 1e-100);
+        assertEquals(315, p1, 1e-100);
+        assertEquals(77, spLeft.getLayoutBounds().getWidth(), 1e-100);
+        assertEquals(232, spCenter.getLayoutBounds().getWidth(), 1e-100);
+        assertEquals(77, spRight.getLayoutBounds().getWidth(), 1e-100);
+
+        root.impl_reapplyCSS();
+        root.resize(405, 400);
+        root.layout();
+
+        w = 403;
+        pos = splitPane.getDividerPositions();
+        p0 = convertDividerPostionToAbsolutePostion(pos[0], w);
+        p1 = convertDividerPostionToAbsolutePostion(pos[1], w);
+
+        assertEquals(77, p0, 1e-100);
+        assertEquals(320, p1, 1e-100);
+        assertEquals(77, spLeft.getLayoutBounds().getWidth(), 1e-100);
+        assertEquals(237, spCenter.getLayoutBounds().getWidth(), 1e-100);
+        assertEquals(77, spRight.getLayoutBounds().getWidth(), 1e-100);
+    }
+
+    @Test public void resizeSplitPaneAllPanesAreSetToMax() {
+        StackPane spLeft = new StackPane();
+        StackPane spCenter = new StackPane();
+        StackPane spRight = new StackPane();
+
+        spLeft.setMaxWidth(28);
+        spCenter.setMaxWidth(29);
+        spRight.setMaxWidth(29);
+
+        splitPane.setDividerPosition(0, 0.20);
+        splitPane.setDividerPosition(1, 0.80);
+        splitPane.getItems().addAll(spLeft, spCenter, spRight);
+
+        root.setPrefSize(100, 100);
+        root.getChildren().add(splitPane);
+        show();
+
+        root.impl_reapplyCSS();
+        root.autosize();
+        root.layout();
+
+        double w = 98; // The width minus the insets.
+        double pos[] = splitPane.getDividerPositions();
+        double p0 = convertDividerPostionToAbsolutePostion(pos[0], w);
+        double p1 = convertDividerPostionToAbsolutePostion(pos[1], w);
+
+        assertEquals(28, p0, 1e-100);
+        assertEquals(63, p1, 1e-100);
+        assertEquals(28, spLeft.getLayoutBounds().getWidth(), 1e-100);
+        assertEquals(29, spCenter.getLayoutBounds().getWidth(), 1e-100);
+        assertEquals(29, spRight.getLayoutBounds().getWidth(), 1e-100);
+
+        root.impl_reapplyCSS();
+        root.resize(405, 400);
+        root.layout();
+
+        w = 403;
+        pos = splitPane.getDividerPositions();
+        p0 = convertDividerPostionToAbsolutePostion(pos[0], w);
+        p1 = convertDividerPostionToAbsolutePostion(pos[1], w);
+
+        assertEquals(28, p0, 1e-100);
+        assertEquals(63, p1, 1e-100);
+        assertEquals(28, spLeft.getLayoutBounds().getWidth(), 1e-100);
+        assertEquals(29, spCenter.getLayoutBounds().getWidth(), 1e-100);
+        assertEquals(29, spRight.getLayoutBounds().getWidth(), 1e-100);
+    }
+
+    /*
+     * Vertical SplitPane
+     */
+    @Test public void oneDividerPanelsAreEquallySized_VerticalSplitPane() {
+        StackPane spLeft = new StackPane();
+        StackPane spRight = new StackPane();
+
+        splitPane.setOrientation(Orientation.VERTICAL);
+        splitPane.getItems().addAll(spLeft, spRight);
+
+        root.setPrefSize(400, 400);
+        root.getChildren().add(splitPane);
+        show();
+
+        root.impl_reapplyCSS();
+        root.autosize();
+        root.layout();
+
+        double h = 398; // The width minus the insets.
+        double pos[] = splitPane.getDividerPositions();
+        double p0 = convertDividerPostionToAbsolutePostion(pos[0], h);
+
+        assertEquals(196, p0, 1e-100);
+        assertEquals(196, spLeft.getLayoutBounds().getHeight(), 1e-100);
+        assertEquals(196, spRight.getLayoutBounds().getHeight(), 1e-100);
+    }
+
+    @Test public void twoDividersHaveTheSamePosition_VerticalSplitPane() {
+        StackPane spLeft = new StackPane();
+        StackPane spCenter = new StackPane();
+        StackPane spRight = new StackPane();
+
+        splitPane.setOrientation(Orientation.VERTICAL);
+        splitPane.getItems().addAll(spLeft, spCenter, spRight);
+
+        root.setPrefSize(400, 400);
+        root.getChildren().add(splitPane);
+        show();
+
+        root.impl_reapplyCSS();
+        root.autosize();
+        root.layout();
+
+        double h = 398; // The width minus the insets.
+        double pos[] = splitPane.getDividerPositions();
+        double p0 = convertDividerPostionToAbsolutePostion(pos[0], h);
+        double p1 = convertDividerPostionToAbsolutePostion(pos[1], h);
+
+        assertEquals(196, p0, 1e-100);
+        assertEquals(202, p1, 1e-100);
+        assertEquals(196, spLeft.getLayoutBounds().getHeight(), 1e-100);
+        assertEquals(0, spCenter.getLayoutBounds().getHeight(), 1e-100);
+        assertEquals(190, spRight.getLayoutBounds().getHeight(), 1e-100);
+    }
+
+    @Test public void twoDividersHaveTheDifferentPositions_VerticalSplitPane() {
+        StackPane spLeft = new StackPane();
+        StackPane spCenter = new StackPane();
+        StackPane spRight = new StackPane();
+
+        splitPane.setOrientation(Orientation.VERTICAL);
+        splitPane.setDividerPosition(0, 0.20);
+        splitPane.setDividerPosition(1, 0.80);
+        splitPane.getItems().addAll(spLeft, spCenter, spRight);
+
+        root.setPrefSize(400, 400);
+        root.getChildren().add(splitPane);
+        show();
+
+        root.impl_reapplyCSS();
+        root.autosize();
+        root.layout();
+
+        double h = 398; // The width minus the insets.
+        double pos[] = splitPane.getDividerPositions();
+        double p0 = convertDividerPostionToAbsolutePostion(pos[0], h);
+        double p1 = convertDividerPostionToAbsolutePostion(pos[1], h);
+
+        assertEquals(77, p0, 1e-100);
+        assertEquals(315, p1, 1e-100);
+        assertEquals(77, spLeft.getLayoutBounds().getHeight(), 1e-100);
+        assertEquals(232, spCenter.getLayoutBounds().getHeight(), 1e-100);
+        assertEquals(77, spRight.getLayoutBounds().getHeight(), 1e-100);
+    }
+
+    @Test public void threePanelsAllAreSetToMin_VerticalSplitPane() {
+        StackPane spLeft = new StackPane();
+        StackPane spCenter = new StackPane();
+        StackPane spRight = new StackPane();
+
+        spLeft.setMinHeight(28);
+        spCenter.setMinHeight(29);
+        spRight.setMinHeight(29);
+
+        splitPane.setOrientation(Orientation.VERTICAL);
+        splitPane.setDividerPosition(0, 0.20);
+        splitPane.setDividerPosition(1, 0.80);
+        splitPane.getItems().addAll(spLeft, spCenter, spRight);
+
+        root.setPrefSize(100, 100);
+        root.getChildren().add(splitPane);
+        show();
+
+        root.impl_reapplyCSS();
+        root.autosize();
+        root.layout();
+
+        double h = 98; // The width minus the insets.
+        double pos[] = splitPane.getDividerPositions();
+        double p0 = convertDividerPostionToAbsolutePostion(pos[0], h);
+        double p1 = convertDividerPostionToAbsolutePostion(pos[1], h);
+
+        assertEquals(28, p0, 1e-100);
+        assertEquals(63, p1, 1e-100);
+        assertEquals(28, spLeft.getLayoutBounds().getHeight(), 1e-100);
+        assertEquals(29, spCenter.getLayoutBounds().getHeight(), 1e-100);
+        assertEquals(29, spRight.getLayoutBounds().getHeight(), 1e-100);
+    }
+
+    @Test public void threePanelsAllAreSetToMax_VerticalSplitPane() {
+        StackPane spLeft = new StackPane();
+        StackPane spCenter = new StackPane();
+        StackPane spRight = new StackPane();
+
+        spLeft.setMaxHeight(28);
+        spCenter.setMaxHeight(29);
+        spRight.setMaxHeight(29);
+
+        splitPane.setOrientation(Orientation.VERTICAL);
+        splitPane.setDividerPosition(0, 0.20);
+        splitPane.setDividerPosition(1, 0.80);
+        splitPane.getItems().addAll(spLeft, spCenter, spRight);
+
+        root.setPrefSize(100, 100);
+        root.getChildren().add(splitPane);
+        show();
+
+        root.impl_reapplyCSS();
+        root.autosize();
+        root.layout();
+
+        double h = 98; // The width minus the insets.
+        double pos[] = splitPane.getDividerPositions();
+        double p0 = convertDividerPostionToAbsolutePostion(pos[0], h);
+        double p1 = convertDividerPostionToAbsolutePostion(pos[1], h);
+
+        assertEquals(28, p0, 1e-100);
+        assertEquals(63, p1, 1e-100);
+        assertEquals(28, spLeft.getLayoutBounds().getHeight(), 1e-100);
+        assertEquals(29, spCenter.getLayoutBounds().getHeight(), 1e-100);
+        assertEquals(29, spRight.getLayoutBounds().getHeight(), 1e-100);
+    }
+
+    @Test public void threePanelsSetToMinMaxMin_VerticalSplitPane() {
+        StackPane spLeft = new StackPane();
+        StackPane spCenter = new StackPane();
+        StackPane spRight = new StackPane();
+
+        spLeft.setMinHeight(28);
+        spCenter.setMaxHeight(29);
+        spRight.setMinHeight(29);
+
+        splitPane.setOrientation(Orientation.VERTICAL);
+        splitPane.setDividerPosition(0, 0.20);
+        splitPane.setDividerPosition(1, 0.80);
+        splitPane.getItems().addAll(spLeft, spCenter, spRight);
+
+        root.setPrefSize(100, 100);
+        root.getChildren().add(splitPane);
+        show();
+
+        root.impl_reapplyCSS();
+        root.autosize();
+        root.layout();
+
+        double h = 98; // The width minus the insets.
+        double pos[] = splitPane.getDividerPositions();
+        double p0 = convertDividerPostionToAbsolutePostion(pos[0], h);
+        double p1 = convertDividerPostionToAbsolutePostion(pos[1], h);
+
+        assertEquals(28, p0, 1e-100);
+        assertEquals(63, p1, 1e-100);
+        assertEquals(28, spLeft.getLayoutBounds().getHeight(), 1e-100);
+        assertEquals(29, spCenter.getLayoutBounds().getHeight(), 1e-100);
+        assertEquals(29, spRight.getLayoutBounds().getHeight(), 1e-100);
+    }
+
+    @Test public void setDividerLessThanMin_VerticalSplitPane() {
+        StackPane spLeft = new StackPane();
+        StackPane spRight = new StackPane();
+
+        spLeft.setMinHeight(80);
+
+        splitPane.setOrientation(Orientation.VERTICAL);
+        splitPane.getItems().addAll(spLeft, spRight);
+        splitPane.setDividerPositions(0);
+
+        root.setPrefSize(100, 100);
+        root.getChildren().add(splitPane);
+        show();
+
+        root.impl_reapplyCSS();
+        root.autosize();
+        root.layout();
+
+        double h = 98; // The width minus the insets.
+        double pos[] = splitPane.getDividerPositions();
+        double p0 = convertDividerPostionToAbsolutePostion(pos[0], h);
+
+        assertEquals(80, p0, 1e-100);
+        assertEquals(80, spLeft.getLayoutBounds().getHeight(), 1e-100);
+        assertEquals(12, spRight.getLayoutBounds().getHeight(), 1e-100);
+    }
+
+    @Test public void setDividerLessThanMax_VerticalSplitPane() {
+        StackPane spLeft = new StackPane();
+        StackPane spRight = new StackPane();
+
+        spLeft.setMaxHeight(80);
+
+        splitPane.setOrientation(Orientation.VERTICAL);
+        splitPane.getItems().addAll(spLeft, spRight);
+        splitPane.setDividerPositions(1);
+
+        root.setPrefSize(100, 100);
+        root.getChildren().add(splitPane);
+        show();
+
+        root.impl_reapplyCSS();
+        root.autosize();
+        root.layout();
+
+        double h = 98; // The width minus the insets.
+        double pos[] = splitPane.getDividerPositions();
+        double p0 = convertDividerPostionToAbsolutePostion(pos[0], h);
+
+        assertEquals(80, p0, 1e-100);
+        assertEquals(80, spLeft.getLayoutBounds().getHeight(), 1e-100);
+        assertEquals(12, spRight.getLayoutBounds().getHeight(), 1e-100);
+    }
+
+    @Test public void checkDividerPositions_RT18805_VerticalSplitPane() {
+        Button l = new Button("Left Button");
+        Button c = new Button("Center Button");
+        Button r = new Button("Left Button");
+
+        StackPane spLeft = new StackPane();
+        StackPane spCenter = new StackPane();
+        StackPane spRight = new StackPane();
+
+        spLeft.getChildren().add(l);
+        spCenter.getChildren().add(c);
+        spRight.getChildren().add(r);
+
+        spLeft.setMinHeight(100);
+        spLeft.setMaxHeight(150);
+        spRight.setMaxHeight(100);
+        spRight.setMaxHeight(150);
+
+        splitPane.setOrientation(Orientation.VERTICAL);
+        splitPane.getItems().addAll(spLeft, spCenter, spRight);
+
+        root.setPrefSize(400, 600);
+        root.getChildren().add(splitPane);
+        show();
+
+        root.impl_reapplyCSS();
+        root.autosize();
+        root.layout();
+
+        double h = 598; // The width minus the insets.
+        double pos[] = splitPane.getDividerPositions();
+        double p0 = convertDividerPostionToAbsolutePostion(pos[0], h);
+        double p1 = convertDividerPostionToAbsolutePostion(pos[1], h);
+
+        assertEquals(150, p0, 1e-100);
+        assertEquals(442, p1, 1e-100);
+        assertEquals(150, spLeft.getLayoutBounds().getHeight(), 1e-100);
+        assertEquals(286, spCenter.getLayoutBounds().getHeight(), 1e-100);
+        assertEquals(150, spRight.getLayoutBounds().getHeight(), 1e-100);
+    }
+
+    @Test public void growSplitPaneBy5px_RT18855_VerticalSplitPane() {
+        StackPane spLeft = new StackPane();
+        StackPane spCenter = new StackPane();
+        StackPane spRight = new StackPane();
+
+        spLeft.setMinHeight(77);
+        spRight.setMinHeight(77);
+
+        splitPane.setOrientation(Orientation.VERTICAL);
+        splitPane.setDividerPosition(0, 0.20);
+        splitPane.setDividerPosition(1, 0.80);
+        splitPane.getItems().addAll(spLeft, spCenter, spRight);
+
+        root.setPrefSize(400, 400);
+        root.getChildren().add(splitPane);
+        show();
+
+        root.impl_reapplyCSS();
+        root.autosize();
+        root.layout();
+
+        double h = 398; // The height minus the insets.
+        double pos[] = splitPane.getDividerPositions();
+        double p0 = convertDividerPostionToAbsolutePostion(pos[0], h);
+        double p1 = convertDividerPostionToAbsolutePostion(pos[1], h);
+
+        assertEquals(77, p0, 1e-100);
+        assertEquals(315, p1, 1e-100);
+        assertEquals(77, spLeft.getLayoutBounds().getHeight(), 1e-100);
+        assertEquals(232, spCenter.getLayoutBounds().getHeight(), 1e-100);
+        assertEquals(77, spRight.getLayoutBounds().getHeight(), 1e-100);
+
+        root.impl_reapplyCSS();
+        root.resize(400, 405);
+        root.layout();
+
+        h = 403;
+        pos = splitPane.getDividerPositions();
+        p0 = convertDividerPostionToAbsolutePostion(pos[0], h);
+        p1 = convertDividerPostionToAbsolutePostion(pos[1], h);
+
+        assertEquals(78, p0, 1e-100);
+        assertEquals(319, p1, 1e-100);
+        assertEquals(78, spLeft.getLayoutBounds().getHeight(), 1e-100);
+        assertEquals(235, spCenter.getLayoutBounds().getHeight(), 1e-100);
+        assertEquals(78, spRight.getLayoutBounds().getHeight(), 1e-100);
+    }
+
+    @Test public void growSplitPaneBy5pxWithFixedDividers_RT18806_VerticalSplitPane() {
+        StackPane spLeft = new StackPane();
+        StackPane spCenter = new StackPane();
+        StackPane spRight = new StackPane();
+
+        spLeft.setMinHeight(77);
+        spRight.setMinHeight(77);
+
+        splitPane.setOrientation(Orientation.VERTICAL);
+        splitPane.setDividerPosition(0, 0.20);
+        splitPane.setDividerPosition(1, 0.80);
+        splitPane.getItems().addAll(spLeft, spCenter, spRight);
+
+        SplitPane.setResizableWithParent(spLeft, false);
+        SplitPane.setResizableWithParent(spRight, false);
+
+        root.setPrefSize(400, 400);
+        root.getChildren().add(splitPane);
+        show();
+
+        root.impl_reapplyCSS();
+        root.autosize();
+        root.layout();
+
+        double h = 398; // The height minus the insets.
+        double pos[] = splitPane.getDividerPositions();
+        double p0 = convertDividerPostionToAbsolutePostion(pos[0], h);
+        double p1 = convertDividerPostionToAbsolutePostion(pos[1], h);
+
+        assertEquals(77, p0, 1e-100);
+        assertEquals(315, p1, 1e-100);
+        assertEquals(77, spLeft.getLayoutBounds().getHeight(), 1e-100);
+        assertEquals(232, spCenter.getLayoutBounds().getHeight(), 1e-100);
+        assertEquals(77, spRight.getLayoutBounds().getHeight(), 1e-100);
+
+        root.impl_reapplyCSS();
+        root.resize(400, 405);
+        root.layout();
+
+        h = 403;
+        pos = splitPane.getDividerPositions();
+        p0 = convertDividerPostionToAbsolutePostion(pos[0], h);
+        p1 = convertDividerPostionToAbsolutePostion(pos[1], h);
+
+        assertEquals(77, p0, 1e-100);
+        assertEquals(320, p1, 1e-100);
+        assertEquals(77, spLeft.getLayoutBounds().getHeight(), 1e-100);
+        assertEquals(237, spCenter.getLayoutBounds().getHeight(), 1e-100);
+        assertEquals(77, spRight.getLayoutBounds().getHeight(), 1e-100);
+    }
+
+    @Test public void resizeSplitPaneAllPanesAreSetToMax_VerticalSplitPane() {
+        StackPane spLeft = new StackPane();
+        StackPane spCenter = new StackPane();
+        StackPane spRight = new StackPane();
+
+        spLeft.setMaxHeight(28);
+        spCenter.setMaxHeight(29);
+        spRight.setMaxHeight(29);
+
+        splitPane.setOrientation(Orientation.VERTICAL);
+        splitPane.setDividerPosition(0, 0.20);
+        splitPane.setDividerPosition(1, 0.80);
+        splitPane.getItems().addAll(spLeft, spCenter, spRight);
+
+        root.setPrefSize(100, 100);
+        root.getChildren().add(splitPane);
+        show();
+
+        root.impl_reapplyCSS();
+        root.autosize();
+        root.layout();
+
+        double h = 98; // The height minus the insets.
+        double pos[] = splitPane.getDividerPositions();
+        double p0 = convertDividerPostionToAbsolutePostion(pos[0], h);
+        double p1 = convertDividerPostionToAbsolutePostion(pos[1], h);
+
+        assertEquals(28, p0, 1e-100);
+        assertEquals(63, p1, 1e-100);
+        assertEquals(28, spLeft.getLayoutBounds().getHeight(), 1e-100);
+        assertEquals(29, spCenter.getLayoutBounds().getHeight(), 1e-100);
+        assertEquals(29, spRight.getLayoutBounds().getHeight(), 1e-100);
+
+        root.impl_reapplyCSS();
+        root.resize(400, 405);
+        root.layout();
+
+        h = 403;
+        pos = splitPane.getDividerPositions();
+        p0 = convertDividerPostionToAbsolutePostion(pos[0], h);
+        p1 = convertDividerPostionToAbsolutePostion(pos[1], h);
+
+        assertEquals(28, p0, 1e-100);
+        assertEquals(63, p1, 1e-100);
+        assertEquals(28, spLeft.getLayoutBounds().getHeight(), 1e-100);
+        assertEquals(29, spCenter.getLayoutBounds().getHeight(), 1e-100);
+        assertEquals(29, spRight.getLayoutBounds().getHeight(), 1e-100);
+    }    
 }
--- a/javafx-ui-controls/test/javafx/scene/control/TableViewKeyInputTest.java	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-ui-controls/test/javafx/scene/control/TableViewKeyInputTest.java	Tue Jan 24 10:46:20 2012 -0500
@@ -19,6 +19,7 @@
 import org.junit.Ignore;
 import org.junit.Test;
 
+@Ignore("Disabling tests as they fail with OOM in continuous builds")
 public class TableViewKeyInputTest {
     private TableView<String> tableView;
     private TableView.TableViewSelectionModel<String> sm;
--- a/javafx-ui-controls/test/javafx/scene/control/TableViewTest.java	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-ui-controls/test/javafx/scene/control/TableViewTest.java	Tue Jan 24 10:46:20 2012 -0500
@@ -11,6 +11,8 @@
 
 import javafx.beans.property.ObjectProperty;
 import javafx.beans.property.SimpleObjectProperty;
+import javafx.beans.value.ChangeListener;
+import javafx.beans.value.ObservableValue;
 import javafx.collections.FXCollections;
 import javafx.collections.ObservableList;
 import javafx.scene.control.cell.PropertyValueFactory;
@@ -21,9 +23,11 @@
 
 public class TableViewTest {
     private TableView<String> table;
+    private TableView.TableViewSelectionModel sm;
 
     @Before public void setup() {
         table = new TableView<String>();
+        sm = table.getSelectionModel();
     }
 
     /*********************************************************************
@@ -35,7 +39,7 @@
     }
 
     @Test public void noArgConstructorSetsNonNullSelectionModel() {
-        assertNotNull(table.getSelectionModel());
+        assertNotNull(sm);
     }
 
     @Test public void noArgConstructorSetsNonNullItems() {
@@ -43,11 +47,11 @@
     }
 
     @Test public void noArgConstructor_selectedItemIsNull() {
-        assertNull(table.getSelectionModel().getSelectedItem());
+        assertNull(sm.getSelectedItem());
     }
 
     @Test public void noArgConstructor_selectedIndexIsNegativeOne() {
-        assertEquals(-1, table.getSelectionModel().getSelectedIndex());
+        assertEquals(-1, sm.getSelectedIndex());
     }
 
     @Test public void singleArgConstructorSetsTheStyleClass() {
@@ -94,126 +98,126 @@
         TableView.TableViewSelectionModel<String> sm = new TableView.TableViewArrayListSelectionModel<String>(table);
         ObjectProperty<TableView.TableViewSelectionModel<String>> other = new SimpleObjectProperty<TableView.TableViewSelectionModel<String>>(sm);
         table.selectionModelProperty().bind(other);
-        assertSame(sm, table.getSelectionModel());
+        assertSame(sm, sm);
     }
 
     @Test public void selectionModelCanBeChanged() {
         TableView.TableViewSelectionModel<String> sm = new TableView.TableViewArrayListSelectionModel<String>(table);
         table.setSelectionModel(sm);
-        assertSame(sm, table.getSelectionModel());
+        assertSame(sm, sm);
     }
 
     @Test public void canSetSelectedItemToAnItemEvenWhenThereAreNoItems() {
         final String randomString = new String("I AM A CRAZY RANDOM STRING");
-        table.getSelectionModel().select(randomString);
-        assertEquals(-1, table.getSelectionModel().getSelectedIndex());
-        assertSame(randomString, table.getSelectionModel().getSelectedItem());
+        sm.select(randomString);
+        assertEquals(-1, sm.getSelectedIndex());
+        assertSame(randomString, sm.getSelectedItem());
     }
 
     @Test public void canSetSelectedItemToAnItemNotInTheDataModel() {
         table.getItems().addAll("Apple", "Orange", "Banana");
         final String randomString = new String("I AM A CRAZY RANDOM STRING");
-        table.getSelectionModel().select(randomString);
-        assertEquals(-1, table.getSelectionModel().getSelectedIndex());
-        assertSame(randomString, table.getSelectionModel().getSelectedItem());
+        sm.select(randomString);
+        assertEquals(-1, sm.getSelectedIndex());
+        assertSame(randomString, sm.getSelectedItem());
     }
 
     @Test public void settingTheSelectedItemToAnItemInItemsResultsInTheCorrectSelectedIndex() {
         table.getItems().addAll("Apple", "Orange", "Banana");
-        table.getSelectionModel().select("Orange");
-        assertEquals(1, table.getSelectionModel().getSelectedIndex());
-        assertSame("Orange", table.getSelectionModel().getSelectedItem());
+        sm.select("Orange");
+        assertEquals(1, sm.getSelectedIndex());
+        assertSame("Orange", sm.getSelectedItem());
     }
 
     @Test public void settingTheSelectedItemToANonexistantItemAndThenSettingItemsWhichContainsItResultsInCorrectSelectedIndex() {
-        table.getSelectionModel().select("Orange");
+        sm.select("Orange");
         table.getItems().addAll("Apple", "Orange", "Banana");
-        assertEquals(1, table.getSelectionModel().getSelectedIndex());
-        assertSame("Orange", table.getSelectionModel().getSelectedItem());
+        assertEquals(1, sm.getSelectedIndex());
+        assertSame("Orange", sm.getSelectedItem());
     }
     
     @Test public void ensureSelectionClearsWhenAllItemsAreRemoved_selectIndex0() {
         table.getItems().addAll("Apple", "Orange", "Banana");
-        table.getSelectionModel().select(0);
+        sm.select(0);
         table.getItems().clear();
-        assertEquals(-1, table.getSelectionModel().getSelectedIndex());
+        assertEquals(-1, sm.getSelectedIndex());
     }
     
     @Test public void ensureSelectionClearsWhenAllItemsAreRemoved_selectIndex2() {
         table.getItems().addAll("Apple", "Orange", "Banana");
-        table.getSelectionModel().select(2);
+        sm.select(2);
         table.getItems().clear();
-        assertEquals(-1, table.getSelectionModel().getSelectedIndex());
+        assertEquals(-1, sm.getSelectedIndex());
     }
     
     @Test public void ensureSelectedItemRemainsAccurateWhenItemsAreCleared() {
         table.getItems().addAll("Apple", "Orange", "Banana");
-        table.getSelectionModel().select(2);
+        sm.select(2);
         table.getItems().clear();
-        assertNull("Selected Item: " + table.getSelectionModel().getSelectedItem(), table.getSelectionModel().getSelectedItem());
-        assertEquals(-1, table.getSelectionModel().getSelectedIndex());
+        assertNull("Selected Item: " + sm.getSelectedItem(), sm.getSelectedItem());
+        assertEquals(-1, sm.getSelectedIndex());
         
         table.getItems().addAll("Kiwifruit", "Mandarin", "Pineapple");
-        table.getSelectionModel().select(2);
-        assertEquals("Pineapple", table.getSelectionModel().getSelectedItem());
+        sm.select(2);
+        assertEquals("Pineapple", sm.getSelectedItem());
     }
     
     @Ignore("Not fixed yet")
     @Test public void ensureSelectionShiftsDownWhenOneNewItemIsAdded() {
         table.getItems().addAll("Apple", "Orange", "Banana");
-        table.getSelectionModel().select(1);
-        assertEquals(1, table.getSelectionModel().getSelectedIndex());
-        assertEquals("Orange", table.getSelectionModel().getSelectedItem());
+        sm.select(1);
+        assertEquals(1, sm.getSelectedIndex());
+        assertEquals("Orange", sm.getSelectedItem());
         
         table.getItems().add(0, "Kiwifruit");
-        assertEquals(2, table.getSelectionModel().getSelectedIndex());
-        assertEquals("Orange", table.getSelectionModel().getSelectedItem());
+        assertEquals(2, sm.getSelectedIndex());
+        assertEquals("Orange", sm.getSelectedItem());
     }
     
     @Ignore("Not fixed yet")
     @Test public void ensureSelectionShiftsDownWhenMultipleNewItemAreAdded() {
         table.getItems().addAll("Apple", "Orange", "Banana");
-        table.getSelectionModel().select(1);
-        assertEquals(1, table.getSelectionModel().getSelectedIndex());
-        assertEquals("Orange", table.getSelectionModel().getSelectedItem());
+        sm.select(1);
+        assertEquals(1, sm.getSelectedIndex());
+        assertEquals("Orange", sm.getSelectedItem());
         
         table.getItems().addAll(0, Arrays.asList("Kiwifruit", "Pineapple", "Mandarin"));
-        assertEquals("Orange", table.getSelectionModel().getSelectedItem());
-        assertEquals(4, table.getSelectionModel().getSelectedIndex());
+        assertEquals("Orange", sm.getSelectedItem());
+        assertEquals(4, sm.getSelectedIndex());
     }
     
     @Ignore("Not fixed yet")
     @Test public void ensureSelectionShiftsDownWhenOneItemIsRemoved() {
         table.getItems().addAll("Apple", "Orange", "Banana");
-        table.getSelectionModel().select(1);
-        assertEquals(1, table.getSelectionModel().getSelectedIndex());
-        assertEquals("Orange", table.getSelectionModel().getSelectedItem());
+        sm.select(1);
+        assertEquals(1, sm.getSelectedIndex());
+        assertEquals("Orange", sm.getSelectedItem());
         
         table.getItems().remove("Apple");
-        assertEquals(0, table.getSelectionModel().getSelectedIndex());
-        assertEquals("Orange", table.getSelectionModel().getSelectedItem());
+        assertEquals(0, sm.getSelectedIndex());
+        assertEquals("Orange", sm.getSelectedItem());
     }
     
     @Ignore("Not fixed yet")
     @Test public void ensureSelectionShiftsDownWheMultipleItemsAreRemoved() {
         table.getItems().addAll("Apple", "Orange", "Banana");
-        table.getSelectionModel().select(2);
-        assertEquals(2, table.getSelectionModel().getSelectedIndex());
-        assertEquals("Banana", table.getSelectionModel().getSelectedItem());
+        sm.select(2);
+        assertEquals(2, sm.getSelectedIndex());
+        assertEquals("Banana", sm.getSelectedItem());
         
         table.getItems().removeAll(Arrays.asList("Apple", "Orange"));
-        assertEquals(0, table.getSelectionModel().getSelectedIndex());
-        assertEquals("Banana", table.getSelectionModel().getSelectedItem());
+        assertEquals(0, sm.getSelectedIndex());
+        assertEquals("Banana", sm.getSelectedItem());
     }
     
     @Test public void ensureSelectionIsCorrectWhenItemsChange() {
         table.setItems(FXCollections.observableArrayList("Item 1"));
-        table.getSelectionModel().select(0);
-        assertEquals("Item 1", table.getSelectionModel().getSelectedItem());
+        sm.select(0);
+        assertEquals("Item 1", sm.getSelectedItem());
         
         table.setItems(FXCollections.observableArrayList("Item 2"));
-        assertEquals(-1, table.getSelectionModel().getSelectedIndex());
-        assertEquals(null, table.getSelectionModel().getSelectedItem());
+        assertEquals(-1, sm.getSelectedIndex());
+        assertEquals(null, sm.getSelectedItem());
     }
 
     /*********************************************************************
@@ -363,11 +367,11 @@
     
     @Test public void test_rt18385() {
         table.getItems().addAll("row1", "row2", "row3");
-        table.getSelectionModel().select(1);
+        sm.select(1);
         table.getItems().add("Another Row");
-        assertEquals(1, table.getSelectionModel().getSelectedIndices().size());
-        assertEquals(1, table.getSelectionModel().getSelectedItems().size());
-        assertEquals(1, table.getSelectionModel().getSelectedCells().size());
+        assertEquals(1, sm.getSelectedIndices().size());
+        assertEquals(1, sm.getSelectedItems().size());
+        assertEquals(1, sm.getSelectedCells().size());
     }
     
     @Test public void test_rt18339_onlyEditWhenTableViewIsEditable_tableEditableIsFalse_columnEditableIsFalse() {
@@ -408,8 +412,8 @@
     
     @Test public void test_rt14451() {
         table.getItems().addAll("Apple", "Orange", "Banana");
-        table.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
-        table.getSelectionModel().selectRange(0, 2); // select from 0 (inclusive) to 2 (exclusive)
-        assertEquals(2, table.getSelectionModel().getSelectedIndices().size());
+        sm.setSelectionMode(SelectionMode.MULTIPLE);
+        sm.selectRange(0, 2); // select from 0 (inclusive) to 2 (exclusive)
+        assertEquals(2, sm.getSelectedIndices().size());
     }
 }
--- a/javafx-ui-controls/test/javafx/scene/control/TreeViewKeyInputTest.java	Wed Jan 18 10:46:19 2012 -0800
+++ b/javafx-ui-controls/test/javafx/scene/control/TreeViewKeyInputTest.java	Tue Jan 24 10:46:20 2012 -0500
@@ -18,6 +18,7 @@
 import org.junit.Ignore;
 import org.junit.Test;
 
+@Ignore("Disabling tests as they fail with OOM in continuous builds")
 public class TreeViewKeyInputTest {
     private TreeView<String> treeView;
     private MultipleSelectionModel<TreeItem<String>> sm;
@@ -147,7 +148,7 @@
      * General tests
      **************************************************************************/    
     
-    @Ignore @Test public void testInitialState() {
+    @Test public void testInitialState() {
         assertTrue(sm.isSelected(0));
         assertEquals(1, sm.getSelectedIndices().size());
         assertEquals(1, sm.getSelectedItems().size());
@@ -157,14 +158,14 @@
      * Tests for row-based single selection
      **************************************************************************/
     
-    @Ignore @Test public void testDownArrowChangesSelection() {
+    @Test public void testDownArrowChangesSelection() {
         sm.clearAndSelect(0);
         keyboard.doDownArrowPress();
         assertFalse(sm.isSelected(0));
         assertTrue(sm.isSelected(1));
     }
     
-    @Ignore @Test public void testDownArrowDoesNotChangeSelectionWhenAtLastIndex() {
+    @Test public void testDownArrowDoesNotChangeSelectionWhenAtLastIndex() {
         int endIndex = getItemCount();
         sm.clearAndSelect(endIndex);
         assertTrue(debug(), sm.isSelected(endIndex));
@@ -172,26 +173,26 @@
         assertTrue(sm.isSelected(endIndex));
     }
     
-    @Ignore @Test public void testUpArrowDoesNotChangeSelectionWhenAt0Index() {
+    @Test public void testUpArrowDoesNotChangeSelectionWhenAt0Index() {
         sm.clearAndSelect(0);
         keyboard.doUpArrowPress();
         testInitialState();
     }
     
-    @Ignore @Test public void testUpArrowChangesSelection() {
+    @Test public void testUpArrowChangesSelection() {
         sm.clearAndSelect(1);
         keyboard.doUpArrowPress();
         assertFalse(sm.isSelected(1));
         assertTrue(sm.isSelected(0));
     }
     
-    @Ignore @Test public void testLeftArrowDoesNotChangeState() {
+    @Test public void testLeftArrowDoesNotChangeState() {
         keyboard.doLeftArrowPress();
         testInitialState();
     }
     
     // test 19
-    @Ignore @Test public void testCtrlDownMovesFocusButLeavesSelectionAlone() {
+    @Test public void testCtrlDownMovesFocusButLeavesSelectionAlone() {
         assertTrue(fm.isFocused(0));
         keyboard.doDownArrowPress(KeyModifier.getShortcutKey());
         assertTrue(fm.isFocused(1));
@@ -200,7 +201,7 @@
     }
     
     // test 20
-    @Ignore @Test public void testCtrlUpDoesNotMoveFocus() {
+    @Test public void testCtrlUpDoesNotMoveFocus() {
         assertTrue(fm.isFocused(0));
         keyboard.doUpArrowPress(KeyModifier.getShortcutKey());
         assertTrue(fm.isFocused(0));
@@ -208,7 +209,7 @@
     }
     
     // test 21
-    @Ignore @Test public void testCtrlLeftDoesNotMoveFocus() {
+    @Test public void testCtrlLeftDoesNotMoveFocus() {
         assertTrue(fm.isFocused(0));
         keyboard.doLeftArrowPress(KeyModifier.getShortcutKey());
         assertTrue(fm.isFocused(0));
@@ -216,7 +217,7 @@
     }
     
     // test 22
-    @Ignore @Test public void testCtrlRightDoesNotMoveFocus() {
+    @Test public void testCtrlRightDoesNotMoveFocus() {
         assertTrue(fm.isFocused(0));
         keyboard.doRightArrowPress(KeyModifier.getShortcutKey());
         assertTrue(fm.isFocused(0));
@@ -224,7 +225,7 @@
     }
     
     // test 23
-    @Ignore @Test public void testCtrlUpMovesFocus() {
+    @Test public void testCtrlUpMovesFocus() {
         sm.clearAndSelect(1);
         assertTrue(fm.isFocused(1));
         assertTrue(sm.isSelected(1));
@@ -234,7 +235,7 @@
     }
     
     // test 24
-    @Ignore @Test public void testCtrlDownDoesNotMoveFocusWhenAtLastIndex() {
+    @Test public void testCtrlDownDoesNotMoveFocusWhenAtLastIndex() {
         int endIndex = getItemCount();
         sm.clearAndSelect(endIndex);
         assertTrue(fm.isFocused(endIndex));
@@ -245,7 +246,7 @@
     }
     
     // test 25
-    @Ignore @Test public void testCtrlDownArrowWithSpaceChangesAnchor() {
+    @Test public void testCtrlDownArrowWithSpaceChangesAnchor() {
         sm.clearAndSelect(0);
         keyboard.doDownArrowPress(KeyModifier.getShortcutKey());    // move focus to 1
         keyboard.doDownArrowPress(KeyModifier.getShortcutKey());    // move focus to 2
@@ -256,7 +257,7 @@
     }
     
     // test 26
-    @Ignore @Test public void testCtrlUpArrowWithSpaceChangesAnchor() {
+    @Test public void testCtrlUpArrowWithSpaceChangesAnchor() {
         sm.clearAndSelect(2);
         keyboard.doUpArrowPress(KeyModifier.getShortcutKey());    // move focus to 1
         keyboard.doUpArrowPress(KeyModifier.getShortcutKey());    // move focus to 0
@@ -267,7 +268,7 @@
     }
     
     // test 44
-    @Ignore @Test public void testHomeKey() {
+    @Test public void testHomeKey() {
         sm.clearAndSelect(3);
         keyboard.doKeyPress(KeyCode.HOME);
         assertTrue(isSelected(0));
@@ -275,7 +276,7 @@
     }
     
     // test 45
-    @Ignore @Test public void testEndKey() {
+    @Test public void testEndKey() {
         sm.clearAndSelect(3); 
         keyboard.doKeyPress(KeyCode.END);
         assertTrue(debug(), isSelected(getItemCount()));
@@ -283,7 +284,7 @@
     }
     
     // test 53
-    @Ignore @Test public void testCtrlHome() {
+    @Test public void testCtrlHome() {
         sm.clearAndSelect(5);
         keyboard.doKeyPress(KeyCode.HOME, KeyModifier.getShortcutKey());
         assertTrue(isSelected(5));
@@ -291,7 +292,7 @@
     }
     
     // test 54
-    @Ignore @Test public void testCtrlEnd() {
+    @Test public void testCtrlEnd() {
         sm.clearAndSelect(5);
         keyboard.doKeyPress(KeyCode.END, KeyModifier.getShortcutKey());
         assertTrue(isSelected(5));
@@ -299,7 +300,7 @@
     }
     
     // test 68
-    @Ignore @Test public void testCtrlSpaceToClearSelection() {
+    @Test public void testCtrlSpaceToClearSelection() {
         sm.clearAndSelect(5);
         assertTrue(isSelected(5));
         assertTrue(fm.isFocused(5));
@@ -315,14 +316,14 @@
      * Tests for row-based multiple selection
      **************************************************************************/
     
-    @Ignore @Test public void testShiftDownArrowIncreasesSelection() {
+    @Test public void testShiftDownArrowIncreasesSelection() {
         sm.clearAndSelect(0);
         keyboard.doDownArrowPress(KeyModifier.SHIFT);
         assertTrue(sm.isSelected(0));
         assertTrue(sm.isSelected(1));
     }
     
-    @Ignore @Test public void testShiftDownArrowDoesNotChangeSelectionWhenAtLastIndex() {
+    @Test public void testShiftDownArrowDoesNotChangeSelectionWhenAtLastIndex() {
         int endIndex = getItemCount() - 1;
         sm.clearAndSelect(endIndex);
         assertTrue(sm.isSelected(endIndex));
@@ -330,34 +331,34 @@
         assertTrue(sm.isSelected(endIndex));
     }
     
-    @Ignore @Test public void testShiftUpArrowIncreasesSelection() {
+    @Test public void testShiftUpArrowIncreasesSelection() {
         sm.clearAndSelect(1);
         keyboard.doUpArrowPress(KeyModifier.SHIFT);
         assertTrue(sm.isSelected(0));
         assertTrue(sm.isSelected(1));
     }
     
-    @Ignore @Test public void testShiftUpArrowWhenAt0Index() {
+    @Test public void testShiftUpArrowWhenAt0Index() {
         sm.clearAndSelect(0);
         keyboard.doUpArrowPress(KeyModifier.SHIFT);
         assertTrue(sm.isSelected(0));
     }
     
-    @Ignore @Test public void testShiftLeftArrowWhenAt0Index() {
+    @Test public void testShiftLeftArrowWhenAt0Index() {
         sm.clearAndSelect(0);
         keyboard.doLeftArrowPress(KeyModifier.SHIFT);
         assertTrue(sm.isSelected(0));
         assertFalse(sm.isSelected(1));
     }
     
-    @Ignore @Test public void testShiftRightArrowWhenAt0Index() {
+    @Test public void testShiftRightArrowWhenAt0Index() {
         sm.clearAndSelect(0);
         keyboard.doRightArrowPress(KeyModifier.SHIFT);
         assertTrue(sm.isSelected(0));
         assertFalse(sm.isSelected(1));
     }
     
-    @Ignore @Test public void testShiftDownTwiceThenShiftUp() {
+    @Test public void testShiftDownTwiceThenShiftUp() {
         sm.clearAndSelect(0);
         keyboard.doDownArrowPress(KeyModifier.SHIFT);
         keyboard.doDownArrowPress(KeyModifier.SHIFT);
@@ -367,7 +368,7 @@
         assertFalse(sm.isSelected(2));
     }
     
-    @Ignore @Test public void testShiftUpTwiceThenShiftDownFrom0Index() {
+    @Test public void testShiftUpTwiceThenShiftDownFrom0Index() {
         sm.clearAndSelect(0);
         keyboard.doUpArrowPress(KeyModifier.SHIFT);
         keyboard.doUpArrowPress(KeyModifier.SHIFT);
@@ -377,7 +378,7 @@
         assertFalse(sm.isSelected(2));
     }
     
-    @Ignore @Test public void testShiftLeftTwiceThenShiftRight() {
+    @Test public void testShiftLeftTwiceThenShiftRight() {
         sm.clearAndSelect(0);
         keyboard.doLeftArrowPress(KeyModifier.SHIFT);
         keyboard.doLeftArrowPress(KeyModifier.SHIFT);
@@ -387,7 +388,7 @@
         assertFalse(sm.isSelected(2));
     }
     
-    @Ignore @Test public void testShiftRightTwiceThenShiftLeft() {
+    @Test public void testShiftRightTwiceThenShiftLeft() {
         sm.clearAndSelect(0);
         keyboard.doRightArrowPress(KeyModifier.SHIFT);
         keyboard.doRightArrowPress(KeyModifier.SHIFT);
@@ -397,7 +398,7 @@
         assertFalse(sm.isSelected(2));
     }
     
-    @Ignore @Test public void testShiftUpTwiceThenShiftDown() {
+    @Test public void testShiftUpTwiceThenShiftDown() {
         sm.clearAndSelect(2);
         keyboard.doUpArrowPress(KeyModifier.SHIFT);
         keyboard.doUpArrowPress(KeyModifier.SHIFT);
@@ -409,7 +410,7 @@
     }
     
     // test 18 from Jindra's testcases.rtf file
-    @Ignore @Test public void testShiftDownTwiceThenShiftUpWhenAtLastIndex() {
+    @Test public void testShiftDownTwiceThenShiftUpWhenAtLastIndex() {
         int endIndex = getItemCount();
         sm.clearAndSelect(endIndex);
         keyboard.doDownArrowPress(KeyModifier.SHIFT);
@@ -421,7 +422,7 @@
     }
     
     // test 27
-    @Ignore @Test public void testCtrlDownArrowWithSpaceChangesAnchor_extended() {
+    @Test public void testCtrlDownArrowWithSpaceChangesAnchor_extended() {
         sm.clearAndSelect(0);
         keyboard.doDownArrowPress(KeyModifier.getShortcutKey());    // move focus to 1
         keyboard.doDownArrowPress(KeyModifier.getShortcutKey());    // move focus to 2
@@ -436,7 +437,7 @@
     }
     
     // test 28
-    @Ignore @Test public void testCtrlUpArrowWithSpaceChangesAnchor_extended() {
+    @Test public void testCtrlUpArrowWithSpaceChangesAnchor_extended() {
         sm.clearAndSelect(2);
         keyboard.doUpArrowPress(KeyModifier.getShortcutKey());    // move focus to 1
         keyboard.doUpArrowPress(KeyModifier.getShortcutKey());    // move focus to 0
@@ -451,7 +452,7 @@
     }
     
     // test 29
-    @Ignore @Test public void testCtrlDownArrowWithSpaceChangesAnchor_extended2() {
+    @Test public void testCtrlDownArrowWithSpaceChangesAnchor_extended2() {
         sm.clearAndSelect(0);
         keyboard.doDownArrowPress(KeyModifier.getShortcutKey());    // move focus to 1
         keyboard.doDownArrowPress(KeyModifier.getShortcutKey());    // move focus to 2
@@ -466,7 +467,7 @@
     }
     
     // test 30
-    @Ignore @Test public void testCtrlUpArrowWithSpaceChangesAnchor_extended2() {
+    @Test public void testCtrlUpArrowWithSpaceChangesAnchor_extended2() {
         sm.clearAndSelect(4);
         keyboard.doUpArrowPress(KeyModifier.getShortcutKey());    // move focus to 3
         keyboard.doUpArrowPress(KeyModifier.getShortcutKey());    // move focus to 2
@@ -481,7 +482,7 @@
     }
     
     // test 31
-    @Ignore @Test public void testCtrlDownArrowThenShiftSpaceToSelectRange() {
+    @Test public void testCtrlDownArrowThenShiftSpaceToSelectRange() {
         sm.clearAndSelect(0);
         keyboard.doDownArrowPress(KeyModifier.getShortcutKey());    // move focus to 1
         keyboard.doDownArrowPress(KeyModifier.getShortcutKey());    // move focus to 2
@@ -492,7 +493,7 @@
     }
     
     // test 32
-    @Ignore @Test public void testCtrlUpArrowThenShiftSpaceToSelectRange() {
+    @Test public void testCtrlUpArrowThenShiftSpaceToSelectRange() {
         sm.clearAndSelect(2);
         keyboard.doUpArrowPress(KeyModifier.getShortcutKey());    // move focus to 1
         keyboard.doUpArrowPress(KeyModifier.getShortcutKey());    // move focus to 0
@@ -503,7 +504,7 @@
     }
     
     // test 33
-    @Ignore @Test public void testCtrlDownArrowThenSpaceToChangeSelection() {
+    @Test public void testCtrlDownArrowThenSpaceToChangeSelection() {
         sm.clearAndSelect(0);
         keyboard.doDownArrowPress(KeyModifier.getShortcutKey());    // move focus to 1
         keyboard.doDownArrowPress(KeyModifier.getShortcutKey());    // move focus to 2
@@ -521,7 +522,7 @@
     }
     
     // test 34
-    @Ignore @Test public void testCtrlUpArrowThenSpaceToChangeSelection() {
+    @Test public void testCtrlUpArrowThenSpaceToChangeSelection() {
         sm.clearAndSelect(4);
         keyboard.doUpArrowPress(KeyModifier.getShortcutKey());    // move focus to 3
         keyboard.doUpArrowPress(KeyModifier.getShortcutKey());    // move focus to 2
@@ -539,7 +540,7 @@
     }
     
     // test 35
-    @Ignore @Test public void testCtrlDownTwiceThenShiftDown() {
+    @Test public void testCtrlDownTwiceThenShiftDown() {
         sm.clearAndSelect(0);
         keyboard.doDownArrowPress(KeyModifier.getShortcutKey());    // move focus to 1
         keyboard.doDownArrowPress(KeyModifier.getShortcutKey());    // move focus to 2
@@ -548,7 +549,7 @@
     }
     
     // test 36
-    @Ignore @Test public void testCtrlUpTwiceThenShiftDown() {
+    @Test public void testCtrlUpTwiceThenShiftDown() {
         sm.clearAndSelect(3);
         keyboard.doUpArrowPress(KeyModifier.getShortcutKey());    // move focus to 2
         keyboard.doUpArrowPress(KeyModifier.getShortcutKey());    // move focus to 1
@@ -559,7 +560,7 @@
     }
     
     // test 37
-    @Ignore @Test public void testCtrlDownThriceThenShiftUp() {
+    @Test public void testCtrlDownThriceThenShiftUp() {
         sm.clearAndSelect(0);
         keyboard.doDownArrowPress(KeyModifier.getShortcutKey());    // move focus to 1
         keyboard.doDownArrowPress(KeyModifier.getShortcutKey());    // move focus to 2
@@ -570,7 +571,7 @@
     }
     
     // test 38
-    @Ignore @Test public void testCtrlUpTwiceThenShiftUp() {
+    @Test public void testCtrlUpTwiceThenShiftUp() {
         sm.clearAndSelect(3);
         keyboard.doUpArrowPress(KeyModifier.getShortcutKey());    // move focus to 2
         keyboard.doUpArrowPress(KeyModifier.getShortcutKey());    // move focus to 1
@@ -580,7 +581,7 @@
     }
     
     // test 39
-    @Ignore @Test public void testCtrlDownTwiceThenSpace_extended() {
+    @Test public void testCtrlDownTwiceThenSpace_extended() {
         sm.clearAndSelect(0);
         keyboard.doDownArrowPress(KeyModifier.getShortcutKey());    // move focus to 1
         keyboard.doDownArrowPress(KeyModifier.getShortcutKey());    // move focus to 2
@@ -598,7 +599,7 @@
     }
     
     // test 40
-    @Ignore @Test public void testCtrlUpTwiceThenSpace_extended() {
+    @Test public void testCtrlUpTwiceThenSpace_extended() {
         sm.clearAndSelect(5);
         keyboard.doUpArrowPress(KeyModifier.getShortcutKey());    // move focus to 4
         keyboard.doUpArrowPress(KeyModifier.getShortcutKey());    // move focus to 3
@@ -617,7 +618,7 @@
     }
     
     // test 41
-    @Ignore @Test public void testCtrlDownTwiceThenSpace_extended2() {
+    @Test public void testCtrlDownTwiceThenSpace_extended2() {
         sm.clearAndSelect(0);
         keyboard.doDownArrowPress(KeyModifier.getShortcutKey());    // move focus to 1
         keyboard.doDownArrowPress(KeyModifier.getShortcutKey());    // move focus to 2
@@ -636,7 +637,7 @@
     }
     
     // test 50
-    @Ignore @Test public void testCtrlDownThenShiftHome() {
+    @Test public void testCtrlDownThenShiftHome() {
         sm.clearAndSelect(0);
         keyboard.doDownArrowPress(KeyModifier.getShortcutKey());    // move focus to 1
         keyboard.doDownArrowPress(KeyModifier.getShortcutKey());    // move focus to 2
@@ -654,7 +655,7 @@
     }
     
     // test 51
-    @Ignore @Test public void testCtrlUpThenShiftEnd() {
+    @Test public void testCtrlUpThenShiftEnd() {
         sm.clearAndSelect(5);
         keyboard.doUpArrowPress(KeyModifier.getShortcutKey());    // move focus to 4
         keyboard.doUpArrowPress(KeyModifier.getShortcutKey());    // move focus to 3
@@ -672,7 +673,7 @@
     }
     
     // test 42
-    @Ignore @Test public void testCtrlUpTwiceThenSpace_extended2() {
+    @Test public void testCtrlUpTwiceThenSpace_extended2() {
         sm.clearAndSelect(5);
         keyboard.doUpArrowPress(KeyModifier.getShortcutKey());    // move focus to 4
         keyboard.doUpArrowPress(KeyModifier.getShortcutKey());    // move focus to 3
@@ -690,7 +691,7 @@
     }
     
     // test 46
-    @Ignore @Test public void testHomeKey_withSelectedItems() {
+    @Test public void testHomeKey_withSelectedItems() {
         sm.clearSelection();
         sm.selectRange(4, 11);
         keyboard.doKeyPress(KeyCode.HOME);
@@ -699,7 +700,7 @@
     }
     
     // test 47
-    @Ignore @Test public void testEndKey_withSelectedItems() {
+    @Test public void testEndKey_withSelectedItems() {
         sm.clearSelection();
         sm.selectRange(4, 11);
         keyboard.doKeyPress(KeyCode.END);
@@ -708,7 +709,7 @@
     }
     
     // test 48
-    @Ignore @Test public void testShiftHome() {
+    @Test public void testShiftHome() {
         sm.clearAndSelect(3);
         keyboard.doKeyPress(KeyCode.HOME, KeyModifier.SHIFT);
         assertTrue(isSelected(0,1,2,3));
@@ -717,7 +718,7 @@
     }
     
     // test 49
-    @Ignore @Test public void testShiftEnd() {
+    @Test public void testShiftEnd() {
         sm.clearAndSelect(3);
         keyboard.doKeyPress(KeyCode.END, KeyModifier.SHIFT);
         assertTrue(isSelected(3,4,5,6,7,8,9));
@@ -726,7 +727,7 @@
     }
     
     // test 52
-    @Ignore @Test public void testShiftHomeThenShiftEnd() {
+    @Test public void testShiftHomeThenShiftEnd() {
         sm.clearAndSelect(5);
         keyboard.doKeyPress(KeyCode.HOME, KeyModifier.SHIFT);
         assertTrue(isSelected(0,1,2,3,4,5));
@@ -738,7 +739,7 @@
     }
     
     // test 65
-    @Ignore @Test public void testShiftPageUp() {
+    @Test public void testShiftPageUp() {
         sm.clearAndSelect(0);
         keyboard.doDownArrowPress(KeyModifier.getShortcutKey());
         keyboard.doDownArrowPress(KeyModifier.getShortcutKey());
@@ -754,7 +755,7 @@
     }
     
     // test 67
-    @Ignore @Test public void testCtrlAToSelectAll() {
+    @Test public void testCtrlAToSelectAll() {
         sm.clearAndSelect(5);
         keyboard.doKeyPress(KeyCode.A, KeyModifier.getShortcutKey());
         assertTrue(isSelected(0,1,2,3,4,5,6,7,8,9));
@@ -766,7 +767,7 @@
      **************************************************************************/
     
     // test 43 (part 1)
-    @Ignore @Test public void testF2EntersEditModeAndEscapeCancelsEdit_part1() {
+    @Test public void testF2EntersEditModeAndEscapeCancelsEdit_part1() {
         treeView.setEditable(true);
         
         sm.clearAndSelect(0);
@@ -779,7 +780,7 @@
     }
     
 //    // test 43 (part 2)
-//    @Ignore @Test public void testF2EntersEditModeAndEscapeCancelsEdit_part2() {
+//    @Test public void testF2EntersEditModeAndEscapeCancelsEdit_part2() {
 //        treeView.setEditable(true);
 //        
 //        sm.clearAndSelect(0);
@@ -794,7 +795,7 @@
      **************************************************************************/ 
     
     // Test 1 (TreeView test cases)
-    @Ignore @Test public void testRightArrowExpandsBranch() {
+    @Test public void testRightArrowExpandsBranch() {
         sm.clearAndSelect(0);
         root.setExpanded(false);
         assertFalse(root.isExpanded());
@@ -803,7 +804,7 @@
     }
     
     // Test 2 (TreeView test cases)
-    @Ignore @Test public void testRightArrowOnExpandedBranch() {
+    @Test public void testRightArrowOnExpandedBranch() {
         sm.clearAndSelect(0);
         keyboard.doRightArrowPress();
         assertTrue(isNotSelected(0));
@@ -811,7 +812,7 @@
     }
     
     // Test 3 (TreeView test cases)
-    @Ignore @Test public void testRightArrowOnLeafNode() {
+    @Test public void testRightArrowOnLeafNode() {
         sm.clearAndSelect(1);
         keyboard.doRightArrowPress();
         assertTrue(isNotSelected(0));
@@ -820,7 +821,7 @@
     }
     
     // Test 4 (TreeView test cases)
-    @Ignore @Test public void testLeftArrowCollapsesBranch() {
+    @Test public void testLeftArrowCollapsesBranch() {
         sm.clearAndSelect(0);
         assertTrue(root.isExpanded());
         keyboard.doLeftArrowPress();
@@ -828,7 +829,7 @@
     }
     
     // Test 5 (TreeView test cases)
-    @Ignore @Test public void testLeftArrowOnLeafMovesSelectionToParent() {
+    @Test public void testLeftArrowOnLeafMovesSelectionToParent() {
         sm.clearAndSelect(2);
         assertTrue(root.isExpanded());
         keyboard.doLeftArrowPress();
@@ -838,7 +839,7 @@
     }
     
     // Test 6 (TreeView test cases)
-    @Ignore @Test public void testLeftArrowMultipleTimes() {
+    @Test public void testLeftArrowMultipleTimes() {
         sm.clearAndSelect(5);
         keyboard.doLeftArrowPress();
         assertTrue(child3.isExpanded());
@@ -859,7 +860,7 @@
     }
     
     // Test 7 (TreeView test cases)
-    @Ignore @Test public void testDownArrowTwice() {
+    @Test public void testDownArrowTwice() {
         sm.clearAndSelect(0);
         keyboard.doDownArrowPress();
         keyboard.doDownArrowPress();
@@ -868,7 +869,7 @@
     }
     
     // Test 8 (TreeView test cases)
-    @Ignore @Test public void testDownArrowFourTimes() {
+    @Test public void testDownArrowFourTimes() {
         // adding children to child2, but not expanding it
         child2.getChildren().addAll(new TreeItem("another child"), new TreeItem("And another!"));
         child2.setExpanded(false);
@@ -884,7 +885,7 @@
     }
     
     // Test 9 (TreeView test cases)
-    @Ignore @Test public void testUpArrow() {
+    @Test public void testUpArrow() {
         sm.clearAndSelect(1);
         keyboard.doUpArrowPress();
         assertTrue(isSelected(0));
@@ -892,7 +893,7 @@
     }
     
     // Test 9 (TreeView test cases)
-    @Ignore @Test public void testUpArrowFourTimes() {
+    @Test public void testUpArrowFourTimes() {
         // adding children to child2, but not expanding it
         child2.getChildren().addAll(new TreeItem("another child"), new TreeItem("And another!"));
         child2.setExpanded(false);
@@ -908,7 +909,7 @@
     }
     
     // Test 20 (TreeView test cases)
-    @Ignore @Test public void testCtrlForwardSlashToSelectAll() {
+    @Test public void testCtrlForwardSlashToSelectAll() {
         sm.clearAndSelect(1);
         keyboard.doKeyPress(KeyCode.SLASH, KeyModifier.getShortcutKey());
         assertTrue(isSelected(0,1,2,3,4,5,6,7,8,9));
@@ -943,7 +944,7 @@
     }
     
     // Test 54 (TreeView test cases)
-    @Ignore @Test public void testAsteriskExpandsAllBranchesFromRoot() {
+    @Test public void testAsteriskExpandsAllBranchesFromRoot() {
         // adding children to child2, but not expanding it
         child2.getChildren().addAll(new TreeItem("another child"), new TreeItem("And another!"));
         child2.setExpanded(false);
@@ -958,7 +959,7 @@
     }
     
     // Test 57 (TreeView test cases)
-    @Ignore @Test public void testMinusCollapsesBranch() {
+    @Test public void testMinusCollapsesBranch() {
         sm.clearAndSelect(3);
         assertTrue(child3.isExpanded());
         keyboard.doKeyPress(KeyCode.SUBTRACT);
@@ -966,7 +967,7 @@
     }
     
     // Test 58 (TreeView test cases)
-    @Ignore @Test public void testPlusCollapsesBranch() {
+    @Test public void testPlusCollapsesBranch() {
         sm.clearAndSelect(3);
         child3.setExpanded(false);
         assertFalse(child3.isExpanded());
@@ -979,7 +980,7 @@
      * Tests for specific bug reports
      **************************************************************************/
     
-    @Ignore @Test public void test_rt18642() {
+    @Test public void test_rt18642() {
         sm.clearAndSelect(1);                          // select 1
         keyboard.doDownArrowPress(KeyModifier.getShortcutKey());   // shift focus to 2
         keyboard.doDownArrowPress(KeyModifier.getShortcutKey());   // shift focus to 3