You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by id...@apache.org on 2007/05/08 14:28:13 UTC

svn commit: r536175 - /myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/LabelWithAccessKey.java

Author: idus
Date: Tue May  8 05:28:12 2007
New Revision: 536175

URL: http://svn.apache.org/viewvc?view=rev&rev=536175
Log:
allow for simple conversion to String via valueOf; TOBAGO-391

Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/LabelWithAccessKey.java

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/LabelWithAccessKey.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/LabelWithAccessKey.java?view=diff&rev=536175&r1=536174&r2=536175
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/LabelWithAccessKey.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/LabelWithAccessKey.java Tue May  8 05:28:12 2007
@@ -38,16 +38,16 @@
   public static final String ESCAPED_INDICATOR = "__";
 
   public LabelWithAccessKey(UIComponent component) {
-
+    Object value;
     if (RENDERER_TYPE_LABEL.equals(component.getRendererType())) {
-      text = (String) component.getAttributes().get(ATTR_VALUE);
+      value = component.getAttributes().get(ATTR_VALUE);
     } else {
-      text = (String) component.getAttributes().get(ATTR_LABEL);
+      value = component.getAttributes().get(ATTR_LABEL);
     }
-
+    text = (value == null) ? null : String.valueOf(value);
     setup(text);
-
   }
+
   private void findIndicator(String label, int index, int escapedIndicatorCount) {
     index = label.indexOf(INDICATOR, index);
     if (index == -1) {
@@ -99,5 +99,5 @@
   public void setAccessKey(Character accessKey) {
     this.accessKey = accessKey;
   }
-}
 
+}