From 48e967375da6955829305ffd7249e7da8a09fdd4 Mon Sep 17 00:00:00 2001 From: bwalding Date: Thu, 17 Jul 2003 10:44:05 +0000 Subject: [PATCH] o Unallow the nav bean to count children. Turns out it was simpler to do it in jelly. o Add new style for img.handle (no border, little bit of right padding) o Update the templates to draw handles I'm still not 100% on drawing an expanded handle on an uncollapsible node. I think we could do to remove the little - in front of every item too. PR: MAVEN-579 git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@113659 13f79535-47bb-0310-9956-ffa450edef68 --- xdoc/src/main/org/apache/maven/NavBean.java | 12 +-------- xdoc/src/plugin-resources/css/maven.css | 5 ++++ .../src/plugin-resources/images/collapsed.png | Bin 0 -> 963 bytes xdoc/src/plugin-resources/images/expanded.png | Bin 0 -> 166 bytes .../test/org/apache/maven/NavBeanTest.java | 23 +----------------- 5 files changed, 7 insertions(+), 33 deletions(-) create mode 100644 xdoc/src/plugin-resources/images/collapsed.png create mode 100644 xdoc/src/plugin-resources/images/expanded.png diff --git a/xdoc/src/main/org/apache/maven/NavBean.java b/xdoc/src/main/org/apache/maven/NavBean.java index 48deb708..bd90ca4b 100644 --- a/xdoc/src/main/org/apache/maven/NavBean.java +++ b/xdoc/src/main/org/apache/maven/NavBean.java @@ -64,7 +64,7 @@ import org.dom4j.tree.DefaultElement; /** * @author Ben Walding - * @version $Id: NavBean.java,v 1.5 2003/07/17 09:33:12 bwalding Exp $ + * @version $Id: NavBean.java,v 1.6 2003/07/17 10:44:05 bwalding Exp $ */ public class NavBean { @@ -96,16 +96,6 @@ public class NavBean return getAttribute(elem, "href", null); } - /** - * Assumes that the node is visible. - * @param o - * @return the number of children for this node - */ - public int countChildren(DefaultElement elem) { - List l = elem.selectNodes("./item"); - return l.size(); - } - /** * Determines if the given node is collapsed. If a parent of this node is * collapsed, this will give spurious results. diff --git a/xdoc/src/plugin-resources/css/maven.css b/xdoc/src/plugin-resources/css/maven.css index 3178d83c..f3d53920 100644 --- a/xdoc/src/plugin-resources/css/maven.css +++ b/xdoc/src/plugin-resources/css/maven.css @@ -98,3 +98,8 @@ h3, h4 { margin-top: 1em; margin-bottom: 0; } + +img.handle { + border: 0; + padding-right: 2px; +} \ No newline at end of file diff --git a/xdoc/src/plugin-resources/images/collapsed.png b/xdoc/src/plugin-resources/images/collapsed.png new file mode 100644 index 0000000000000000000000000000000000000000..96be0fa53396190f13ce51b77e4f8ae885e10e04 GIT binary patch literal 963 zcmeAS@N?(olHy`uVBq!ia0vp^>>$j+3?x7IEPn{3SkfJR9T^xl_SO6joDAeEBzpw; zGB8xBGB7kWGcf%852Rl*Fq9fFFuY1&V6d9Oz#yJKDgLM%0|PTdfKQ0)#EBDu+W!9s zDjWr)Au!@XV6%$;aiFJ}OM?7@ftld?DPCZ9V&E+Bh%9Dc;1&j9Muu5)B!Gf)o-U3d y5>t~CS{T^e)YRD2)C|sYER#I2h{MiDj){To34`5KeU~s$5PG`$xvX>$j+1SGu;4zvI%mUKs7M+SzCeKo%WCjCx45bDP46hOx7_4S6Fo@?*ia+WGRLfc55n0T@z%2~Ij105p zNB{+8JY5_^B&H@O9AN#om}$=Ben Walding - * @version $Id: NavBeanTest.java,v 1.3 2003/07/17 09:33:12 bwalding Exp $ + * @version $Id: NavBeanTest.java,v 1.4 2003/07/17 10:44:03 bwalding Exp $ */ public class NavBeanTest extends TestCase { @@ -133,24 +132,4 @@ public class NavBeanTest extends TestCase String s = "At location " + location + ", looking to generate link to " + href + ", expecting collapse = " + expected; assertEquals(s, expected, nb.isCollapsed(node)); } - - public void testCountChildren() throws Exception - { - testCountChildren("/alpha/index.html", 2); - testCountChildren("/alpha/one/index.html", 0); - testCountChildren("/alpha/two/index.html", 0); - - testCountChildren("/beta/index.html", 2); - testCountChildren("/beta/one/index.html", 0); - testCountChildren("/beta/two/index.html", 0); - } - - public void testCountChildren(String href, int expected) - { - Node node = nb.getFirstNodeByHREF(href); - assertNotNull(node); - - String s = "At location " + href + ", expecting countChildren = " + expected; - assertEquals(s, expected, nb.countChildren((DefaultElement) node)); - } }