You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2015/10/03 13:13:26 UTC

svn commit: r1706544 - in /myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main: java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/

Author: lofwyr
Date: Sat Oct  3 11:13:25 2015
New Revision: 1706544

URL: http://svn.apache.org/viewvc?rev=1706544&view=rev
Log:
TOBAGO-1495: Adapt the tc:tree to Bootstrap

Modified:
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeIndentRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-tree.js

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeIndentRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeIndentRenderer.java?rev=1706544&r1=1706543&r2=1706544&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeIndentRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeIndentRenderer.java Sat Oct  3 11:13:25 2015
@@ -21,14 +21,10 @@ package org.apache.myfaces.tobago.render
 
 import org.apache.myfaces.tobago.component.UITree;
 import org.apache.myfaces.tobago.component.UITreeIndent;
-import org.apache.myfaces.tobago.context.Markup;
 import org.apache.myfaces.tobago.context.ResourceManagerUtils;
 import org.apache.myfaces.tobago.internal.component.AbstractUIData;
 import org.apache.myfaces.tobago.internal.component.AbstractUITreeNode;
 import org.apache.myfaces.tobago.renderkit.RendererBase;
-import org.apache.myfaces.tobago.renderkit.css.Classes;
-import org.apache.myfaces.tobago.renderkit.html.DataAttributes;
-import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
 import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
 import org.apache.myfaces.tobago.util.ComponentUtils;
@@ -90,6 +86,7 @@ public class TreeIndentRenderer extends
 
     for (int i = dropFirst ? 1 : 0; i < junctions.size() - 1; i++) {
       final Boolean junction = junctions.get(i);
+/*
       writer.startElement(HtmlElements.IMG, null);
       writer.writeClassAttribute(Classes.create(node, "junction"));
       writer.writeAttribute(HtmlAttributes.ALT, "", false);
@@ -99,6 +96,9 @@ public class TreeIndentRenderer extends
         writer.writeAttribute("src", blank, true);
       }
       writer.endElement(HtmlElements.IMG);
+*/
+      final String icon = junction && showLines ? "glyphicon-option-vertical" : "glyphicon-cog";
+      HtmlRendererUtils.encodeIconWithLabel(writer, icon, null);
     }
   }
 
@@ -111,6 +111,11 @@ public class TreeIndentRenderer extends
       return;
     }
     final boolean hasNextSibling = junctions.get(junctions.size() - 1); // last element
+
+    final String icon = folder ? expanded ? "glyphicon-minus" : "glyphicon-plus" : "glyphicon-option-vertical";
+    HtmlRendererUtils.encodeIconWithLabel(writer, icon, null);
+
+/*
     writer.startElement(HtmlElements.IMG, null);
     writer.writeClassAttribute(Classes.create(node, "toggle", Markup.NULL));
 
@@ -159,6 +164,7 @@ public class TreeIndentRenderer extends
     }
     writer.writeAttribute(HtmlAttributes.ALT, "", false);
     writer.endElement(HtmlElements.IMG);
+*/
   }
 
 }

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-tree.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-tree.js?rev=1706544&r1=1706543&r2=1706544&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-tree.js (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-tree.js Sat Oct  3 11:13:25 2015
@@ -203,6 +203,12 @@ Tobago.Tree.init = function(elements) {
     });
   });
 
+  // XXX hack: if solved TOBAGO-1495 can be closed
+  Tobago.Utils.selectWithJQuery(elements, ".tobago-treeNode")
+      .find(".glyphicon-cog").css({
+    color: "transparent"
+  });
+
 };
 
 Tobago.Tree.isExpanded = function(node, expanded) {