Author: jacopoc
Date: Fri Jul 25 08:04:52 2008 New Revision: 679828 URL: http://svn.apache.org/viewvc?rev=679828&view=rev Log: Layout enhancements for tree widgets. Added: ofbiz/trunk/framework/images/webapp/images/expand-collapse-placeholder.gif (with props) Modified: ofbiz/trunk/framework/images/webapp/images/maincss.css ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlTreeRenderer.java Added: ofbiz/trunk/framework/images/webapp/images/expand-collapse-placeholder.gif URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/expand-collapse-placeholder.gif?rev=679828&view=auto ============================================================================== Binary file - no diff available. Propchange: ofbiz/trunk/framework/images/webapp/images/expand-collapse-placeholder.gif ------------------------------------------------------------------------------ svn:mime-type = image/gif Modified: ofbiz/trunk/framework/images/webapp/images/maincss.css URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/maincss.css?rev=679828&r1=679827&r2=679828&view=diff ============================================================================== --- ofbiz/trunk/framework/images/webapp/images/maincss.css (original) +++ ofbiz/trunk/framework/images/webapp/images/maincss.css Fri Jul 25 08:04:52 2008 @@ -1650,6 +1650,11 @@ padding-right: 1em; } +.basic-tree li .leafnode { +background: url(/images/expand-collapse-placeholder.gif) no-repeat left center; +padding-right: 1em; +} + .basic-tree li .treeitem { /* treeitem is deprecated */ border-style: none; Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlTreeRenderer.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlTreeRenderer.java?rev=679828&r1=679827&r2=679828&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlTreeRenderer.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlTreeRenderer.java Fri Jul 25 08:04:52 2008 @@ -68,8 +68,8 @@ entityId = (String) context.get(pkName); } boolean hasChildren = node.hasChildren(context); - //Debug.logInfo("HtmlTreeExpandCollapseRenderer, hasChildren(1):" + hasChildren, module); + ModelTree.ModelNode.Link expandCollapseLink = new ModelTree.ModelNode.Link(); // check to see if this node needs to be expanded. if (hasChildren && node.isExpandCollapse()) { String targetEntityId = null; @@ -77,12 +77,6 @@ if (depth < targetNodeTrail.size()) { targetEntityId = (String)targetNodeTrail.get(depth); } - //Debug.logInfo("HtmlTreeExpandCollapseRenderer, targetEntityId(1):" + targetEntityId, module); - //Debug.logInfo("HtmlTreeExpandCollapseRenderer, depth(1):" + depth, module); - - ModelTree.ModelNode.Image expandCollapseImage = new ModelTree.ModelNode.Image(); - expandCollapseImage.setBorder("0"); - ModelTree.ModelNode.Link expandCollapseLink = new ModelTree.ModelNode.Link(); int openDepth = node.getModelTree().getOpenDepth(); if (depth >= openDepth && (targetEntityId == null || !targetEntityId.equals(entityId))) { @@ -128,6 +122,9 @@ renderLink(writer, context, expandCollapseLink); } else if (!hasChildren){ context.put("processChildren", Boolean.FALSE); + expandCollapseLink.setStyle("leafnode"); + expandCollapseLink.setText(" "); + renderLink(writer, context, expandCollapseLink); } } |
Free forum by Nabble | Edit this page |