aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/ui/Label.java
diff options
context:
space:
mode:
authorHenri Sara <hesara@vaadin.com>2011-11-08 11:24:12 +0200
committerHenri Sara <hesara@vaadin.com>2011-11-08 11:24:12 +0200
commita61302616430cbbfc97cbdbb85fe294842b3409c (patch)
treedcca942cdad8fc09680effc7269819faea75a6e1 /src/com/vaadin/ui/Label.java
parentb2f5e652227dd4468622b092a8197afa8ee9b65f (diff)
downloadvaadin-framework-a61302616430cbbfc97cbdbb85fe294842b3409c.tar.gz
vaadin-framework-a61302616430cbbfc97cbdbb85fe294842b3409c.zip
Eliminate more cases that used Property.toString().
Remaining possibly problematic cases include Label.compareTo(), TestForPreconfiguredComponents and TestForTrees.
Diffstat (limited to 'src/com/vaadin/ui/Label.java')
-rw-r--r--src/com/vaadin/ui/Label.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/com/vaadin/ui/Label.java b/src/com/vaadin/ui/Label.java
index c7504230e3..1249f20a62 100644
--- a/src/com/vaadin/ui/Label.java
+++ b/src/com/vaadin/ui/Label.java
@@ -257,16 +257,22 @@ public class Label extends AbstractComponent implements Property,
}
/**
- * TODO temporary method to help eliminate the use of toString()
+ * Returns the value of the <code>Property</code> in human readable textual
+ * format.
*
- * @return
+ * This method exists to help migration from previous Vaadin versions by
+ * providing a simple replacement for {@link #toString()}. However, it is
+ * normally better to use the value of the label directly.
+ *
+ * @return String representation of the value stored in the Property
+ * @since 7.0
*/
public String getStringValue() {
if (dataSource == null) {
throw new IllegalStateException(DATASOURCE_MUST_BE_SET);
}
- // TODO do not use Property.toString()
- return dataSource.toString();
+ Object value = dataSource.getValue();
+ return (null != value) ? value.toString() : null;
}
/**