changeset 2222:ff47dba3a935

RT-27600: Redesign Control#getCssMetaData() & impl_getControlStyleableProperties() Reviewed-by: David Grieve, Jonathan Giles, Richard Bair Contributed-by: Tom Schindl <tom.schindl@bestsolution.at>
author jgiles
date Mon, 14 Jan 2013 10:32:19 +1300
parents 4782520f95c7
children 6ac0f47a252c
files javafx-ui-controls/src/javafx/scene/control/Control.java javafx-ui-controls/src/javafx/scene/control/Labeled.java javafx-ui-controls/src/javafx/scene/control/ListView.java javafx-ui-controls/src/javafx/scene/control/MenuBar.java javafx-ui-controls/src/javafx/scene/control/Pagination.java javafx-ui-controls/src/javafx/scene/control/ScrollBar.java javafx-ui-controls/src/javafx/scene/control/ScrollPane.java javafx-ui-controls/src/javafx/scene/control/Separator.java javafx-ui-controls/src/javafx/scene/control/Slider.java javafx-ui-controls/src/javafx/scene/control/SplitPane.java javafx-ui-controls/src/javafx/scene/control/TabPane.java javafx-ui-controls/src/javafx/scene/control/TextField.java javafx-ui-controls/src/javafx/scene/control/TitledPane.java javafx-ui-controls/src/javafx/scene/control/ToolBar.java
diffstat 14 files changed, 31 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/javafx/scene/control/Control.java	Fri Jan 11 12:34:08 2013 +1300
+++ b/javafx-ui-controls/src/javafx/scene/control/Control.java	Mon Jan 14 10:32:19 2013 +1300
@@ -737,22 +737,21 @@
     }
 
     /**
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an experimental API that is not intended for general use and is subject to change in future versions
-     */
-    @Deprecated
-    protected List<CssMetaData> impl_getControlStyleableProperties() {
-        return getClassCssMetaData();
-    }
-
-    /**
-     * {@inheritDoc}
+     * This method returns a {@link List} containing all {@link CssMetaData} for 
+     * both this Control (returned from {@link #getControlCssMetaData()} and its 
+     * {@link Skin}, assuming the {@link #skinProperty() skin property} is a 
+     * {@link SkinBase}. 
+     * 
+     * <p>Developers who wish to provide custom CssMetaData are therefore 
+     * encouraged to override {@link Control#getControlCssMetaData()} or 
+     * {@link SkinBase#getCssMetaData()}, depending on where the CssMetaData 
+     * resides.
      */
     @Override
-    public List<CssMetaData> getCssMetaData() {
+    public final List<CssMetaData> getCssMetaData() {
         if (styleableProperties == null) {
             styleableProperties = new ArrayList<CssMetaData>();
-            styleableProperties.addAll(impl_getControlStyleableProperties());
+            styleableProperties.addAll(getControlCssMetaData());
             
             if (skinBase != null) {
                 styleableProperties.addAll(skinBase.getCssMetaData());
@@ -760,6 +759,13 @@
         }
         return styleableProperties;
     }
+    
+    /**
+     * @return unmodifiable list of the controls css styleable properties
+     */
+    protected List<CssMetaData> getControlCssMetaData() {
+        return getClassCssMetaData();
+    }
 
     /**
      * @treatAsPrivate implementation detail
--- a/javafx-ui-controls/src/javafx/scene/control/Labeled.java	Fri Jan 11 12:34:08 2013 +1300
+++ b/javafx-ui-controls/src/javafx/scene/control/Labeled.java	Mon Jan 14 10:32:19 2013 +1300
@@ -935,7 +935,7 @@
      * {@inheritDoc}
      */
     @Override
-    public List<CssMetaData> getCssMetaData() {
+    public List<CssMetaData> getControlCssMetaData() {
         return getClassCssMetaData();
     }
 
--- a/javafx-ui-controls/src/javafx/scene/control/ListView.java	Fri Jan 11 12:34:08 2013 +1300
+++ b/javafx-ui-controls/src/javafx/scene/control/ListView.java	Mon Jan 14 10:32:19 2013 +1300
@@ -802,7 +802,7 @@
      * {@inheritDoc}
      */
     @Override
-    public List<CssMetaData> getCssMetaData() {
+    public List<CssMetaData> getControlCssMetaData() {
         return getClassCssMetaData();
     }
 
--- a/javafx-ui-controls/src/javafx/scene/control/MenuBar.java	Fri Jan 11 12:34:08 2013 +1300
+++ b/javafx-ui-controls/src/javafx/scene/control/MenuBar.java	Mon Jan 14 10:32:19 2013 +1300
@@ -199,7 +199,7 @@
      * {@inheritDoc}
      */
     @Override
-    public List<CssMetaData> getCssMetaData() {
+    public List<CssMetaData> getControlCssMetaData() {
         return getClassCssMetaData();
     }
 
--- a/javafx-ui-controls/src/javafx/scene/control/Pagination.java	Fri Jan 11 12:34:08 2013 +1300
+++ b/javafx-ui-controls/src/javafx/scene/control/Pagination.java	Mon Jan 14 10:32:19 2013 +1300
@@ -379,7 +379,7 @@
      * {@inheritDoc}
      */
     @Override
-    public List<CssMetaData> getCssMetaData() {
+    public List<CssMetaData> getControlCssMetaData() {
         return getClassCssMetaData();
     }
 
--- a/javafx-ui-controls/src/javafx/scene/control/ScrollBar.java	Fri Jan 11 12:34:08 2013 +1300
+++ b/javafx-ui-controls/src/javafx/scene/control/ScrollBar.java	Mon Jan 14 10:32:19 2013 +1300
@@ -438,7 +438,7 @@
      * {@inheritDoc}
      */
     @Override
-    public List<CssMetaData> getCssMetaData() {
+    public List<CssMetaData> getControlCssMetaData() {
         return getClassCssMetaData();
     }
 
--- a/javafx-ui-controls/src/javafx/scene/control/ScrollPane.java	Fri Jan 11 12:34:08 2013 +1300
+++ b/javafx-ui-controls/src/javafx/scene/control/ScrollPane.java	Mon Jan 14 10:32:19 2013 +1300
@@ -703,7 +703,7 @@
      * {@inheritDoc}
      */
     @Override
-    public List<CssMetaData> getCssMetaData() {
+    public List<CssMetaData> getControlCssMetaData() {
         return getClassCssMetaData();
     }
 
--- a/javafx-ui-controls/src/javafx/scene/control/Separator.java	Fri Jan 11 12:34:08 2013 +1300
+++ b/javafx-ui-controls/src/javafx/scene/control/Separator.java	Mon Jan 14 10:32:19 2013 +1300
@@ -309,7 +309,7 @@
      * @deprecated This is an experimental API that is not intended for general use and is subject to change in future versions
      */
     @Deprecated
-    @Override protected List<CssMetaData> impl_getControlStyleableProperties() {
+    @Override protected List<CssMetaData> getControlCssMetaData() {
         return getClassCssMetaData();
     }
 
--- a/javafx-ui-controls/src/javafx/scene/control/Slider.java	Fri Jan 11 12:34:08 2013 +1300
+++ b/javafx-ui-controls/src/javafx/scene/control/Slider.java	Mon Jan 14 10:32:19 2013 +1300
@@ -791,7 +791,7 @@
      * @deprecated This is an experimental API that is not intended for general use and is subject to change in future versions
      */
     @Deprecated
-    @Override protected List<CssMetaData> impl_getControlStyleableProperties() {
+    @Override protected List<CssMetaData> getControlCssMetaData() {
         return getClassCssMetaData();
     }
 
--- a/javafx-ui-controls/src/javafx/scene/control/SplitPane.java	Fri Jan 11 12:34:08 2013 +1300
+++ b/javafx-ui-controls/src/javafx/scene/control/SplitPane.java	Mon Jan 14 10:32:19 2013 +1300
@@ -418,7 +418,7 @@
      * {@inheritDoc}
      */
     @Override
-    public List<CssMetaData> getCssMetaData() {
+    public List<CssMetaData> getControlCssMetaData() {
         return getClassCssMetaData();
     }
 
--- a/javafx-ui-controls/src/javafx/scene/control/TabPane.java	Fri Jan 11 12:34:08 2013 +1300
+++ b/javafx-ui-controls/src/javafx/scene/control/TabPane.java	Mon Jan 14 10:32:19 2013 +1300
@@ -580,7 +580,7 @@
      * {@inheritDoc}
      */
     @Override
-    public List<CssMetaData> getCssMetaData() {
+    public List<CssMetaData> getControlCssMetaData() {
         return getClassCssMetaData();
     }
 
--- a/javafx-ui-controls/src/javafx/scene/control/TextField.java	Fri Jan 11 12:34:08 2013 +1300
+++ b/javafx-ui-controls/src/javafx/scene/control/TextField.java	Mon Jan 14 10:32:19 2013 +1300
@@ -298,7 +298,7 @@
      * {@inheritDoc}
      */
     @Override
-    public List<CssMetaData> getCssMetaData() {
+    public List<CssMetaData> getControlCssMetaData() {
         return getClassCssMetaData();
     }
 }
--- a/javafx-ui-controls/src/javafx/scene/control/TitledPane.java	Fri Jan 11 12:34:08 2013 +1300
+++ b/javafx-ui-controls/src/javafx/scene/control/TitledPane.java	Mon Jan 14 10:32:19 2013 +1300
@@ -327,7 +327,7 @@
      * {@inheritDoc}
      */
     @Override
-    public List<CssMetaData> getCssMetaData() {
+    public List<CssMetaData> getControlCssMetaData() {
         return getClassCssMetaData();
     }
 
--- a/javafx-ui-controls/src/javafx/scene/control/ToolBar.java	Fri Jan 11 12:34:08 2013 +1300
+++ b/javafx-ui-controls/src/javafx/scene/control/ToolBar.java	Mon Jan 14 10:32:19 2013 +1300
@@ -238,7 +238,7 @@
      * {@inheritDoc}
      */
     @Override
-    public List<CssMetaData> getCssMetaData() {
+    public List<CssMetaData> getControlCssMetaData() {
         return getClassCssMetaData();
     }