You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2007/06/01 18:25:03 UTC

svn commit: r543525 - /myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRenderer.java

Author: bommel
Date: Fri Jun  1 09:25:02 2007
New Revision: 543525

URL: http://svn.apache.org/viewvc?view=rev&rev=543525
Log:
(TOBAGO-414) <tc:toolBarCommand> ommits blank on class-attribute when disabled

Modified:
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRenderer.java

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRenderer.java?view=diff&rev=543525&r1=543524&r2=543525
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRenderer.java Fri Jun  1 09:25:02 2007
@@ -96,6 +96,7 @@
       if (toolbar instanceof UIToolBar) {
         right = UIToolBar.ORIENTATION_RIGHT.equals(((UIToolBar) toolbar).getOrientation());
       }
+      // TODO use StyleClasses
       writer.writeClassAttribute("tobago-toolbar-div-inner" + (right ? " tobago-toolbar-orientation-right" : ""));
 
     }
@@ -329,8 +330,8 @@
           && label.getText() != null));
 
       if (((!ToolBarTag.LABEL_OFF.equals(labelPosition)
-            && label.getText() != null)
-           || popupMenu != null)
+          && label.getText() != null)
+          || popupMenu != null)
           && !render1pxImage) {
         writer.writeStyleAttribute("padding-right: 3px;");
         // TODO: make this '3px' configurable
@@ -413,7 +414,7 @@
   }
 
   private String getImage(FacesContext facesContext, String name,
-                          String iconSize, boolean disabled, boolean selected) {
+      String iconSize, boolean disabled, boolean selected) {
     if (name == null) {
       return ResourceManagerUtil.getImageWithPath(facesContext, "image/1x1.gif");
     }
@@ -438,7 +439,7 @@
           viewRoot, key + "SelectedDisabled" + size + ext, true);
       if (image == null) {
         image = resourceManager.getImage(
-                viewRoot, key + "SelectedDisabled" + ext, true);
+            viewRoot, key + "SelectedDisabled" + ext, true);
       }
     }
     if (image == null && disabled) {
@@ -474,20 +475,21 @@
       final LabelWithAccessKey label, final boolean disabled)
       throws IOException {
     writer.startElement(HtmlConstants.A, command);
-    writer.writeClassAttribute("tobago-toolBar-button-link" + (disabled ? "tobago-toolBar-button-link-disabled" : ""));
+    // TODO use StyleClasses
+    writer.writeClassAttribute("tobago-toolBar-button-link" + (disabled ? " tobago-toolBar-button-link-disabled" : ""));
     writer.writeAttributeFromComponent(HtmlAttributes.TITLE, ATTR_TIP);
     if (!disabled) {
       writer.writeAttribute(HtmlAttributes.HREF, "#", false);
       writer.writeAttribute(HtmlAttributes.ONFOCUS, "Tobago.toolbarFocus(this, event)", false);
       if (label.getAccessKey() != null) {
         if (LOG.isInfoEnabled()
-                && !AccessKeyMap.addAccessKey(facesContext, label.getAccessKey())) {
+            && !AccessKeyMap.addAccessKey(facesContext, label.getAccessKey())) {
           LOG.info("dublicated accessKey : " + label.getAccessKey());
         }
         String id = command.getClientId(facesContext) + SUBCOMPONENT_SEP + "link";
         writer.writeIdAttribute(id);
-      HtmlRendererUtil.addClickAcceleratorKey(
-          facesContext, id, label.getAccessKey());
+        HtmlRendererUtil.addClickAcceleratorKey(
+            facesContext, id, label.getAccessKey());
       }
     }
   }