Author: rwhitcomb Date: Mon Sep 16 19:46:05 2013 New Revision: 1523776 URL: http://svn.apache.org/r1523776 Log: PIVOT-922: Correc the last renderer that isn't correctly calling "toString" in the "render" method. This change also correctly ignores pure Image data which shouldn't have text.
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewHeaderDataRenderer.java Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewHeaderDataRenderer.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewHeaderDataRenderer.java?rev=1523776&r1=1523775&r2=1523776&view=diff ============================================================================== --- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewHeaderDataRenderer.java (original) +++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewHeaderDataRenderer.java Mon Sep 16 19:46:05 2013 @@ -65,14 +65,10 @@ public class TableViewHeaderDataRenderer if (data instanceof TableViewHeaderData) { TableViewHeaderData tableViewHeaderData = (TableViewHeaderData)data; icon = tableViewHeaderData.getIcon(); - text = tableViewHeaderData.getText(); } else if (data instanceof Image) { icon = (Image)data; - } else { - if (data != null) { - text = data.toString(); - } } + text = toString(data); // Update the icon image view imageView.setImage(icon); @@ -115,16 +111,15 @@ public class TableViewHeaderDataRenderer @Override public String toString(Object data) { - if (data == null) { - throw new IllegalArgumentException(); - } + String string = null; - String string; if (data instanceof TableViewHeaderData) { TableViewHeaderData tableViewHeaderData = (TableViewHeaderData)data; string = tableViewHeaderData.getText(); - } else { - string = data.toString(); + } else if (!(data instanceof Image)) { + if (data != null) { + string = data.toString(); + } } return string;