changeset 6860:47fb67cb113f

RT-36715: TableColumn setId doesn't appear to work
author jgiles
date Wed, 23 Apr 2014 12:06:19 +1200
parents bb19e2b54285
children e391dce8d6d7
files modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TableColumnHeader.java modules/controls/src/main/java/javafx/scene/control/TableCell.java modules/controls/src/main/java/javafx/scene/control/TableColumnBase.java modules/controls/src/main/java/javafx/scene/control/TreeTableCell.java modules/controls/src/test/java/com/sun/javafx/scene/control/infrastructure/VirtualFlowTestUtils.java modules/controls/src/test/java/javafx/scene/control/TableCellTest.java modules/controls/src/test/java/javafx/scene/control/TableColumnTest.java modules/controls/src/test/java/javafx/scene/control/TreeTableCellTest.java modules/controls/src/test/java/javafx/scene/control/TreeTableColumnTest.java
diffstat 9 files changed, 452 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TableColumnHeader.java	Wed Apr 23 09:46:32 2014 +1200
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TableColumnHeader.java	Wed Apr 23 12:06:19 2014 +1200
@@ -165,6 +165,9 @@
             changeListenerHandler.registerChangeListener(column.graphicProperty(), "TABLE_COLUMN_GRAPHIC");
 
             column.getStyleClass().addListener(weakStyleClassListener);
+
+            setId(column.getId());
+            setStyle(column.getStyle());
             updateStyleClass();
         }
     }
--- a/modules/controls/src/main/java/javafx/scene/control/TableCell.java	Wed Apr 23 09:46:32 2014 +1200
+++ b/modules/controls/src/main/java/javafx/scene/control/TableCell.java	Wed Apr 23 12:06:19 2014 +1200
@@ -153,6 +153,18 @@
             }
         }
     };
+
+    private final InvalidationListener columnStyleListener = value -> {
+        if (getTableColumn() != null) {
+            possiblySetStyle(getTableColumn().getStyle());
+        }
+    };
+
+    private final InvalidationListener columnIdListener = value -> {
+        if (getTableColumn() != null) {
+            possiblySetId(getTableColumn().getId());
+        }
+    };
     
     private final WeakListChangeListener<TablePosition> weakSelectedListener =
             new WeakListChangeListener<>(selectedListener);
@@ -162,6 +174,10 @@
             new WeakInvalidationListener(tableRowUpdateObserver);
     private final WeakInvalidationListener weakEditingListener = 
             new WeakInvalidationListener(editingListener);
+    private final WeakInvalidationListener weakColumnStyleListener =
+            new WeakInvalidationListener(columnStyleListener);
+    private final WeakInvalidationListener weakColumnIdListener =
+            new WeakInvalidationListener(columnIdListener);
     private final WeakListChangeListener<TableColumn<S,?>> weakVisibleLeafColumnsListener =
             new WeakListChangeListener<>(visibleLeafColumnsListener);
     private final WeakListChangeListener<String> weakColumnStyleClassListener =
@@ -694,6 +710,18 @@
         if (oldCol != null) {
             oldCol.getStyleClass().removeListener(weakColumnStyleClassListener);
             getStyleClass().removeAll(oldCol.getStyleClass());
+
+            oldCol.idProperty().removeListener(weakColumnIdListener);
+            oldCol.styleProperty().removeListener(weakColumnStyleListener);
+
+            String id = getId();
+            String style = getStyle();
+            if (id != null && id.equals(oldCol.getId())) {
+                setId(null);
+            }
+            if (style != null && style.equals(oldCol.getStyle())) {
+                setStyle("");
+            }
         }
         
         setTableColumn(col);
@@ -701,6 +729,12 @@
         if (col != null) {
             getStyleClass().addAll(col.getStyleClass());
             col.getStyleClass().addListener(weakColumnStyleClassListener);
+
+            col.idProperty().addListener(weakColumnIdListener);
+            col.styleProperty().addListener(weakColumnStyleListener);
+
+            possiblySetId(col.getId());
+            possiblySetStyle(col.getStyle());
         }
     }
 
@@ -716,6 +750,18 @@
     private static final PseudoClass PSEUDO_CLASS_LAST_VISIBLE = 
             PseudoClass.getPseudoClass("last-visible");
 
+    private void possiblySetId(String idCandidate) {
+        if (getId() == null || getId().isEmpty()) {
+            setId(idCandidate);
+        }
+    }
+
+    private void possiblySetStyle(String styleCandidate) {
+        if (getStyle() == null || getStyle().isEmpty()) {
+            setStyle(styleCandidate);
+        }
+    }
+
 
 
     /***************************************************************************
--- a/modules/controls/src/main/java/javafx/scene/control/TableColumnBase.java	Wed Apr 23 09:46:32 2014 +1200
+++ b/modules/controls/src/main/java/javafx/scene/control/TableColumnBase.java	Wed Apr 23 12:06:19 2014 +1200
@@ -269,6 +269,8 @@
      * The id of this TableColumnBase. This simple string identifier is useful 
      * for finding a specific TableColumnBase within a UI control that uses 
      * TableColumnBase instances. The default value is {@code null}.
+     *
+     * @defaultValue null
      */
     private StringProperty id;
     public final void setId(String value) { idProperty().set(value); }
@@ -291,10 +293,12 @@
      * <p>
      * Parsing this style might not be supported on some limited
      * platforms. It is recommended to use a standalone CSS file instead.
+     *
+     * @defaultValue empty string
      */
     private StringProperty style;
     public final void setStyle(String value) { styleProperty().set(value); }
-    @Override public final String getStyle() { return style == null ? null : style.get(); }
+    @Override public final String getStyle() { return style == null ? "" : style.get(); }
     public final StringProperty styleProperty() {
         if (style == null) {
             style = new SimpleStringProperty(this, "style");
--- a/modules/controls/src/main/java/javafx/scene/control/TreeTableCell.java	Wed Apr 23 09:46:32 2014 +1200
+++ b/modules/controls/src/main/java/javafx/scene/control/TreeTableCell.java	Wed Apr 23 12:06:19 2014 +1200
@@ -154,7 +154,19 @@
     private final InvalidationListener rootPropertyListener = observable -> {
         updateItem(-1);
     };
-    
+
+    private final InvalidationListener columnStyleListener = value -> {
+        if (getTableColumn() != null) {
+            possiblySetStyle(getTableColumn().getStyle());
+        }
+    };
+
+    private final InvalidationListener columnIdListener = value -> {
+        if (getTableColumn() != null) {
+            possiblySetId(getTableColumn().getId());
+        }
+    };
+
     private final WeakListChangeListener<TreeTablePosition<S,?>> weakSelectedListener = 
             new WeakListChangeListener<TreeTablePosition<S,?>>(selectedListener);
     private final WeakInvalidationListener weakFocusedListener = 
@@ -167,6 +179,10 @@
             new WeakListChangeListener<TreeTableColumn<S,?>>(visibleLeafColumnsListener);
     private final WeakListChangeListener<String> weakColumnStyleClassListener =
             new WeakListChangeListener<String>(columnStyleClassListener);
+    private final WeakInvalidationListener weakColumnStyleListener =
+            new WeakInvalidationListener(columnStyleListener);
+    private final WeakInvalidationListener weakColumnIdListener =
+            new WeakInvalidationListener(columnIdListener);
     private final WeakInvalidationListener weakRootPropertyListener =
             new WeakInvalidationListener(rootPropertyListener);
 
@@ -687,13 +703,31 @@
         if (oldCol != null) {
             oldCol.getStyleClass().removeListener(weakColumnStyleClassListener);
             getStyleClass().removeAll(oldCol.getStyleClass());
+
+            oldCol.idProperty().removeListener(weakColumnIdListener);
+            oldCol.styleProperty().removeListener(weakColumnStyleListener);
+
+            String id = getId();
+            String style = getStyle();
+            if (id != null && id.equals(oldCol.getId())) {
+                setId(null);
+            }
+            if (style != null && style.equals(oldCol.getStyle())) {
+                setStyle("");
+            }
         }
-        
+
         setTableColumn(col);
-        
+
         if (col != null) {
             getStyleClass().addAll(col.getStyleClass());
             col.getStyleClass().addListener(weakColumnStyleClassListener);
+
+            col.idProperty().addListener(weakColumnIdListener);
+            col.styleProperty().addListener(weakColumnStyleListener);
+
+            possiblySetId(col.getId());
+            possiblySetStyle(col.getStyle());
         }
     }
 
@@ -714,6 +748,18 @@
         return new TreeTableCellSkin<S,T>(this);
     }
 
+    private void possiblySetId(String idCandidate) {
+        if (getId() == null || getId().isEmpty()) {
+            setId(idCandidate);
+        }
+    }
+
+    private void possiblySetStyle(String styleCandidate) {
+        if (getStyle() == null || getStyle().isEmpty()) {
+            setStyle(styleCandidate);
+        }
+    }
+
 
     /***************************************************************************
      *                                                                         *
--- a/modules/controls/src/test/java/com/sun/javafx/scene/control/infrastructure/VirtualFlowTestUtils.java	Wed Apr 23 09:46:32 2014 +1200
+++ b/modules/controls/src/test/java/com/sun/javafx/scene/control/infrastructure/VirtualFlowTestUtils.java	Wed Apr 23 12:06:19 2014 +1200
@@ -392,7 +392,7 @@
         return scrollBar;
     }
 
-    public static TableColumnHeader getTableColumnHeader(Control table, TableColumn<?,?> column) {
+    public static TableColumnHeader getTableColumnHeader(Control table, TableColumnBase<?,?> column) {
         TableHeaderRow headerRow = VirtualFlowTestUtils.getTableHeaderRow(table);
         return findColumnHeader(headerRow.getRootHeader(), column);
     }
--- a/modules/controls/src/test/java/javafx/scene/control/TableCellTest.java	Wed Apr 23 09:46:32 2014 +1200
+++ b/modules/controls/src/test/java/javafx/scene/control/TableCellTest.java	Wed Apr 23 12:06:19 2014 +1200
@@ -25,18 +25,17 @@
 
 package javafx.scene.control;
 
-import javafx.beans.property.ReadOnlyObjectWrapper;
-import javafx.beans.value.ObservableValue;
+import com.sun.javafx.scene.control.infrastructure.StageLoader;
+import com.sun.javafx.scene.control.infrastructure.VirtualFlowTestUtils;
 import javafx.collections.FXCollections;
 import javafx.collections.ObservableList;
-import javafx.util.Callback;
 
-import com.sun.javafx.tk.Toolkit;
 import org.junit.Before;
 import org.junit.Test;
 
 import static com.sun.javafx.scene.control.infrastructure.ControlTestUtils.assertStyleClassContains;
 import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
 
 /**
  */
@@ -194,4 +193,107 @@
         table.setItems(null);
         cell.updateIndex(1);
     }
+
+    @Test public void test_rt36715_idIsNullAtStartup() {
+        assertNull(cell.getId());
+    }
+
+    @Test public void test_rt36715_idIsSettable() {
+        cell.setId("test-id");
+        assertEquals("test-id", cell.getId());
+    }
+
+    @Test public void test_rt36715_columnHeaderIdMirrorsTableColumnId_setIdBeforeHeaderInstantiation() {
+        test_rt36715_cellPropertiesMirrorTableColumnProperties(true, true, false, false, false);
+    }
+
+    @Test public void test_rt36715_columnHeaderIdMirrorsTableColumnId_setIdAfterHeaderInstantiation() {
+        test_rt36715_cellPropertiesMirrorTableColumnProperties(true, false, false, false, false);
+    }
+
+    @Test public void test_rt36715_columnHeaderIdMirrorsTableColumnId_setIdBeforeHeaderInstantiation_setValueOnCell() {
+        test_rt36715_cellPropertiesMirrorTableColumnProperties(true, true, false, false, true);
+    }
+
+    @Test public void test_rt36715_columnHeaderIdMirrorsTableColumnId_setIdAfterHeaderInstantiation_setValueOnCell() {
+        test_rt36715_cellPropertiesMirrorTableColumnProperties(true, false, false, false, true);
+    }
+
+    @Test public void test_rt36715_styleIsEmptyStringAtStartup() {
+        assertEquals("", cell.getStyle());
+    }
+
+    @Test public void test_rt36715_styleIsSettable() {
+        cell.setStyle("-fx-border-color: red");
+        assertEquals("-fx-border-color: red", cell.getStyle());
+    }
+
+    @Test public void test_rt36715_columnHeaderStyleMirrorsTableColumnStyle_setStyleBeforeHeaderInstantiation() {
+        test_rt36715_cellPropertiesMirrorTableColumnProperties(false, false, true, true, false);
+    }
+
+    @Test public void test_rt36715_columnHeaderStyleMirrorsTableColumnStyle_setStyleAfterHeaderInstantiation() {
+        test_rt36715_cellPropertiesMirrorTableColumnProperties(false, false, true, false, false);
+    }
+
+    @Test public void test_rt36715_columnHeaderStyleMirrorsTableColumnStyle_setStyleBeforeHeaderInstantiation_setValueOnCell() {
+        test_rt36715_cellPropertiesMirrorTableColumnProperties(false, false, true, true, true);
+    }
+
+    @Test public void test_rt36715_columnHeaderStyleMirrorsTableColumnStyle_setStyleAfterHeaderInstantiation_setValueOnCell() {
+        test_rt36715_cellPropertiesMirrorTableColumnProperties(false, false, true, false, true);
+    }
+
+    private void test_rt36715_cellPropertiesMirrorTableColumnProperties(
+            boolean setId, boolean setIdBeforeHeaderInstantiation,
+            boolean setStyle, boolean setStyleBeforeHeaderInstantiation,
+            boolean setValueOnCell) {
+
+        TableColumn column = new TableColumn("Column");
+        table.getColumns().add(column);
+
+        if (setId && setIdBeforeHeaderInstantiation) {
+            column.setId("test-id");
+        }
+        if (setStyle && setStyleBeforeHeaderInstantiation) {
+            column.setStyle("-fx-border-color: red");
+        }
+
+        StageLoader sl = new StageLoader(table);
+        TableCell cell = (TableCell) VirtualFlowTestUtils.getCell(table, 0, 0);
+
+        // the default value takes precedence over the value set in the TableColumn
+        if (setValueOnCell) {
+            if (setId) {
+                cell.setId("cell-id");
+            }
+            if (setStyle) {
+                cell.setStyle("-fx-border-color: green");
+            }
+        }
+
+        if (setId && ! setIdBeforeHeaderInstantiation) {
+            column.setId("test-id");
+        }
+        if (setStyle && ! setStyleBeforeHeaderInstantiation) {
+            column.setStyle("-fx-border-color: red");
+        }
+
+        if (setId) {
+            if (setValueOnCell) {
+                assertEquals("cell-id", cell.getId());
+            } else {
+                assertEquals("test-id", cell.getId());
+            }
+        }
+        if (setStyle) {
+            if (setValueOnCell) {
+                assertEquals("-fx-border-color: green", cell.getStyle());
+            } else {
+                assertEquals("-fx-border-color: red", cell.getStyle());
+            }
+        }
+
+        sl.dispose();
+    }
 }
--- a/modules/controls/src/test/java/javafx/scene/control/TableColumnTest.java	Wed Apr 23 09:46:32 2014 +1200
+++ b/modules/controls/src/test/java/javafx/scene/control/TableColumnTest.java	Wed Apr 23 12:06:19 2014 +1200
@@ -25,6 +25,9 @@
 
 package javafx.scene.control;
 
+import com.sun.javafx.scene.control.infrastructure.StageLoader;
+import com.sun.javafx.scene.control.infrastructure.VirtualFlowTestUtils;
+import com.sun.javafx.scene.control.skin.TableColumnHeader;
 import javafx.beans.property.BooleanProperty;
 import javafx.beans.property.DoubleProperty;
 import javafx.beans.property.IntegerProperty;
@@ -1223,4 +1226,70 @@
 
     public interface CellFactory<S,T> extends Callback<TableColumn<S,T>, TableCell<S,T>> {
     }
+
+    @Test public void test_rt36715_idIsNullAtStartup() {
+        assertNull(column.getId());
+    }
+
+    @Test public void test_rt36715_idIsSettable() {
+        column.setId("test-id");
+        assertEquals("test-id", column.getId());
+    }
+
+    @Test public void test_rt36715_columnHeaderIdMirrorsTableColumnId_setIdBeforeHeaderInstantiation() {
+        test_rt36715_columnHeaderPropertiesMirrorTableColumnProperties(true, true, false, false);
+    }
+
+    @Test public void test_rt36715_columnHeaderIdMirrorsTableColumnId_setIdAfterHeaderInstantiation() {
+        test_rt36715_columnHeaderPropertiesMirrorTableColumnProperties(true, false, false, false);
+    }
+
+    @Test public void test_rt36715_styleIsEmptyStringAtStartup() {
+        assertEquals("", column.getStyle());
+    }
+
+    @Test public void test_rt36715_styleIsSettable() {
+        column.setStyle("-fx-border-color: red");
+        assertEquals("-fx-border-color: red", column.getStyle());
+    }
+
+    @Test public void test_rt36715_columnHeaderStyleMirrorsTableColumnStyle_setStyleBeforeHeaderInstantiation() {
+        test_rt36715_columnHeaderPropertiesMirrorTableColumnProperties(false, false, true, true);
+    }
+
+    @Test public void test_rt36715_columnHeaderStyleMirrorsTableColumnStyle_setStyleAfterHeaderInstantiation() {
+        test_rt36715_columnHeaderPropertiesMirrorTableColumnProperties(false, false, true, false);
+    }
+
+    private void test_rt36715_columnHeaderPropertiesMirrorTableColumnProperties(
+            boolean setId, boolean setIdBeforeHeaderInstantiation,
+            boolean setStyle, boolean setStyleBeforeHeaderInstantiation) {
+        table.getColumns().add(column);
+
+        if (setId && setIdBeforeHeaderInstantiation) {
+            column.setId("test-id");
+        }
+        if (setStyle && setStyleBeforeHeaderInstantiation) {
+            column.setStyle("-fx-border-color: red");
+        }
+
+        StageLoader sl = new StageLoader(table);
+        TableColumnHeader header = VirtualFlowTestUtils.getTableColumnHeader(table, column);
+
+        if (setId && ! setIdBeforeHeaderInstantiation) {
+            column.setId("test-id");
+        }
+        if (setStyle && ! setStyleBeforeHeaderInstantiation) {
+            column.setStyle("-fx-border-color: red");
+        }
+
+        if (setId) {
+            assertEquals("test-id", header.getId());
+        }
+        if (setStyle) {
+            assertEquals("-fx-border-color: red", header.getStyle());
+        }
+
+        sl.dispose();
+    }
 }
--- a/modules/controls/src/test/java/javafx/scene/control/TreeTableCellTest.java	Wed Apr 23 09:46:32 2014 +1200
+++ b/modules/controls/src/test/java/javafx/scene/control/TreeTableCellTest.java	Wed Apr 23 12:06:19 2014 +1200
@@ -25,6 +25,8 @@
 
 package javafx.scene.control;
 
+import com.sun.javafx.scene.control.infrastructure.StageLoader;
+import com.sun.javafx.scene.control.infrastructure.VirtualFlowTestUtils;
 import javafx.beans.InvalidationListener;
 import javafx.beans.value.ObservableValue;
 import javafx.collections.ListChangeListener;
@@ -504,4 +506,107 @@
         tree.setRoot(null);
         cell.updateIndex(1);
     }
+
+    @Test public void test_rt36715_idIsNullAtStartup() {
+        assertNull(cell.getId());
+    }
+
+    @Test public void test_rt36715_idIsSettable() {
+        cell.setId("test-id");
+        assertEquals("test-id", cell.getId());
+    }
+
+    @Test public void test_rt36715_columnHeaderIdMirrorsTableColumnId_setIdBeforeHeaderInstantiation() {
+        test_rt36715_cellPropertiesMirrorTableColumnProperties(true, true, false, false, false);
+    }
+
+    @Test public void test_rt36715_columnHeaderIdMirrorsTableColumnId_setIdAfterHeaderInstantiation() {
+        test_rt36715_cellPropertiesMirrorTableColumnProperties(true, false, false, false, false);
+    }
+
+    @Test public void test_rt36715_columnHeaderIdMirrorsTableColumnId_setIdBeforeHeaderInstantiation_setValueOnCell() {
+        test_rt36715_cellPropertiesMirrorTableColumnProperties(true, true, false, false, true);
+    }
+
+    @Test public void test_rt36715_columnHeaderIdMirrorsTableColumnId_setIdAfterHeaderInstantiation_setValueOnCell() {
+        test_rt36715_cellPropertiesMirrorTableColumnProperties(true, false, false, false, true);
+    }
+
+    @Test public void test_rt36715_styleIsEmptyStringAtStartup() {
+        assertEquals("", cell.getStyle());
+    }
+
+    @Test public void test_rt36715_styleIsSettable() {
+        cell.setStyle("-fx-border-color: red");
+        assertEquals("-fx-border-color: red", cell.getStyle());
+    }
+
+    @Test public void test_rt36715_columnHeaderStyleMirrorsTableColumnStyle_setStyleBeforeHeaderInstantiation() {
+        test_rt36715_cellPropertiesMirrorTableColumnProperties(false, false, true, true, false);
+    }
+
+    @Test public void test_rt36715_columnHeaderStyleMirrorsTableColumnStyle_setStyleAfterHeaderInstantiation() {
+        test_rt36715_cellPropertiesMirrorTableColumnProperties(false, false, true, false, false);
+    }
+
+    @Test public void test_rt36715_columnHeaderStyleMirrorsTableColumnStyle_setStyleBeforeHeaderInstantiation_setValueOnCell() {
+        test_rt36715_cellPropertiesMirrorTableColumnProperties(false, false, true, true, true);
+    }
+
+    @Test public void test_rt36715_columnHeaderStyleMirrorsTableColumnStyle_setStyleAfterHeaderInstantiation_setValueOnCell() {
+        test_rt36715_cellPropertiesMirrorTableColumnProperties(false, false, true, false, true);
+    }
+
+    private void test_rt36715_cellPropertiesMirrorTableColumnProperties(
+            boolean setId, boolean setIdBeforeHeaderInstantiation,
+            boolean setStyle, boolean setStyleBeforeHeaderInstantiation,
+            boolean setValueOnCell) {
+
+        TreeTableColumn column = new TreeTableColumn("Column");
+        tree.getColumns().add(column);
+
+        if (setId && setIdBeforeHeaderInstantiation) {
+            column.setId("test-id");
+        }
+        if (setStyle && setStyleBeforeHeaderInstantiation) {
+            column.setStyle("-fx-border-color: red");
+        }
+
+        StageLoader sl = new StageLoader(tree);
+        TreeTableCell cell = (TreeTableCell) VirtualFlowTestUtils.getCell(tree, 0, 0);
+
+        // the default value takes precedence over the value set in the TableColumn
+        if (setValueOnCell) {
+            if (setId) {
+                cell.setId("cell-id");
+            }
+            if (setStyle) {
+                cell.setStyle("-fx-border-color: green");
+            }
+        }
+
+        if (setId && ! setIdBeforeHeaderInstantiation) {
+            column.setId("test-id");
+        }
+        if (setStyle && ! setStyleBeforeHeaderInstantiation) {
+            column.setStyle("-fx-border-color: red");
+        }
+
+        if (setId) {
+            if (setValueOnCell) {
+                assertEquals("cell-id", cell.getId());
+            } else {
+                assertEquals("test-id", cell.getId());
+            }
+        }
+        if (setStyle) {
+            if (setValueOnCell) {
+                assertEquals("-fx-border-color: green", cell.getStyle());
+            } else {
+                assertEquals("-fx-border-color: red", cell.getStyle());
+            }
+        }
+
+        sl.dispose();
+    }
 }
--- a/modules/controls/src/test/java/javafx/scene/control/TreeTableColumnTest.java	Wed Apr 23 09:46:32 2014 +1200
+++ b/modules/controls/src/test/java/javafx/scene/control/TreeTableColumnTest.java	Wed Apr 23 12:06:19 2014 +1200
@@ -25,7 +25,9 @@
 
 package javafx.scene.control;
 
+import com.sun.javafx.scene.control.infrastructure.StageLoader;
 import com.sun.javafx.scene.control.infrastructure.VirtualFlowTestUtils;
+import com.sun.javafx.scene.control.skin.TableColumnHeader;
 import com.sun.javafx.scene.control.skin.TableViewSkin;
 import com.sun.javafx.scene.control.skin.TreeTableViewSkin;
 import com.sun.javafx.scene.control.skin.VirtualFlow;
@@ -62,6 +64,7 @@
 import org.junit.Test;
 
 import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
 
 /**
  */
@@ -1241,6 +1244,71 @@
         assertNull(cell.getText());
     }
 
+    @Test public void test_rt36715_idIsNullAtStartup() {
+        assertNull(column.getId());
+    }
+
+    @Test public void test_rt36715_idIsSettable() {
+        column.setId("test-id");
+        assertEquals("test-id", column.getId());
+    }
+
+    @Test public void test_rt36715_columnHeaderIdMirrorsTableColumnId_setIdBeforeHeaderInstantiation() {
+        test_rt36715_columnHeaderPropertiesMirrorTableColumnProperties(true, true, false, false);
+    }
+
+    @Test public void test_rt36715_columnHeaderIdMirrorsTableColumnId_setIdAfterHeaderInstantiation() {
+        test_rt36715_columnHeaderPropertiesMirrorTableColumnProperties(true, false, false, false);
+    }
+
+    @Test public void test_rt36715_styleIsEmptyStringAtStartup() {
+        assertEquals("", column.getStyle());
+    }
+
+    @Test public void test_rt36715_styleIsSettable() {
+        column.setStyle("-fx-border-color: red");
+        assertEquals("-fx-border-color: red", column.getStyle());
+    }
+
+    @Test public void test_rt36715_columnHeaderStyleMirrorsTableColumnStyle_setStyleBeforeHeaderInstantiation() {
+        test_rt36715_columnHeaderPropertiesMirrorTableColumnProperties(false, false, true, true);
+    }
+
+    @Test public void test_rt36715_columnHeaderStyleMirrorsTableColumnStyle_setStyleAfterHeaderInstantiation() {
+        test_rt36715_columnHeaderPropertiesMirrorTableColumnProperties(false, false, true, false);
+    }
+
+    private void test_rt36715_columnHeaderPropertiesMirrorTableColumnProperties(
+            boolean setId, boolean setIdBeforeHeaderInstantiation,
+            boolean setStyle, boolean setStyleBeforeHeaderInstantiation) {
+        table.getColumns().add(column);
+
+        if (setId && setIdBeforeHeaderInstantiation) {
+            column.setId("test-id");
+        }
+        if (setStyle && setStyleBeforeHeaderInstantiation) {
+            column.setStyle("-fx-border-color: red");
+        }
+
+        StageLoader sl = new StageLoader(table);
+        TableColumnHeader header = VirtualFlowTestUtils.getTableColumnHeader(table, column);
+
+        if (setId && ! setIdBeforeHeaderInstantiation) {
+            column.setId("test-id");
+        }
+        if (setStyle && ! setStyleBeforeHeaderInstantiation) {
+            column.setStyle("-fx-border-color: red");
+        }
+
+        if (setId) {
+            assertEquals("test-id", header.getId());
+        }
+        if (setStyle) {
+            assertEquals("-fx-border-color: red", header.getStyle());
+        }
+
+        sl.dispose();
+    }