You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by sm...@apache.org on 2012/09/10 16:00:25 UTC
svn commit: r1382854 -
/pivot/branches/2.0.x/wtk/src/org/apache/pivot/wtk/Spinner.java
Author: smartini
Date: Mon Sep 10 14:00:24 2012
New Revision: 1382854
URL: http://svn.apache.org/viewvc?rev=1382854&view=rev
Log:
add some javadoc on how the default renderer uses element beans to display text (for any element)
Modified:
pivot/branches/2.0.x/wtk/src/org/apache/pivot/wtk/Spinner.java
Modified: pivot/branches/2.0.x/wtk/src/org/apache/pivot/wtk/Spinner.java
URL: http://svn.apache.org/viewvc/pivot/branches/2.0.x/wtk/src/org/apache/pivot/wtk/Spinner.java?rev=1382854&r1=1382853&r2=1382854&view=diff
==============================================================================
--- pivot/branches/2.0.x/wtk/src/org/apache/pivot/wtk/Spinner.java (original)
+++ pivot/branches/2.0.x/wtk/src/org/apache/pivot/wtk/Spinner.java Mon Sep 10 14:00:24 2012
@@ -350,6 +350,8 @@ public class Spinner extends Container {
new SpinnerSelectionListenerList();
private SpinnerBindingListenerList spinnerBindingListeners = new SpinnerBindingListenerList();
+ private static final ItemRenderer DEFAULT_ITEM_RENDERER = new SpinnerItemRenderer();
+
/**
* Creates a spinner populated with an empty array list.
*/
@@ -359,11 +361,18 @@ public class Spinner extends Container {
/**
* Creates a spinner populated with the given spinner data.
+ * <p>
+ * Note that the default renderer uses (as last option) the toString method on list elements,
+ * so override it to return whatever you want to display as text,
+ * or implement your own custom renderer.
*
* @param spinnerData
+ * The data to set.
+ *
+ * @see SpinnerItemRenderer
*/
public Spinner(List<?> spinnerData) {
- setItemRenderer(new SpinnerItemRenderer());
+ setItemRenderer(DEFAULT_ITEM_RENDERER);
setSpinnerData(spinnerData);
installSkin(Spinner.class);