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 2010/06/10 14:26:45 UTC

svn commit: r953304 - in /myfaces/tobago/trunk/tobago-theme: tobago-theme-richmond/src/main/resources/org/apache/myfaces/tobago/renderkit/html/richmond/standard/style/ tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scar...

Author: lofwyr
Date: Thu Jun 10 12:26:44 2010
New Revision: 953304

URL: http://svn.apache.org/viewvc?rev=953304&view=rev
Log:
TOBAGO-377: new tree implementation
 - clean up
 - removing old style classes

Modified:
    myfaces/tobago/trunk/tobago-theme/tobago-theme-richmond/src/main/resources/org/apache/myfaces/tobago/renderkit/html/richmond/standard/style/style.css
    myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeNodeRenderer.java
    myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css
    myfaces/tobago/trunk/tobago-theme/tobago-theme-speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/style.css

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-richmond/src/main/resources/org/apache/myfaces/tobago/renderkit/html/richmond/standard/style/style.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-richmond/src/main/resources/org/apache/myfaces/tobago/renderkit/html/richmond/standard/style/style.css?rev=953304&r1=953303&r2=953304&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-richmond/src/main/resources/org/apache/myfaces/tobago/renderkit/html/richmond/standard/style/style.css (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-richmond/src/main/resources/org/apache/myfaces/tobago/renderkit/html/richmond/standard/style/style.css Thu Jun 10 12:26:44 2010
@@ -363,18 +363,6 @@ a:link.tab, a:visited.tab, a:active.tab 
 
 /* tree ------------------------------------------------------------------- */
 
-/* XXX old */
-a.tree-folder-label:hover, a.tree-item-label:hover  {
-  color: #6699ff;
-  text-decoration: underline;
-}
-
-/* XXX old */
-a.tree-folder-label:focus, a.tree-item-label:focus {
-  background: #d6ebff;
-  color: #3366cc;
-}
-
 a.tobago-treeNode a:hover {
   color: #6699ff;
   text-decoration: underline;

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeNodeRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeNodeRenderer.java?rev=953304&r1=953303&r2=953304&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeNodeRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeNodeRenderer.java Thu Jun 10 12:26:44 2010
@@ -28,7 +28,6 @@ import org.apache.myfaces.tobago.context
 import org.apache.myfaces.tobago.context.ResourceUtils;
 import org.apache.myfaces.tobago.event.TreeExpansionEvent;
 import org.apache.myfaces.tobago.internal.component.AbstractUITree;
-import org.apache.myfaces.tobago.internal.component.AbstractUITreeNode;
 import org.apache.myfaces.tobago.internal.context.ResponseWriterDivider;
 import org.apache.myfaces.tobago.internal.webapp.TobagoResponseWriterImpl;
 import org.apache.myfaces.tobago.layout.Display;
@@ -292,7 +291,7 @@ public class TreeNodeRenderer extends Co
       encodeTreeJunction(facesContext, writer, id, treeId, showJunctions, showRootJunction, showRoot, expanded,
           folder, level, hasNextSibling, openSource, closedSource);
 
-      encodeTreeIcons(writer, id, treeId, showIcons, folder, source, openSource, closedSource);
+      encodeTreeIcons(writer, node, id, treeId, showIcons, folder, source, openSource, closedSource);
 
       encodeLabel(writer, helper, node, marked, treeId);
 
@@ -312,7 +311,7 @@ public class TreeNodeRenderer extends Co
     }
   }
 
-  private void encodeExpandedHidden(TobagoResponseWriter writer, AbstractUITreeNode node, String clientId,
+  private void encodeExpandedHidden(TobagoResponseWriter writer, UITreeNode node, String clientId,
                                     boolean expanded) throws IOException {
     writer.startElement(HtmlConstants.INPUT, node);
     writer.writeAttribute(HtmlAttributes.TYPE, "hidden", false);
@@ -336,7 +335,7 @@ public class TreeNodeRenderer extends Co
     }
     String src = expanded ? menuOpen : menuClose;
     writer.startElement(HtmlConstants.IMG, null);
-    writer.writeClassAttribute("tobago-tree-menu-icon");
+    writer.writeClassAttribute(new StyleClasses(node, "menuIcon"));
     writer.writeIdAttribute(id + "-menuIcon");
     writer.writeAttribute("src", src, true);
     writer.writeAttribute("onclick", onclick, true);
@@ -393,23 +392,19 @@ public class TreeNodeRenderer extends Co
         writer.writeAttribute("onclick", createOnclickForToggle(treeId, openSource, closedSource), true);
       }
       writer.writeAttribute("alt", "", false);
-//    } else if (( !this.hideRoot && level >0 ) || (this.hideRoot && level > 1)) {
-//      str += '<img class="tree-junction" id="' + this.id
-//          + '-junction" src="' + this.treeResources.getImage("blank.gif")
-//          + '" alt="">';
       writer.endElement(HtmlConstants.IMG);
     }
   }
 
   private void encodeTreeIcons(
-      TobagoResponseWriter writer, String id, String treeId,
+      TobagoResponseWriter writer, UITreeNode node, String id, String treeId,
       boolean showIcons, boolean folder, String source, String openSource, String closedSource)
       throws IOException {
 
     if (showIcons) {
       writer.startElement(HtmlConstants.IMG, null);
-      writer.writeClassAttribute("tree-icon");
-      writer.writeIdAttribute(id + "-icon");
+      writer.writeClassAttribute(new StyleClasses(node, "icon"));
+      writer.writeIdAttribute(id + "-icon"); //XXX may not okay with naming conventions
 
       writer.writeAttribute("src", source, true);
       if (folder) {
@@ -447,10 +442,8 @@ public class TreeNodeRenderer extends Co
       TobagoResponseWriter writer, CommandRendererHelper helper, UITreeNode node, boolean marked, String treeId)
       throws IOException {
 
-    if (helper.isDisabled()) {
-      writer.startElement(HtmlConstants.SPAN, null);
-    } else {
-      writer.startElement(HtmlConstants.A, null);
+    writer.startElement(HtmlConstants.A, null);
+    if (!helper.isDisabled()) {
       writer.writeAttribute(HtmlAttributes.HREF, helper.getHref(), true);
       writer.writeAttribute(HtmlAttributes.ONCLICK, helper.getOnclick(), true); // xxx is escaping required?
       writer.writeAttribute(
@@ -460,26 +453,18 @@ public class TreeNodeRenderer extends Co
       }
     }
     if (marked) {
-      StyleClasses classes = new StyleClasses();
-      classes.addClass("treeNode", "marker");
-      writer.writeClassAttribute(classes);
-    }
-    String objTip = node.getTip();
-    if (objTip != null) {
-//XXX is needed?      tip = StringEscapeUtils.escapeJavaScript(tip);
-      writer.writeAttribute(HtmlAttributes.TITLE, String.valueOf(objTip), true);
+      writer.writeClassAttribute(new StyleClasses(node, "marker"));
+    }
+    String tip = node.getTip();
+    if (tip != null) {
+      writer.writeAttribute(HtmlAttributes.TITLE, tip, true);
     }
     String label = node.getLabel();
     if (label == null) {
-      LOG.warn("label == null");
-      label = "label";
+      label = "";
     }
     writer.writeText(label);
-    if (helper.isDisabled()) {
-      writer.endElement(HtmlConstants.SPAN);
-    } else {
-      writer.endElement(HtmlConstants.A);
-    }
+    writer.endElement(HtmlConstants.A);
   }
 
   @Override

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css?rev=953304&r1=953303&r2=953304&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css Thu Jun 10 12:26:44 2010
@@ -1129,55 +1129,6 @@ span.tobago-progress {
   position: absolute;
 }
 
-/* Tree old -------------------------------------------------------------------- */
-
-.tree-folder-label, .tree-item-label, .tree-folder-label:active,
-  .tree-item-label:active, .tree-folder-label:hover, .tree-item-label:hover {
-  margin-left: 3px;
-  padding: 1px 2px 1px 2px;
-}
-
-.tree-folder-label, .tree-item-label {
-  color: black;
-  text-decoration: none;
-}
-
-.tree-folder-label:hover, .tree-item-label:hover {
-  color: blue;
-  text-decoration: underline;
-}
-
-/*.tree-folder-label:active, .tree-item-label:active {
-	background: highlight;
-	color: highlighttext;
-	text-decoration: none;
-}*/
-
-.tree-item-marker, .tree-item-marker:focus, a.tree-item-marker, a.tree-item-marker:focus {
-  background-color: #d8e9fb;
-}
-
-.tree-folder-label:focus, .tree-item-label:focus {
-  background: #445566;
-  color: highlighttext;
-  text-decoration: none;
-}
-
-.tree-item img {
-  vertical-align: middle;
-  border: 0;
-}
-
-.tree-icon {
-  width: 16px;
-  height: 16px;
-}
-
-.tobago-treeNode-junction {
-  width: 19px;
-  height: 16px;
-}
-
 /* Tree ------------------------------------------------------------------- */
 
 .tobago-tree {
@@ -1215,10 +1166,10 @@ span.tobago-progress {
   text-decoration: none;
 }
 
-.tobago-treeNode-disabled, .tobago-treeNode-disabled a:hover {
+.tobago-treeNode-disabled a, .tobago-treeNode-disabled a:hover {
   color: #888888;
   text-decoration: none;
-  cursor: pointer;
+  cursor: default;
 }
 
 .tobago-treeNode-marker, .tobago-treeNode-marker:focus, .tobago-treeNode-marker a, .tobago-treeNode-marker:focus a {
@@ -1229,6 +1180,16 @@ span.tobago-progress {
   font-weight: bold;
 }
 
+.tobago-treeNode-icon {
+  width: 16px;
+  height: 16px;
+}
+
+.tobago-treeNode-junction {
+  width: 19px;
+  height: 16px;
+}
+
 /* treeListbox ------------------------------------------------------------------- */
 
 .tobago-treeListbox {

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/style.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/style.css?rev=953304&r1=953303&r2=953304&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/style.css (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/style.css Thu Jun 10 12:26:44 2010
@@ -682,6 +682,12 @@ a:link.tab, a:visited.tab, a:active.tab 
   height: 16px;
 }
 
+.tobago-treeNode-menuIcon {
+	width: 16px;
+	height: 16px;
+  float: right;
+}
+
 .tobago-treeNode img {
   vertical-align: top;
 	border: 0px;
@@ -692,10 +698,9 @@ a:link.tab, a:visited.tab, a:active.tab 
   font-family: arial, helvetica, sans-serif;
 }
 
-.tobago-treeNode-disabled {
+.tobago-treeNode-disabled a {
   color: #888888;
   text-decoration: none;
-  cursor: pointer;
 }
 
 .tobago-treeNode a:hover {
@@ -706,7 +711,6 @@ a:link.tab, a:visited.tab, a:active.tab 
 .tobago-treeNode-disabled a:hover {
   color: #888888;
   text-decoration: none;
-  cursor: pointer;
 }
 
 .tobago-treeNode a:focus {
@@ -717,80 +721,3 @@ a:link.tab, a:visited.tab, a:active.tab 
 .tobago-treeNode-marker, .tobago-treeNode-marker:focus, .tobago-treeNode-marker a, .tobago-treeNode-marker:focus a {
 	background-color: #d3d3d3;
 }
-
-/* XXX old names */
-.tree-menu-item {
-  border: 1px solid #CCCCCC;
-  width: 200px; /* default */
-  height: 16px;
-}
-
-/* XXX old names */
-.tree-item-label  {
-  font: 12px arial, helvetica, sans-serif;
-}
-
-/* XXX old names */
-a.tree-folder-label, .tree-folder-label {
-  font: bold 12px arial, helvetica, sans-serif;
-}
-
-/* XXX old names */
-a.tree-folder-label-disabled, a.tree-item-label-disabled {
-  color: #888888;
-  text-decoration: none;
-  cursor: pointer;
-}
-
-/* XXX old names */
-a.tree-folder-label:hover, a.tree-item-label:hover  {
-  color: #000000;
-  text-decoration: underline;
-}
-/* XXX old names */
-a.tree-folder-label-disabled:hover, a.tree-item-label-disabled:hover  {
-  color: #888888;
-  text-decoration: none;
-  cursor: pointer;
-}
-
-/* XXX old names */
-a.tree-folder-label:focus, a.tree-item-label:focus {
-  background: transparent;
-  color: #000000;
-}
-
-/* XXX old names */
-.tree-item-marker, .tree-item-marker:focus, a.tree-item-marker, a.tree-item-marker:focus {
-	background-color: #d3d3d3;
-}
-
-/* XXX old names */
-.tree-item-label, .tree-item-label:hover  {
-  color: #000000;
-}
-
-/* XXX old names */
-.tree-item-label:hover  {
-  text-decoration: underline;
-}
-
-/* XXX old names */
-.tree-item img {
-	vertical-align: top;
-	border: 0px;
-}
-
-/* XXX old names */
-.tree-icon {
-  width: 16px;
-  height: 16px;
-}
-
-/* XXX old names */
-.tobago-tree-menu-icon {
-	width: 16px;
-	height: 16px;
-  float: right;
-}
-