changeset 4216:31136be6a98a

Automated merge with ssh://jfxsrc.us.oracle.com//javafx/8.0/scrum/controls/jfx/rt
author jgiles
date Tue, 09 Jul 2013 11:02:44 +1200
parents c6e4266aed9b 3ff782c8ad7b
children 7e373b49ebaa 228646313e30
files
diffstat 7 files changed, 34 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/behavior/TableCellBehavior.java	Wed Jul 03 10:09:32 2013 -0400
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/behavior/TableCellBehavior.java	Tue Jul 09 11:02:44 2013 +1200
@@ -97,7 +97,7 @@
 
     /** @{@inheritDoc} */
     @Override protected int getVisibleLeafIndex(TableColumnBase tc) {
-        return getTableControl().getVisibleLeafIndex(null);
+        return getTableControl().getVisibleLeafIndex((TableColumn) tc);
     }
 
     /** @{@inheritDoc} */
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TableColumnHeader.java	Wed Jul 03 10:09:32 2013 -0400
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TableColumnHeader.java	Tue Jul 09 11:02:44 2013 +1200
@@ -421,7 +421,6 @@
 
         // --- label
         label = new Label();
-        label.setAlignment(Pos.CENTER);
         label.setText(column.getText());
         label.setGraphic(column.getGraphic());
         label.setVisible(column.isVisible());
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/VirtualContainerBase.java	Wed Jul 03 10:09:32 2013 -0400
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/VirtualContainerBase.java	Tue Jul 09 11:02:44 2013 +1200
@@ -46,7 +46,7 @@
 
     public VirtualContainerBase(final C control, B behavior) {
         super(control, behavior);
-        flow = new VirtualFlow<I>();
+        flow = createVirtualFlow();
         
         control.addEventHandler(ScrollToEvent.scrollToTopIndex(), new EventHandler<ScrollToEvent<Integer>>() {
             @Override public void handle(ScrollToEvent<Integer> event) {
@@ -79,6 +79,14 @@
     public abstract I createCell();
 
     /**
+     * This enables skin subclasses to provide a custom VirtualFlow implementation,
+     * rather than have VirtualContainerBase instantiate the default instance.
+     */
+    protected VirtualFlow<I> createVirtualFlow() {
+        return new VirtualFlow<I>();
+    }
+
+    /**
      * Returns the total number of items in this container, including those
      * that are currently hidden because they are out of view.
      */
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/VirtualFlow.java	Wed Jul 03 10:09:32 2013 -0400
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/VirtualFlow.java	Tue Jul 09 11:02:44 2013 +1200
@@ -25,7 +25,12 @@
 
 package com.sun.javafx.scene.control.skin;
 
+import java.util.AbstractList;
 import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import com.sun.javafx.collections.annotations.ReturnsUnmodifiableCollection;
 import javafx.animation.KeyFrame;
 import javafx.animation.Timeline;
 import javafx.application.ConditionalFeature;
@@ -369,6 +374,10 @@
      * This is package private ONLY FOR TESTING
      */
     final ArrayLinkedList<T> cells = new ArrayLinkedList<T>();
+    @ReturnsUnmodifiableCollection
+    protected List<T> getCells() {
+        return Collections.unmodifiableList(cells);
+    }
 
     /**
      * A structure containing cells that can be reused later. These are cells
@@ -407,7 +416,7 @@
      */
     private VirtualScrollBar hbar = new VirtualScrollBar(this);
 
-    final VirtualScrollBar getHbar() {
+    protected final VirtualScrollBar getHbar() {
         return hbar;
     }
     /**
@@ -416,7 +425,7 @@
      */
     private VirtualScrollBar vbar = new VirtualScrollBar(this);
 
-    final VirtualScrollBar getVbar() {
+    protected final VirtualScrollBar getVbar() {
         return vbar;
     }
 
@@ -2350,7 +2359,7 @@
      * <p>
      * This class is package private solely for the sake of testing.
      */
-    static class ArrayLinkedList<T> {
+    static class ArrayLinkedList<T> extends AbstractList {
         /**
          * The array list backing this class. We default the size of the array
          * list to be fairly large so as not to require resizing during normal
--- a/modules/controls/src/main/java/javafx/scene/control/Control.java	Wed Jul 03 10:09:32 2013 -0400
+++ b/modules/controls/src/main/java/javafx/scene/control/Control.java	Tue Jul 09 11:02:44 2013 +1200
@@ -693,7 +693,7 @@
             Constructor<?> skinConstructor = null;
             for (Constructor<?> c : constructors) {
                 Class<?>[] parameterTypes = c.getParameterTypes();
-                if (parameterTypes.length == 1 && Control.class.isAssignableFrom(parameterTypes[0])) {
+                if (parameterTypes.length == 1 && Skinnable.class.isAssignableFrom(parameterTypes[0])) {
                     skinConstructor = c;
                     break;
                 }
@@ -703,7 +703,7 @@
                 final String msg =
                     "No valid constructor defined in '" + skinClassName + "' for control " + control +
                         ".\r\nYou must provide a constructor that accepts a single "
-                        + "Control parameter in " + skinClassName + ".";
+                        + "Skinnable (e.g. Control or PopupControl) parameter in " + skinClassName + ".";
                 final List<CssError> errors = StyleManager.getErrors();
                 if (errors != null) {
                     CssError error = new CssError(msg);
--- a/modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/caspian/caspian.css	Wed Jul 03 10:09:32 2013 -0400
+++ b/modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/caspian/caspian.css	Tue Jul 09 11:02:44 2013 +1200
@@ -2388,6 +2388,11 @@
     -fx-background-insets: 1 0 -1 0, 0; 
 }
 
+.table-view .column-header .label,
+.tree-table-view .column-header .label {
+    -fx-alignment: center;
+}
+
 .table-view > .column-header-background > .show-hide-columns-button,
 .tree-table-view > .column-header-background > .show-hide-columns-button{
     -fx-background-color: -fx-body-color;
--- a/modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/modena.css	Wed Jul 03 10:09:32 2013 -0400
+++ b/modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/modena.css	Tue Jul 09 11:02:44 2013 +1200
@@ -2386,6 +2386,11 @@
     -fx-padding: 0.115em;
     -fx-background-radius: 0.115em;
 }
+.table-view .column-header .label,
+.tree-table-view .column-header .label {
+    -fx-alignment: center;
+}
+
 /* Plus Symbol */
 .table-view .show-hide-column-image,
 .tree-table-view .show-hide-column-image {