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 15:57:46 UTC
svn commit: r1382851 - in
/pivot/branches/2.0.x/wtk/src/org/apache/pivot/wtk: ListButton.java
ListView.java
Author: smartini
Date: Mon Sep 10 13:57:45 2012
New Revision: 1382851
URL: http://svn.apache.org/viewvc?rev=1382851&view=rev
Log:
add some javadoc on how the default renderer uses element beans to display text (for any element, inside the list)
Modified:
pivot/branches/2.0.x/wtk/src/org/apache/pivot/wtk/ListButton.java
pivot/branches/2.0.x/wtk/src/org/apache/pivot/wtk/ListView.java
Modified: pivot/branches/2.0.x/wtk/src/org/apache/pivot/wtk/ListButton.java
URL: http://svn.apache.org/viewvc/pivot/branches/2.0.x/wtk/src/org/apache/pivot/wtk/ListButton.java?rev=1382851&r1=1382850&r2=1382851&view=diff
==============================================================================
--- pivot/branches/2.0.x/wtk/src/org/apache/pivot/wtk/ListButton.java (original)
+++ pivot/branches/2.0.x/wtk/src/org/apache/pivot/wtk/ListButton.java Mon Sep 10 13:57:45 2012
@@ -311,9 +311,19 @@ public class ListButton extends Button {
/**
* Creates a list button with the given button and list 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 in the ListView,
+ * or implement your own custom renderer.
*
* @param buttonData
+ * The button data.
+ *
* @param listData
+ * The data to set.
+ *
+ * @see ListButtonDataRenderer
+ * @see ListViewItemRenderer
*/
public ListButton(Object buttonData, List<?> listData) {
super(buttonData);
@@ -605,10 +615,22 @@ public class ListButton extends Button {
}
}
+ /**
+ * Returns name of the key that is used in context binding.
+ *
+ * @return
+ * The key.
+ */
public String getListDataKey() {
return listDataKey;
}
+ /**
+ * Set the name of the key that is used in context binding.
+ *
+ * @param listDataKey
+ * The key to set.
+ */
public void setListDataKey(String listDataKey) {
String previousListDataKey = this.listDataKey;
if (previousListDataKey != listDataKey) {
Modified: pivot/branches/2.0.x/wtk/src/org/apache/pivot/wtk/ListView.java
URL: http://svn.apache.org/viewvc/pivot/branches/2.0.x/wtk/src/org/apache/pivot/wtk/ListView.java?rev=1382851&r1=1382850&r2=1382851&view=diff
==============================================================================
--- pivot/branches/2.0.x/wtk/src/org/apache/pivot/wtk/ListView.java (original)
+++ pivot/branches/2.0.x/wtk/src/org/apache/pivot/wtk/ListView.java Mon Sep 10 13:57:45 2012
@@ -590,8 +590,15 @@ public class ListView extends Component
/**
* Creates a list view populated with the given list 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 in the ListView,
+ * or implement your own custom renderer.
*
* @param listData
+ * The data to set.
+ *
+ * @see ListViewItemRenderer
*/
public ListView(List<?> listData) {
setItemRenderer(DEFAULT_ITEM_RENDERER);
@@ -1364,10 +1371,22 @@ public class ListView extends Component
}
}
+ /**
+ * Returns name of the key that is used in context binding.
+ *
+ * @return
+ * The key.
+ */
public String getListDataKey() {
return listDataKey;
}
+ /**
+ * Set the name of the key that is used in context binding.
+ *
+ * @param listDataKey
+ * The key to set.
+ */
public void setListDataKey(String listDataKey) {
String previousListDataKey = this.listDataKey;
if (previousListDataKey != listDataKey) {