changeset 3991:0c7ce9e94f64

Automated merge with ssh://jfxsrc.us.oracle.com//javafx/8.0/scrum/controls/jfx/rt
author jgiles
date Fri, 14 Jun 2013 10:33:15 +1200
parents 29f85364846e 8ef86a48a6c0
children 8064c39125c9
files javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TableColumnHeader.java
diffstat 11 files changed, 1429 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/EmbeddedTextContextMenuContent.java	Thu Jun 13 09:04:27 2013 -0400
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/EmbeddedTextContextMenuContent.java	Fri Jun 14 10:33:15 2013 +1200
@@ -25,6 +25,7 @@
 
 package com.sun.javafx.scene.control.skin;
 
+import java.util.Map;
 import javafx.beans.InvalidationListener;
 import javafx.beans.Observable;
 import javafx.collections.ListChangeListener;
@@ -132,19 +133,25 @@
         double pointerX = 0;
 
         // Get the positions of the cursor from the TextArea/TextField and draw the arrow underneath it.
+        Map properties = null;
         if (contextMenu.getOwnerNode() instanceof TextArea) {
-            TextArea ta = (TextArea)contextMenu.getOwnerNode();
-            TextAreaSkin tas = (TextAreaSkin)ta.getSkin();
-            sceneX = Double.valueOf(tas.getSkinnable().getProperties().get("CONTEXT_MENU_SCENE_X").toString());
-            screenX = Double.valueOf(tas.getSkinnable().getProperties().get("CONTEXT_MENU_SCREEN_X").toString());
-            tas.getSkinnable().getProperties().clear();
+            properties = ((TextArea)contextMenu.getOwnerNode()).getProperties();
         } else if (contextMenu.getOwnerNode() instanceof TextField) {
-            TextField tf = (TextField)contextMenu.getOwnerNode();
-            TextFieldSkin tfs = (TextFieldSkin)tf.getSkin();
-            sceneX = Double.valueOf(tfs.getSkinnable().getProperties().get("CONTEXT_MENU_SCENE_X").toString());
-            screenX = Double.valueOf(tfs.getSkinnable().getProperties().get("CONTEXT_MENU_SCREEN_X").toString());
-            tfs.getSkinnable().getProperties().clear();
+            properties = ((TextField)contextMenu.getOwnerNode()).getProperties();
         }
+
+        if (properties != null) {
+            if (properties.containsKey("CONTEXT_MENU_SCENE_X")) {
+                sceneX = Double.valueOf(properties.get("CONTEXT_MENU_SCENE_X").toString());
+                properties.remove("CONTEXT_MENU_SCENE_X");
+            }
+
+            if (properties.containsKey("CONTEXT_MENU_SCREEN_X")) {
+                screenX = Double.valueOf(properties.get("CONTEXT_MENU_SCREEN_X").toString());
+                properties.remove("CONTEXT_MENU_SCREEN_X");
+            }
+        }
+
         if (sceneX == 0) {
             pointerX = width/2;
         } else {
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TableColumnHeader.java	Thu Jun 13 09:04:27 2013 -0400
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TableColumnHeader.java	Fri Jun 14 10:33:15 2013 +1200
@@ -424,6 +424,7 @@
         label.setAlignment(Pos.CENTER);
         label.setText(column.getText());
         label.setGraphic(column.getGraphic());
+        label.setVisible(column.isVisible());
 
         // ---- container for the sort arrow (which is not supported on embedded
         // platforms)
--- a/javafx-ui-controls/src/javafx/scene/control/SkinBase.java	Thu Jun 13 09:04:27 2013 -0400
+++ b/javafx-ui-controls/src/javafx/scene/control/SkinBase.java	Fri Jun 14 10:33:15 2013 +1200
@@ -169,10 +169,12 @@
      */
     protected void layoutChildren(final double contentX, final double contentY,
             final double contentWidth, final double contentHeight) {
-        // By default simply sizes all children to fit within the space provided
+        // By default simply sizes all managed children to fit within the space provided
         for (int i=0, max=children.size(); i<max; i++) {
             Node child = children.get(i);
-            layoutInArea(child, contentX, contentY, contentWidth, contentHeight, -1, HPos.CENTER, VPos.CENTER);
+            if (child.isManaged()) {
+                layoutInArea(child, contentX, contentY, contentWidth, contentHeight, -1, HPos.CENTER, VPos.CENTER);
+            }
         }
     }
     
--- a/javafx-ui-controls/src/javafx/scene/control/cell/TextFieldListCell.java	Thu Jun 13 09:04:27 2013 -0400
+++ b/javafx-ui-controls/src/javafx/scene/control/cell/TextFieldListCell.java	Fri Jun 14 10:33:15 2013 +1200
@@ -183,12 +183,14 @@
             return;
         }
         super.startEdit();
-        
-        if (textField == null) {
-            textField = CellUtils.createTextField(this, getConverter());
+
+        if (isEditing()) {
+            if (textField == null) {
+                textField = CellUtils.createTextField(this, getConverter());
+            }
+
+            CellUtils.startEdit(this, getConverter(), null, null, textField);
         }
-        
-        CellUtils.startEdit(this, getConverter(), null, null, textField);
     }
 
     /** {@inheritDoc} */
--- a/javafx-ui-controls/src/javafx/scene/control/cell/TextFieldTableCell.java	Thu Jun 13 09:04:27 2013 -0400
+++ b/javafx-ui-controls/src/javafx/scene/control/cell/TextFieldTableCell.java	Fri Jun 14 10:33:15 2013 +1200
@@ -186,12 +186,14 @@
             return;
         }
         super.startEdit();
-        
-        if (textField == null) {
-            textField = CellUtils.createTextField(this, getConverter());
+
+        if (isEditing()) {
+            if (textField == null) {
+                textField = CellUtils.createTextField(this, getConverter());
+            }
+
+            CellUtils.startEdit(this, getConverter(), null, null, textField);
         }
-        
-        CellUtils.startEdit(this, getConverter(), null, null, textField);
     }
 
     /** {@inheritDoc} */
--- a/javafx-ui-controls/src/javafx/scene/control/cell/TextFieldTreeCell.java	Thu Jun 13 09:04:27 2013 -0400
+++ b/javafx-ui-controls/src/javafx/scene/control/cell/TextFieldTreeCell.java	Fri Jun 14 10:33:15 2013 +1200
@@ -193,16 +193,18 @@
             return;
         }
         super.startEdit();
-        
-        StringConverter<T> converter = getConverter();
-        if (textField == null) {
-            textField = CellUtils.createTextField(this, converter);
+
+        if (isEditing()) {
+            StringConverter<T> converter = getConverter();
+            if (textField == null) {
+                textField = CellUtils.createTextField(this, converter);
+            }
+            if (hbox == null) {
+                hbox = new HBox(CellUtils.TREE_VIEW_HBOX_GRAPHIC_PADDING);
+            }
+
+            CellUtils.startEdit(this, converter, hbox, getTreeItemGraphic(), textField);
         }
-        if (hbox == null) {
-            hbox = new HBox(CellUtils.TREE_VIEW_HBOX_GRAPHIC_PADDING);
-        }
-        
-        CellUtils.startEdit(this, converter, hbox, getTreeItemGraphic(), textField);
     }
 
     /** {@inheritDoc} */
--- a/javafx-ui-controls/src/javafx/scene/control/cell/TextFieldTreeTableCell.java	Thu Jun 13 09:04:27 2013 -0400
+++ b/javafx-ui-controls/src/javafx/scene/control/cell/TextFieldTreeTableCell.java	Fri Jun 14 10:33:15 2013 +1200
@@ -188,12 +188,14 @@
             return;
         }
         super.startEdit();
-        
-        if (textField == null) {
-            textField = CellUtils.createTextField(this, getConverter());
+
+        if (isEditing()) {
+            if (textField == null) {
+                textField = CellUtils.createTextField(this, getConverter());
+            }
+
+            CellUtils.startEdit(this, getConverter(), null, null, textField);
         }
-        
-        CellUtils.startEdit(this, getConverter(), null, null, textField);
     }
 
     /** {@inheritDoc} */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-controls/test/javafx/scene/control/cell/TextFieldListCellTest.java	Fri Jun 14 10:33:15 2013 +1200
@@ -0,0 +1,337 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javafx.scene.control.cell;
+
+import javafx.scene.control.ListCell;
+import javafx.scene.control.ListView;
+import javafx.util.Callback;
+import javafx.util.StringConverter;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+public class TextFieldListCellTest {
+    
+    private StringConverter<Object> converter;
+    
+    @Before public void setup() {
+        converter = new StringConverter<Object>() {
+            @Override public String toString(Object object) {
+                return null;
+            }
+
+            @Override public Object fromString(String string) {
+                return null;
+            }
+        };
+    }
+    
+    /**************************************************************************
+     * 
+     * Test for public static Callback<ListView<String>, ListCell<String>> forListView()
+     * 
+     **************************************************************************/
+
+    
+    @Test public void testStatic_forListView_noArgs_ensureCellFactoryIsNotNull() {
+        Callback<ListView<String>, ListCell<String>> cellFactory = TextFieldListCell.forListView();
+        assertNotNull(cellFactory);
+    }
+    
+    @Test public void testStatic_forListView_noArgs_ensureCellFactoryCreatesCells() {
+        Callback<ListView<String>, ListCell<String>> cellFactory = TextFieldListCell.forListView();
+        
+        ListView<String> listView = new ListView<>();
+        TextFieldListCell<String> cell = (TextFieldListCell<String>)cellFactory.call(listView);
+        assertNotNull(cell);
+    }
+
+    @Test public void testStatic_forListView_callback_ensureCellHasNonNullStringConverter() {
+        Callback<ListView<String>, ListCell<String>> cellFactory = TextFieldListCell.forListView();
+        
+        ListView<String> listView = new ListView<>();
+        TextFieldListCell<String> cell = (TextFieldListCell<String>)cellFactory.call(listView);
+        assertNotNull(cell.getConverter());
+    }
+    
+    
+    
+    /**************************************************************************
+     * 
+     * Test for public static <T> Callback<ListView<T>, ListCell<T>> forListView(
+     *       final StringConverter<T> converter)
+     * 
+     **************************************************************************/
+
+    
+    @Test public void testStatic_forListView_converter_ensureCellFactoryIsNotNull() {
+        Callback<ListView<Object>, ListCell<Object>> cellFactory = TextFieldListCell.forListView(converter);
+        assertNotNull(cellFactory);
+    }
+    
+    @Test public void testStatic_forListView_converter_ensureCellFactoryCreatesCells() {
+        Callback<ListView<Object>, ListCell<Object>> cellFactory = TextFieldListCell.forListView(converter);
+        
+        ListView<Object> listView = new ListView<>();
+        TextFieldListCell<Object> cell = (TextFieldListCell<Object>)cellFactory.call(listView);
+        assertNotNull(cell);
+    }
+
+    @Test public void testStatic_forListView_converter_ensureCellHasSetStringConverter() {
+        Callback<ListView<Object>, ListCell<Object>> cellFactory = TextFieldListCell.forListView(converter);
+        
+        ListView<Object> listView = new ListView<>();
+        TextFieldListCell<Object> cell = (TextFieldListCell<Object>)cellFactory.call(listView);
+        assertNotNull(cell.getConverter());
+        assertEquals(converter, cell.getConverter());
+    }
+    
+    
+    
+    /**************************************************************************
+     * 
+     * Constructor tests for default constructor
+     * 
+     **************************************************************************/
+
+    @Test public void testConstructor_noArgs_defaultStringConverterIsNull() {
+        TextFieldListCell<Object> cell = new TextFieldListCell<>();
+        assertNull(cell.getConverter());
+    }
+    
+    @Test public void testConstructor_noArgs_defaultStyleClass() {
+        TextFieldListCell<Object> cell = new TextFieldListCell<>();
+        assertTrue(cell.getStyleClass().contains("text-field-list-cell"));
+    }
+    
+    @Test public void testConstructor_noArgs_defaultGraphicIsNull() {
+        TextFieldListCell<Object> cell = new TextFieldListCell<>();
+        assertNull(cell.getGraphic());
+    }
+    
+    
+    /**************************************************************************
+     * 
+     * Constructor tests for one-arg constructor
+     * 
+     **************************************************************************/
+    
+    @Test public void testConstructor_converter_defaultStringConverterIsNotNull() {
+        TextFieldListCell<Object> cell = new TextFieldListCell<>(converter);
+        assertNotNull(cell.getConverter());
+    }
+    
+    @Test public void testConstructor_converter_defaultStyleClass() {
+        TextFieldListCell<Object> cell = new TextFieldListCell<>(converter);
+        assertTrue(cell.getStyleClass().contains("text-field-list-cell"));
+    }
+    
+    @Test public void testConstructor_converter_defaultGraphicIsACheckBox() {
+        TextFieldListCell<Object> cell = new TextFieldListCell<>(converter);
+        assertNull(cell.getGraphic());
+    }
+    
+    
+    /**************************************************************************
+     * 
+     * updateItem tests
+     * 
+     **************************************************************************/
+
+    @Test public void test_updateItem_isEmpty_graphicIsNull() {
+        TextFieldListCell<Object> cell = new TextFieldListCell<>();
+        cell.updateItem("TEST", true);
+        assertNull(cell.getGraphic());
+    }
+    
+    @Test public void test_updateItem_isEmpty_textIsNull() {
+        TextFieldListCell<Object> cell = new TextFieldListCell<>();
+        cell.updateItem("TEST", true);
+        assertNull(cell.getText());
+    }
+    
+    @Test public void test_updateItem_isNotEmpty_textIsNotNull() {
+        TextFieldListCell<Object> cell = new TextFieldListCell<>();
+        cell.updateItem("TEST", false);
+        assertNotNull(cell.getText());
+        assertEquals("TEST", cell.getText());
+    }
+    
+    @Test public void test_updateItem_isNotEmpty_textIsNotNull_nullConverter() {
+        TextFieldListCell<Object> cell = new TextFieldListCell<>();
+        cell.setConverter(null);
+        cell.updateItem("TEST", false);
+        assertNotNull(cell.getText());
+        assertEquals("TEST", cell.getText());
+    }
+    
+    @Test public void test_updateItem_isNotEmpty_textIsNotNull_nonNullConverter() {
+        TextFieldListCell<Object> cell = new TextFieldListCell<>();
+        cell.setConverter(
+                new StringConverter<Object>() {
+                    @Override public Object fromString(String string) {
+                        return null;
+                    }
+
+                    @Override public String toString(Object object) {
+                        return "CONVERTED";
+                    }
+                });
+        cell.updateItem("TEST", false);
+        assertNotNull(cell.getText());
+        assertEquals("CONVERTED", cell.getText());
+    }
+
+
+    /**************************************************************************
+     *
+     * editing tests
+     *
+     **************************************************************************/
+
+    // --- is Empty
+    @Test public void test_startEdit_cellEditableIsFalse_isEmpty() {
+        TextFieldListCell<Object> cell = new TextFieldListCell<>();
+        cell.setEditable(false);
+        cell.startEdit();
+        assertFalse(cell.isEditing());
+        assertNull(cell.getGraphic());
+    }
+
+    @Test public void test_startEdit_listViewEditableIsFalse_isEmpty() {
+        ListView listView = new ListView();
+        listView.setEditable(false);
+        TextFieldListCell<Object> cell = new TextFieldListCell<>();
+        cell.updateListView(listView);
+
+        cell.startEdit();
+        assertFalse(cell.isEditing());
+        assertNull(cell.getGraphic());
+    }
+
+    @Test(expected = NullPointerException.class)
+    public void test_startEdit_cellEditableIsTrue_listViewIsNull_isEmpty() {
+        TextFieldListCell<Object> cell = new TextFieldListCell<>();
+        cell.setEditable(true);
+        cell.startEdit();
+    }
+
+    @Test public void test_startEdit_listViewEditableIsTrue_isEmpty() {
+        ListView listView = new ListView();
+        listView.setEditable(true);
+        TextFieldListCell<Object> cell = new TextFieldListCell<>();
+        cell.updateListView(listView);
+
+        cell.startEdit();
+        assertFalse(cell.isEditing());
+        assertNull(cell.getGraphic());
+    }
+
+    @Test public void test_startEdit_listViewEditableIsTrue_cellEditableIsTrue_isEmpty() {
+        ListView listView = new ListView();
+        listView.setEditable(true);
+        TextFieldListCell<Object> cell = new TextFieldListCell<>();
+        cell.setEditable(true);
+        cell.updateListView(listView);
+
+        cell.startEdit();
+        assertFalse(cell.isEditing());
+        assertNull(cell.getGraphic());
+    }
+
+    // --- is Not Empty
+    @Test public void test_startEdit_cellEditableIsFalse_isNotEmpty() {
+        TextFieldListCell<Object> cell = new TextFieldListCell<>();
+        cell.updateItem("TEST", false);
+        cell.setEditable(false);
+        cell.startEdit();
+        assertFalse(cell.isEditing());
+        assertNull(cell.getGraphic());
+    }
+
+    @Test public void test_startEdit_listViewEditableIsFalse_isNotEmpty() {
+        ListView listView = new ListView();
+        listView.setEditable(false);
+        TextFieldListCell<Object> cell = new TextFieldListCell<>();
+        cell.updateListView(listView);
+        cell.updateItem("TEST", false);
+
+        cell.startEdit();
+        assertFalse(cell.isEditing());
+        assertNull(cell.getGraphic());
+    }
+
+    @Test(expected = NullPointerException.class)
+    public void test_startEdit_cellEditableIsTrue_listViewIsNull_isNotEmpty() {
+        TextFieldListCell<Object> cell = new TextFieldListCell<>();
+        cell.updateItem("TEST", false);
+        cell.setEditable(true);
+        cell.startEdit();
+    }
+
+    @Test public void test_startEdit_listViewEditableIsTrue_isNotEmpty() {
+        ListView listView = new ListView();
+        listView.setEditable(true);
+        TextFieldListCell<Object> cell = new TextFieldListCell<>();
+        cell.updateListView(listView);
+        cell.updateItem("TEST", false);
+
+        cell.startEdit();
+        assertTrue(cell.isEditing());
+        assertNotNull(cell.getGraphic());
+    }
+
+    @Test public void test_startEdit_listViewEditableIsTrue_cellEditableIsTrue_isNotEmpty() {
+        ListView listView = new ListView();
+        listView.setEditable(true);
+        TextFieldListCell<Object> cell = new TextFieldListCell<>();
+        cell.setEditable(true);
+        cell.updateListView(listView);
+        cell.updateItem("TEST", false);
+
+        cell.startEdit();
+        assertTrue(cell.isEditing());
+        assertNotNull(cell.getGraphic());
+    }
+
+    // --- cancel edit
+    @Test public void test_cancelEdit() {
+        ListView listView = new ListView();
+        listView.setEditable(true);
+        TextFieldListCell<Object> cell = new TextFieldListCell<>();
+        cell.updateListView(listView);
+        cell.updateItem("TEST", false);
+
+        cell.startEdit();
+        assertTrue(cell.isEditing());
+        assertNotNull(cell.getGraphic());
+
+        cell.cancelEdit();
+        assertFalse(cell.isEditing());
+        assertNull(cell.getGraphic());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-controls/test/javafx/scene/control/cell/TextFieldTableCellTest.java	Fri Jun 14 10:33:15 2013 +1200
@@ -0,0 +1,344 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javafx.scene.control.cell;
+
+import javafx.scene.control.TableCell;
+import javafx.scene.control.TableColumn;
+import javafx.scene.control.TableView;
+import javafx.util.Callback;
+import javafx.util.StringConverter;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+public class TextFieldTableCellTest {
+    
+    private StringConverter<Object> converter;
+    
+    @Before public void setup() {
+        converter = new StringConverter<Object>() {
+            @Override public String toString(Object object) {
+                return null;
+            }
+
+            @Override public Object fromString(String string) {
+                return null;
+            }
+        };
+    }
+    
+    /**************************************************************************
+     * 
+     * Test for public static Callback<TableColumn<String>, TableCell<String>> forTableColumn()
+     * 
+     **************************************************************************/
+
+    
+    @Test public void testStatic_forTableColumn_noArgs_ensureCellFactoryIsNotNull() {
+        Callback<TableColumn<Object,String>, TableCell<Object,String>> cellFactory = TextFieldTableCell.forTableColumn();
+        assertNotNull(cellFactory);
+    }
+    
+    @Test public void testStatic_forTableColumn_noArgs_ensureCellFactoryCreatesCells() {
+        Callback<TableColumn<Object,String>, TableCell<Object,String>> cellFactory = TextFieldTableCell.forTableColumn();
+        
+        TableColumn<Object,String> tableColumn = new TableColumn<>();
+        TextFieldTableCell<Object,String> cell = (TextFieldTableCell<Object,String>)cellFactory.call(tableColumn);
+        assertNotNull(cell);
+    }
+
+    @Test public void testStatic_forTableColumn_callback_ensureCellHasNonNullStringConverter() {
+        Callback<TableColumn<Object,String>, TableCell<Object,String>> cellFactory = TextFieldTableCell.forTableColumn();
+        
+        TableColumn<Object,String> tableColumn = new TableColumn<>();
+        TextFieldTableCell<Object,String> cell = (TextFieldTableCell<Object,String>)cellFactory.call(tableColumn);
+        assertNotNull(cell.getConverter());
+    }
+    
+    
+    
+    /**************************************************************************
+     * 
+     * Test for public static <T> Callback<TableColumn<T>, TableCell<T>> forTableColumn(
+     *       final StringConverter<T> converter)
+     * 
+     **************************************************************************/
+
+    
+    @Test public void testStatic_forTableColumn_converter_ensureCellFactoryIsNotNull() {
+        Callback<TableColumn<Object,Object>, TableCell<Object,Object>> cellFactory = TextFieldTableCell.forTableColumn(converter);
+        assertNotNull(cellFactory);
+    }
+    
+    @Test public void testStatic_forTableColumn_converter_ensureCellFactoryCreatesCells() {
+        Callback<TableColumn<Object,Object>, TableCell<Object,Object>> cellFactory = TextFieldTableCell.forTableColumn(converter);
+        
+        TableColumn<Object,Object> tableColumn = new TableColumn<>();
+        TextFieldTableCell<Object,Object> cell = (TextFieldTableCell<Object,Object>)cellFactory.call(tableColumn);
+        assertNotNull(cell);
+    }
+
+    @Test public void testStatic_forTableColumn_converter_ensureCellHasSetStringConverter() {
+        Callback<TableColumn<Object,Object>, TableCell<Object,Object>> cellFactory = TextFieldTableCell.forTableColumn(converter);
+        
+        TableColumn<Object,Object> tableColumn = new TableColumn<>();
+        TextFieldTableCell<Object,Object> cell = (TextFieldTableCell<Object,Object>)cellFactory.call(tableColumn);
+        assertNotNull(cell.getConverter());
+        assertEquals(converter, cell.getConverter());
+    }
+    
+    
+    
+    /**************************************************************************
+     * 
+     * Constructor tests for default constructor
+     * 
+     **************************************************************************/
+
+    @Test public void testConstructor_noArgs_defaultStringConverterIsNull() {
+        TextFieldTableCell<?,Object> cell = new TextFieldTableCell<>();
+        assertNull(cell.getConverter());
+    }
+    
+    @Test public void testConstructor_noArgs_defaultStyleClass() {
+        TextFieldTableCell<?,Object> cell = new TextFieldTableCell<>();
+        assertTrue(cell.getStyleClass().contains("text-field-table-cell"));
+    }
+    
+    @Test public void testConstructor_noArgs_defaultGraphicIsNull() {
+        TextFieldTableCell<?,Object> cell = new TextFieldTableCell<>();
+        assertNull(cell.getGraphic());
+    }
+    
+    
+    /**************************************************************************
+     * 
+     * Constructor tests for one-arg constructor
+     * 
+     **************************************************************************/
+    
+    @Test public void testConstructor_converter_defaultStringConverterIsNotNull() {
+        TextFieldTableCell<?,Object> cell = new TextFieldTableCell<>(converter);
+        assertNotNull(cell.getConverter());
+    }
+    
+    @Test public void testConstructor_converter_defaultStyleClass() {
+        TextFieldTableCell<?,Object> cell = new TextFieldTableCell<>(converter);
+        assertTrue(cell.getStyleClass().contains("text-field-table-cell"));
+    }
+    
+    @Test public void testConstructor_converter_defaultGraphicIsACheckBox() {
+        TextFieldTableCell<?,Object> cell = new TextFieldTableCell<>(converter);
+        assertNull(cell.getGraphic());
+    }
+    
+    
+    /**************************************************************************
+     * 
+     * updateItem tests
+     * 
+     **************************************************************************/
+
+    @Test public void test_updateItem_isEmpty_graphicIsNull() {
+        TextFieldTableCell<?,Object> cell = new TextFieldTableCell<>();
+        cell.updateItem("TEST", true);
+        assertNull(cell.getGraphic());
+    }
+    
+    @Test public void test_updateItem_isEmpty_textIsNull() {
+        TextFieldTableCell<?,Object> cell = new TextFieldTableCell<>();
+        cell.updateItem("TEST", true);
+        assertNull(cell.getText());
+    }
+    
+    @Test public void test_updateItem_isNotEmpty_textIsNotNull() {
+        TextFieldTableCell<?,Object> cell = new TextFieldTableCell<>();
+        cell.updateItem("TEST", false);
+        assertNotNull(cell.getText());
+        assertEquals("TEST", cell.getText());
+    }
+    
+    @Test public void test_updateItem_isNotEmpty_textIsNotNull_nullConverter() {
+        TextFieldTableCell<?,Object> cell = new TextFieldTableCell<>();
+        cell.setConverter(null);
+        cell.updateItem("TEST", false);
+        assertNotNull(cell.getText());
+        assertEquals("TEST", cell.getText());
+    }
+    
+    @Test public void test_updateItem_isNotEmpty_textIsNotNull_nonNullConverter() {
+        TextFieldTableCell<?,Object> cell = new TextFieldTableCell<>();
+        cell.setConverter(
+                new StringConverter<Object>() {
+                    @Override public Object fromString(String string) {
+                        return null;
+                    }
+
+                    @Override public String toString(Object object) {
+                        return "CONVERTED";
+                    }
+                });
+        cell.updateItem("TEST", false);
+        assertNotNull(cell.getText());
+        assertEquals("CONVERTED", cell.getText());
+    }
+
+
+    /**************************************************************************
+     *
+     * editing tests
+     *
+     **************************************************************************/
+
+//    // --- is Empty
+//    @Test public void test_startEdit_cellEditableIsFalse_isEmpty() {
+//        TextFieldTableCell<Object,Object> cell = new TextFieldTableCell<>();
+//        cell.setEditable(false);
+//        cell.startEdit();
+//        assertFalse(cell.isEditing());
+//        assertNull(cell.getGraphic());
+//    }
+//
+//    @Test public void test_startEdit_tableColumnEditableIsFalse_isEmpty() {
+//        TableColumn<Object,Object> tableColumn = new TableColumn<>();
+//        tableColumn.setEditable(false);
+//        TextFieldTableCell<Object,Object> cell = new TextFieldTableCell<>();
+//        cell.updateTableColumn(tableColumn);
+//
+//        cell.startEdit();
+//        assertFalse(cell.isEditing());
+//        assertNull(cell.getGraphic());
+//    }
+//
+//    @Test(expected = NullPointerException.class)
+//    public void test_startEdit_cellEditableIsTrue_tableColumnIsNull_isEmpty() {
+//        TextFieldTableCell<Object,Object> cell = new TextFieldTableCell<>();
+//        cell.setEditable(true);
+//        cell.startEdit();
+//    }
+//
+//    @Test public void test_startEdit_tableColumnEditableIsTrue_isEmpty() {
+//        TableColumn<Object,Object> tableColumn = new TableColumn<>();
+//        tableColumn.setEditable(true);
+//        TextFieldTableCell<Object,Object> cell = new TextFieldTableCell<>();
+//        cell.updateTableColumn(tableColumn);
+//
+//        cell.startEdit();
+//        assertFalse(cell.isEditing());
+//        assertNull(cell.getGraphic());
+//    }
+//
+//    @Test public void test_startEdit_tableColumnEditableIsTrue_cellEditableIsTrue_isEmpty() {
+//        TableColumn<Object,Object> tableColumn = new TableColumn<>();
+//        tableColumn.setEditable(true);
+//        TextFieldTableCell<Object,Object> cell = new TextFieldTableCell<>();
+//        cell.setEditable(true);
+//        cell.updateTableColumn(tableColumn);
+//
+//        cell.startEdit();
+//        assertFalse(cell.isEditing());
+//        assertNull(cell.getGraphic());
+//    }
+//
+//    // --- is Not Empty
+//    @Test public void test_startEdit_cellEditableIsFalse_isNotEmpty() {
+//        TextFieldTableCell<Object,Object> cell = new TextFieldTableCell<>();
+//        cell.updateItem("TEST", false);
+//        cell.setEditable(false);
+//        cell.startEdit();
+//        assertFalse(cell.isEditing());
+//        assertNull(cell.getGraphic());
+//    }
+//
+//    @Test public void test_startEdit_tableColumnEditableIsFalse_isNotEmpty() {
+//        TableColumn<Object,Object> tableColumn = new TableColumn<>();
+//        tableColumn.setEditable(false);
+//        TextFieldTableCell<Object,Object> cell = new TextFieldTableCell<>();
+//        cell.updateTableColumn(tableColumn);
+//        cell.updateItem("TEST", false);
+//
+//        cell.startEdit();
+//        assertFalse(cell.isEditing());
+//        assertNull(cell.getGraphic());
+//    }
+//
+//    @Test(expected = NullPointerException.class)
+//    public void test_startEdit_cellEditableIsTrue_tableColumnIsNull_isNotEmpty() {
+//        TextFieldTableCell<Object,Object> cell = new TextFieldTableCell<>();
+//        cell.updateItem("TEST", false);
+//        cell.setEditable(true);
+//        cell.startEdit();
+//    }
+//
+//    @Test public void test_startEdit_tableColumnEditableIsTrue_isNotEmpty() {
+//        TableColumn<Object,Object> tableColumn = new TableColumn<>();
+//        tableColumn.setEditable(true);
+//        TextFieldTableCell<Object,Object> cell = new TextFieldTableCell<>();
+//        cell.updateTableColumn(tableColumn);
+//        cell.updateItem("TEST", false);
+//
+//        cell.startEdit();
+//        assertTrue(cell.isEditing());
+//        assertNotNull(cell.getGraphic());
+//    }
+//
+//    @Test public void test_startEdit_tableColumnEditableIsTrue_cellEditableIsTrue_isNotEmpty() {
+//        TableColumn<Object,Object> tableColumn = new TableColumn<>();
+//        tableColumn.setEditable(true);
+//        TextFieldTableCell<Object,Object> cell = new TextFieldTableCell<>();
+//        cell.setEditable(true);
+//        cell.updateTableColumn(tableColumn);
+//        cell.updateItem("TEST", false);
+//
+//        cell.startEdit();
+//        assertTrue(cell.isEditing());
+//        assertNotNull(cell.getGraphic());
+//    }
+//
+//    // --- cancel edit
+//    @Test public void test_cancelEdit() {
+//        TableView tableView = new TableView<>();
+//        tableView.setEditable(true);
+//        tableView.getItems().add("TEST");
+//        TableColumn<Object,Object> tableColumn = new TableColumn<>();
+//        tableColumn.setEditable(true);
+//        TextFieldTableCell<Object,Object> cell = new TextFieldTableCell<>();
+//        cell.updateTableView(tableView);
+//        cell.updateTableColumn(tableColumn);
+////        cell.updateItem("TEST", false);
+//        cell.updateIndex(0);
+//
+////        cell.startEdit();
+//        tableView.edit(0, tableColumn);
+//        assertTrue(cell.isEditing());
+//        assertNotNull(cell.getGraphic());
+//
+//        cell.cancelEdit();
+//        assertFalse(cell.isEditing());
+//        assertNull(cell.getGraphic());
+//    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-controls/test/javafx/scene/control/cell/TextFieldTreeCellTest.java	Fri Jun 14 10:33:15 2013 +1200
@@ -0,0 +1,342 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javafx.scene.control.cell;
+
+import javafx.scene.control.TreeCell;
+import javafx.scene.control.TreeItem;
+import javafx.scene.control.TreeView;
+import javafx.util.Callback;
+import javafx.util.StringConverter;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+public class TextFieldTreeCellTest {
+    
+    private StringConverter<Object> converter;
+    
+    @Before public void setup() {
+        converter = new StringConverter<Object>() {
+            @Override public String toString(Object object) {
+                return null;
+            }
+
+            @Override public Object fromString(String string) {
+                return null;
+            }
+        };
+    }
+    
+    /**************************************************************************
+     * 
+     * Test for public static Callback<TreeView<String>, TreeCell<String>> forTreeView()
+     * 
+     **************************************************************************/
+
+    
+    @Test public void testStatic_forTreeView_noArgs_ensureCellFactoryIsNotNull() {
+        Callback<TreeView<String>, TreeCell<String>> cellFactory = TextFieldTreeCell.forTreeView();
+        assertNotNull(cellFactory);
+    }
+    
+    @Test public void testStatic_forTreeView_noArgs_ensureCellFactoryCreatesCells() {
+        Callback<TreeView<String>, TreeCell<String>> cellFactory = TextFieldTreeCell.forTreeView();
+        
+        TreeView<String> treeView = new TreeView<>();
+        TextFieldTreeCell<String> cell = (TextFieldTreeCell<String>)cellFactory.call(treeView);
+        assertNotNull(cell);
+    }
+
+    @Test public void testStatic_forTreeView_callback_ensureCellHasNonNullStringConverter() {
+        Callback<TreeView<String>, TreeCell<String>> cellFactory = TextFieldTreeCell.forTreeView();
+        
+        TreeView<String> treeView = new TreeView<>();
+        TextFieldTreeCell<String> cell = (TextFieldTreeCell<String>)cellFactory.call(treeView);
+        assertNotNull(cell.getConverter());
+    }
+    
+    
+    
+    /**************************************************************************
+     * 
+     * Test for public static <T> Callback<TreeView<T>, TreeCell<T>> forTreeView(
+     *       final StringConverter<T> converter)
+     * 
+     **************************************************************************/
+
+    
+    @Test public void testStatic_forTreeView_converter_ensureCellFactoryIsNotNull() {
+        Callback<TreeView<Object>, TreeCell<Object>> cellFactory = TextFieldTreeCell.forTreeView(converter);
+        assertNotNull(cellFactory);
+    }
+    
+    @Test public void testStatic_forTreeView_converter_ensureCellFactoryCreatesCells() {
+        Callback<TreeView<Object>, TreeCell<Object>> cellFactory = TextFieldTreeCell.forTreeView(converter);
+        
+        TreeView<Object> treeView = new TreeView<>();
+        TextFieldTreeCell<Object> cell = (TextFieldTreeCell<Object>)cellFactory.call(treeView);
+        assertNotNull(cell);
+    }
+
+    @Test public void testStatic_forTreeView_converter_ensureCellHasSetStringConverter() {
+        Callback<TreeView<Object>, TreeCell<Object>> cellFactory = TextFieldTreeCell.forTreeView(converter);
+        
+        TreeView<Object> treeView = new TreeView<>();
+        TextFieldTreeCell<Object> cell = (TextFieldTreeCell<Object>)cellFactory.call(treeView);
+        assertNotNull(cell.getConverter());
+        assertEquals(converter, cell.getConverter());
+    }
+    
+    
+    
+    /**************************************************************************
+     * 
+     * Constructor tests for default constructor
+     * 
+     **************************************************************************/
+
+    @Test public void testConstructor_noArgs_defaultStringConverterIsNull() {
+        TextFieldTreeCell<Object> cell = new TextFieldTreeCell<>();
+        assertNull(cell.getConverter());
+    }
+    
+    @Test public void testConstructor_noArgs_defaultStyleClass() {
+        TextFieldTreeCell<Object> cell = new TextFieldTreeCell<>();
+        assertTrue(cell.getStyleClass().contains("text-field-tree-cell"));
+    }
+    
+    @Test public void testConstructor_noArgs_defaultGraphicIsNull() {
+        TextFieldTreeCell<Object> cell = new TextFieldTreeCell<>();
+        assertNull(cell.getGraphic());
+    }
+    
+    
+    /**************************************************************************
+     * 
+     * Constructor tests for one-arg constructor
+     * 
+     **************************************************************************/
+    
+    @Test public void testConstructor_converter_defaultStringConverterIsNotNull() {
+        TextFieldTreeCell<Object> cell = new TextFieldTreeCell<>(converter);
+        assertNotNull(cell.getConverter());
+    }
+    
+    @Test public void testConstructor_converter_defaultStyleClass() {
+        TextFieldTreeCell<Object> cell = new TextFieldTreeCell<>(converter);
+        assertTrue(cell.getStyleClass().contains("text-field-tree-cell"));
+    }
+    
+    @Test public void testConstructor_converter_defaultGraphicIsACheckBox() {
+        TextFieldTreeCell<Object> cell = new TextFieldTreeCell<>(converter);
+        assertNull(cell.getGraphic());
+    }
+    
+    
+    /**************************************************************************
+     * 
+     * updateItem tests
+     * 
+     **************************************************************************/
+
+    @Test public void test_updateItem_isEmpty_graphicIsNull() {
+        TextFieldTreeCell<Object> cell = new TextFieldTreeCell<>();
+        cell.updateItem("TEST", true);
+        assertNull(cell.getGraphic());
+    }
+    
+    @Test public void test_updateItem_isEmpty_textIsNull() {
+        TextFieldTreeCell<Object> cell = new TextFieldTreeCell<>();
+        cell.updateItem("TEST", true);
+        assertNull(cell.getText());
+    }
+    
+    @Test public void test_updateItem_isNotEmpty_textIsNotNull() {
+        TextFieldTreeCell<Object> cell = new TextFieldTreeCell<>();
+        cell.updateItem("TEST", false);
+        assertNotNull(cell.getText());
+        assertEquals("TEST", cell.getText());
+    }
+    
+    @Test public void test_updateItem_isNotEmpty_textIsNotNull_nullConverter() {
+        TextFieldTreeCell<Object> cell = new TextFieldTreeCell<>();
+        cell.setConverter(null);
+        cell.updateItem("TEST", false);
+        assertNotNull(cell.getText());
+        assertEquals("TEST", cell.getText());
+    }
+    
+    @Test public void test_updateItem_isNotEmpty_textIsNotNull_nonNullConverter() {
+        TextFieldTreeCell<Object> cell = new TextFieldTreeCell<>();
+        cell.setConverter(
+                new StringConverter<Object>() {
+                    @Override public Object fromString(String string) {
+                        return null;
+                    }
+
+                    @Override public String toString(Object object) {
+                        return "CONVERTED";
+                    }
+                });
+        cell.updateItem("TEST", false);
+        assertNotNull(cell.getText());
+        assertEquals("CONVERTED", cell.getText());
+    }
+
+
+    /**************************************************************************
+     *
+     * editing tests
+     *
+     **************************************************************************/
+
+    // --- is Empty
+    @Test public void test_startEdit_cellEditableIsFalse_isEmpty() {
+        TextFieldTreeCell<Object> cell = new TextFieldTreeCell<>();
+        cell.setEditable(false);
+        cell.startEdit();
+        assertFalse(cell.isEditing());
+        assertNull(cell.getGraphic());
+    }
+
+    @Test public void test_startEdit_treeViewEditableIsFalse_isEmpty() {
+        TreeView treeView = new TreeView();
+        treeView.setEditable(false);
+        TextFieldTreeCell<Object> cell = new TextFieldTreeCell<>();
+        cell.updateTreeView(treeView);
+
+        cell.startEdit();
+        assertFalse(cell.isEditing());
+        assertNull(cell.getGraphic());
+    }
+
+    @Test(expected = NullPointerException.class)
+    public void test_startEdit_cellEditableIsTrue_treeViewIsNull_isEmpty() {
+        TextFieldTreeCell<Object> cell = new TextFieldTreeCell<>();
+        cell.setEditable(true);
+        cell.startEdit();
+    }
+
+    @Test public void test_startEdit_treeViewEditableIsTrue_isEmpty() {
+        TreeView treeView = new TreeView();
+        treeView.setEditable(true);
+        TextFieldTreeCell<Object> cell = new TextFieldTreeCell<>();
+        cell.updateTreeView(treeView);
+
+        cell.startEdit();
+        assertFalse(cell.isEditing());
+        assertNull(cell.getGraphic());
+    }
+
+    @Test public void test_startEdit_treeViewEditableIsTrue_cellEditableIsTrue_isEmpty() {
+        TreeView treeView = new TreeView();
+        treeView.setEditable(true);
+        TextFieldTreeCell<Object> cell = new TextFieldTreeCell<>();
+        cell.setEditable(true);
+        cell.updateTreeView(treeView);
+
+        cell.startEdit();
+        assertFalse(cell.isEditing());
+        assertNull(cell.getGraphic());
+    }
+
+    // --- is Not Empty
+    @Test public void test_startEdit_cellEditableIsFalse_isNotEmpty() {
+        TextFieldTreeCell<Object> cell = new TextFieldTreeCell<>();
+        cell.updateItem("TEST", false);
+        cell.setEditable(false);
+        cell.startEdit();
+        assertFalse(cell.isEditing());
+        assertNull(cell.getGraphic());
+    }
+
+    @Test public void test_startEdit_treeViewEditableIsFalse_isNotEmpty() {
+        TreeView treeView = new TreeView();
+        treeView.setEditable(false);
+        TextFieldTreeCell<Object> cell = new TextFieldTreeCell<>();
+        cell.updateTreeView(treeView);
+        cell.updateItem("TEST", false);
+
+        cell.startEdit();
+        assertFalse(cell.isEditing());
+        assertNull(cell.getGraphic());
+    }
+
+    @Test(expected = NullPointerException.class)
+    public void test_startEdit_cellEditableIsTrue_treeViewIsNull_isNotEmpty() {
+        TextFieldTreeCell<Object> cell = new TextFieldTreeCell<>();
+        cell.updateItem("TEST", false);
+        cell.setEditable(true);
+        cell.startEdit();
+    }
+
+    @Test public void test_startEdit_treeViewEditableIsTrue_isNotEmpty() {
+        TreeItem root = new TreeItem("Root");
+        TreeView treeView = new TreeView(root);
+        treeView.setEditable(true);
+        TextFieldTreeCell<Object> cell = new TextFieldTreeCell<>();
+        cell.updateTreeView(treeView);
+        cell.updateIndex(0);
+
+        cell.startEdit();
+        assertTrue(cell.isEditing());
+        assertNotNull(cell.getGraphic());
+    }
+
+    @Test public void test_startEdit_treeViewEditableIsTrue_cellEditableIsTrue_isNotEmpty() {
+        TreeItem root = new TreeItem("Root");
+        TreeView treeView = new TreeView(root);
+        treeView.setEditable(true);
+        TextFieldTreeCell<Object> cell = new TextFieldTreeCell<>();
+        cell.setEditable(true);
+        cell.updateTreeView(treeView);
+        cell.updateIndex(0);
+
+        cell.startEdit();
+        assertTrue(cell.isEditing());
+        assertNotNull(cell.getGraphic());
+    }
+
+    // --- cancel edit
+    @Test public void test_cancelEdit() {
+        TreeItem root = new TreeItem("Root");
+        TreeView treeView = new TreeView(root);
+        treeView.setEditable(true);
+        TextFieldTreeCell<Object> cell = new TextFieldTreeCell<>();
+        cell.updateTreeView(treeView);
+
+        cell.updateIndex(0);
+
+        cell.startEdit();
+        assertTrue(cell.isEditing());
+        assertNotNull(cell.getGraphic());
+
+        cell.cancelEdit();
+        assertFalse(cell.isEditing());
+        assertNull(cell.getGraphic());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-controls/test/javafx/scene/control/cell/TextFieldTreeTableCellTest.java	Fri Jun 14 10:33:15 2013 +1200
@@ -0,0 +1,352 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javafx.scene.control.cell;
+
+import javafx.scene.control.TreeItem;
+import javafx.scene.control.TreeTableCell;
+import javafx.scene.control.TreeTableColumn;
+import javafx.scene.control.TreeTableView;
+import javafx.util.Callback;
+import javafx.util.StringConverter;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+public class TextFieldTreeTableCellTest {
+
+    private StringConverter<Object> converter;
+
+    @Before public void setup() {
+        converter = new StringConverter<Object>() {
+            @Override public String toString(Object object) {
+                return null;
+            }
+
+            @Override public Object fromString(String string) {
+                return null;
+            }
+        };
+    }
+
+    /**************************************************************************
+     *
+     * Test for public static Callback<TreeTableColumn<String>, TreeTableCell<String>> forTreeTableColumn()
+     *
+     **************************************************************************/
+
+
+    @Test public void testStatic_forTreeTableColumn_noArgs_ensureCellFactoryIsNotNull() {
+        Callback<TreeTableColumn<Object,String>, TreeTableCell<Object,String>> cellFactory = TextFieldTreeTableCell.forTreeTableColumn();
+        assertNotNull(cellFactory);
+    }
+
+    @Test public void testStatic_forTreeTableColumn_noArgs_ensureCellFactoryCreatesCells() {
+        Callback<TreeTableColumn<Object,String>, TreeTableCell<Object,String>> cellFactory = TextFieldTreeTableCell.forTreeTableColumn();
+
+        TreeTableColumn<Object,String> tableColumn = new TreeTableColumn<>();
+        TextFieldTreeTableCell<Object,String> cell = (TextFieldTreeTableCell<Object,String>)cellFactory.call(tableColumn);
+        assertNotNull(cell);
+    }
+
+    @Test public void testStatic_forTreeTableColumn_callback_ensureCellHasNonNullStringConverter() {
+        Callback<TreeTableColumn<Object,String>, TreeTableCell<Object,String>> cellFactory = TextFieldTreeTableCell.forTreeTableColumn();
+
+        TreeTableColumn<Object,String> tableColumn = new TreeTableColumn<>();
+        TextFieldTreeTableCell<Object,String> cell = (TextFieldTreeTableCell<Object,String>)cellFactory.call(tableColumn);
+        assertNotNull(cell.getConverter());
+    }
+
+
+
+    /**************************************************************************
+     *
+     * Test for public static <T> Callback<TreeTableColumn<T>, TreeTableCell<T>> forTreeTableColumn(
+     *       final StringConverter<T> converter)
+     *
+     **************************************************************************/
+
+
+    @Test public void testStatic_forTreeTableColumn_converter_ensureCellFactoryIsNotNull() {
+        Callback<TreeTableColumn<Object,Object>, TreeTableCell<Object,Object>> cellFactory = TextFieldTreeTableCell.forTreeTableColumn(converter);
+        assertNotNull(cellFactory);
+    }
+
+    @Test public void testStatic_forTreeTableColumn_converter_ensureCellFactoryCreatesCells() {
+        Callback<TreeTableColumn<Object,Object>, TreeTableCell<Object,Object>> cellFactory = TextFieldTreeTableCell.forTreeTableColumn(converter);
+
+        TreeTableColumn<Object,Object> tableColumn = new TreeTableColumn<>();
+        TextFieldTreeTableCell<Object,Object> cell = (TextFieldTreeTableCell<Object,Object>)cellFactory.call(tableColumn);
+        assertNotNull(cell);
+    }
+
+    @Test public void testStatic_forTreeTableColumn_converter_ensureCellHasSetStringConverter() {
+        Callback<TreeTableColumn<Object,Object>, TreeTableCell<Object,Object>> cellFactory = TextFieldTreeTableCell.forTreeTableColumn(converter);
+
+        TreeTableColumn<Object,Object> tableColumn = new TreeTableColumn<>();
+        TextFieldTreeTableCell<Object,Object> cell = (TextFieldTreeTableCell<Object,Object>)cellFactory.call(tableColumn);
+        assertNotNull(cell.getConverter());
+        assertEquals(converter, cell.getConverter());
+    }
+
+
+
+    /**************************************************************************
+     *
+     * Constructor tests for default constructor
+     *
+     **************************************************************************/
+
+    @Test public void testConstructor_noArgs_defaultStringConverterIsNull() {
+        TextFieldTreeTableCell<?,Object> cell = new TextFieldTreeTableCell<>();
+        assertNull(cell.getConverter());
+    }
+
+    @Test public void testConstructor_noArgs_defaultStyleClass() {
+        TextFieldTreeTableCell<?,Object> cell = new TextFieldTreeTableCell<>();
+        assertTrue(cell.getStyleClass().contains("text-field-tree-table-cell"));
+    }
+
+    @Test public void testConstructor_noArgs_defaultGraphicIsNull() {
+        TextFieldTreeTableCell<?,Object> cell = new TextFieldTreeTableCell<>();
+        assertNull(cell.getGraphic());
+    }
+
+
+    /**************************************************************************
+     *
+     * Constructor tests for one-arg constructor
+     *
+     **************************************************************************/
+
+    @Test public void testConstructor_converter_defaultStringConverterIsNotNull() {
+        TextFieldTreeTableCell<?,Object> cell = new TextFieldTreeTableCell<>(converter);
+        assertNotNull(cell.getConverter());
+    }
+
+    @Test public void testConstructor_converter_defaultStyleClass() {
+        TextFieldTreeTableCell<?,Object> cell = new TextFieldTreeTableCell<>(converter);
+        assertTrue(cell.getStyleClass().contains("text-field-tree-table-cell"));
+    }
+
+    @Test public void testConstructor_converter_defaultGraphicIsACheckBox() {
+        TextFieldTreeTableCell<?,Object> cell = new TextFieldTreeTableCell<>(converter);
+        assertNull(cell.getGraphic());
+    }
+
+
+    /**************************************************************************
+     *
+     * updateItem tests
+     *
+     **************************************************************************/
+
+    @Test public void test_updateItem_isEmpty_graphicIsNull() {
+        TextFieldTreeTableCell<?,Object> cell = new TextFieldTreeTableCell<>();
+        cell.updateItem("TEST", true);
+        assertNull(cell.getGraphic());
+    }
+
+    @Test public void test_updateItem_isEmpty_textIsNull() {
+        TextFieldTreeTableCell<?,Object> cell = new TextFieldTreeTableCell<>();
+        cell.updateItem("TEST", true);
+        assertNull(cell.getText());
+    }
+
+    @Test public void test_updateItem_isNotEmpty_textIsNotNull() {
+        TextFieldTreeTableCell<?,Object> cell = new TextFieldTreeTableCell<>();
+        cell.updateItem("TEST", false);
+        assertNotNull(cell.getText());
+        assertEquals("TEST", cell.getText());
+    }
+
+    @Test public void test_updateItem_isNotEmpty_textIsNotNull_nullConverter() {
+        TextFieldTreeTableCell<?,Object> cell = new TextFieldTreeTableCell<>();
+        cell.setConverter(null);
+        cell.updateItem("TEST", false);
+        assertNotNull(cell.getText());
+        assertEquals("TEST", cell.getText());
+    }
+
+    @Test public void test_updateItem_isNotEmpty_textIsNotNull_nonNullConverter() {
+        TextFieldTreeTableCell<?,Object> cell = new TextFieldTreeTableCell<>();
+        cell.setConverter(
+                new StringConverter<Object>() {
+                    @Override public Object fromString(String string) {
+                        return null;
+                    }
+
+                    @Override public String toString(Object object) {
+                        return "CONVERTED";
+                    }
+                });
+        cell.updateItem("TEST", false);
+        assertNotNull(cell.getText());
+        assertEquals("CONVERTED", cell.getText());
+    }
+
+
+//    /**************************************************************************
+//     *
+//     * editing tests
+//     *
+//     **************************************************************************/
+//
+//    // --- is Empty
+//    @Test public void test_startEdit_cellEditableIsFalse_isEmpty() {
+//        TextFieldTreeTableCell<Object,Object> cell = new TextFieldTreeTableCell<>();
+//        cell.setEditable(false);
+//        cell.startEdit();
+//        assertFalse(cell.isEditing());
+//        assertNull(cell.getGraphic());
+//    }
+//
+//    @Test public void test_startEdit_tableColumnEditableIsFalse_isEmpty() {
+//        TreeItem root = new TreeItem("Root");
+//        TreeTableView treeView = new TreeTableView(root);
+//
+//        TreeTableColumn<Object,Object> tableColumn = new TreeTableColumn<>();
+//        tableColumn.setEditable(false);
+//        TextFieldTreeTableCell<Object,Object> cell = new TextFieldTreeTableCell<>();
+//        cell.updateTreeTableColumn(tableColumn);
+//        cell.updateTreeTableView(treeView);
+//
+//        cell.startEdit();
+//        assertFalse(cell.isEditing());
+//        assertNull(cell.getGraphic());
+//    }
+//
+//    @Test(expected = NullPointerException.class)
+//    public void test_startEdit_cellEditableIsTrue_tableColumnIsNull_isEmpty() {
+//        TextFieldTreeTableCell<Object,Object> cell = new TextFieldTreeTableCell<>();
+//        cell.setEditable(true);
+//        cell.startEdit();
+//    }
+//
+//    @Test public void test_startEdit_tableColumnEditableIsTrue_isEmpty() {
+//        TreeTableColumn<Object,Object> tableColumn = new TreeTableColumn<>();
+//        tableColumn.setEditable(true);
+//        TextFieldTreeTableCell<Object,Object> cell = new TextFieldTreeTableCell<>();
+//        cell.updateTreeTableColumn(tableColumn);
+//
+//        cell.startEdit();
+//        assertFalse(cell.isEditing());
+//        assertNull(cell.getGraphic());
+//    }
+//
+//    @Test public void test_startEdit_tableColumnEditableIsTrue_cellEditableIsTrue_isEmpty() {
+//        TreeTableColumn<Object,Object> tableColumn = new TreeTableColumn<>();
+//        tableColumn.setEditable(true);
+//        TextFieldTreeTableCell<Object,Object> cell = new TextFieldTreeTableCell<>();
+//        cell.setEditable(true);
+//        cell.updateTreeTableColumn(tableColumn);
+//
+//        cell.startEdit();
+//        assertFalse(cell.isEditing());
+//        assertNull(cell.getGraphic());
+//    }
+//
+//    // --- is Not Empty
+//    @Test public void test_startEdit_cellEditableIsFalse_isNotEmpty() {
+//        TextFieldTreeTableCell<Object,Object> cell = new TextFieldTreeTableCell<>();
+//        cell.updateItem("TEST", false);
+//        cell.setEditable(false);
+//        cell.startEdit();
+//        assertFalse(cell.isEditing());
+//        assertNull(cell.getGraphic());
+//    }
+//
+//    @Test public void test_startEdit_tableColumnEditableIsFalse_isNotEmpty() {
+//        TreeItem root = new TreeItem("Root");
+//        TreeTableView treeView = new TreeTableView(root);
+//
+//        TreeTableColumn<Object,Object> tableColumn = new TreeTableColumn<>();
+//        tableColumn.setEditable(false);
+//        TextFieldTreeTableCell<Object,Object> cell = new TextFieldTreeTableCell<>();
+//        cell.updateTreeTableView(treeView);
+//        cell.updateTreeTableColumn(tableColumn);
+//        cell.updateItem("TEST", false);
+//
+//        cell.startEdit();
+//        assertFalse(cell.isEditing());
+//        assertNull(cell.getGraphic());
+//    }
+//
+//    @Test(expected = NullPointerException.class)
+//    public void test_startEdit_cellEditableIsTrue_tableColumnIsNull_isNotEmpty() {
+//        TextFieldTreeTableCell<Object,Object> cell = new TextFieldTreeTableCell<>();
+//        cell.updateItem("TEST", false);
+//        cell.setEditable(true);
+//        cell.startEdit();
+//    }
+//
+//    @Test public void test_startEdit_treeViewEditableIsTrue_isNotEmpty() {
+//        TreeItem root = new TreeItem("Root");
+//        TreeTableView treeView = new TreeTableView(root);
+//        treeView.setEditable(true);
+//        TextFieldTreeTableCell<Object,Object> cell = new TextFieldTreeTableCell<>();
+//        cell.updateTreeTableView(treeView);
+//        cell.updateIndex(0);
+//
+//        cell.startEdit();
+//        assertTrue(cell.isEditing());
+//        assertNotNull(cell.getGraphic());
+//    }
+//
+//    @Test public void test_startEdit_treeViewEditableIsTrue_cellEditableIsTrue_isNotEmpty() {
+//        TreeItem root = new TreeItem("Root");
+//        TreeTableView treeView = new TreeTableView(root);
+//        treeView.setEditable(true);
+//        TextFieldTreeTableCell<Object,Object> cell = new TextFieldTreeTableCell<>();
+//        cell.updateTreeTableView(treeView);
+//        cell.setEditable(true);
+//        cell.updateIndex(0);
+//
+//        cell.startEdit();
+//        assertTrue(cell.isEditing());
+//        assertNotNull(cell.getGraphic());
+//    }
+//
+//    // --- cancel edit
+//    @Test public void test_cancelEdit() {
+//        TreeItem root = new TreeItem("Root");
+//        TreeTableView treeView = new TreeTableView(root);
+//        treeView.setEditable(true);
+//        TreeTableColumn col = new TreeTableColumn();
+//        TextFieldTreeTableCell<Object,Object> cell = new TextFieldTreeTableCell<>();
+//        cell.updateTreeTableView(treeView);
+//        cell.updateTreeTableColumn(col);
+//        cell.updateIndex(0);
+//
+//        cell.startEdit();
+//        assertTrue(cell.isEditing());
+//        assertNotNull(cell.getGraphic());
+//
+//        cell.cancelEdit();
+//        assertFalse(cell.isEditing());
+//        assertNull(cell.getGraphic());
+//    }
+}