From c059e09615e04c638530caf0a95d399b43e481b2 Mon Sep 17 00:00:00 2001 From: "Eric J. Bowersox" Date: Mon, 12 Nov 2001 23:42:56 +0000 Subject: [PATCH] fixed a minort bug in graphic menu handling --- .../servlets/format/menus/LeftMenu.java | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/com/silverwrist/venice/servlets/format/menus/LeftMenu.java b/src/com/silverwrist/venice/servlets/format/menus/LeftMenu.java index 3b8953b..00cc15c 100644 --- a/src/com/silverwrist/venice/servlets/format/menus/LeftMenu.java +++ b/src/com/silverwrist/venice/servlets/format/menus/LeftMenu.java @@ -62,12 +62,24 @@ public class LeftMenu implements ComponentRender static class Separator implements ComponentRender { + private ComponentRender cr; + Separator() - { // do nothing + { + this.cr = null; + + } // end constructor + + Separator(ComponentRender cr) + { + this.cr = cr; + } // end constructor public void renderHere(Writer out, RenderData rdat) throws IOException { + if (cr!=null) + cr.renderHere(out,rdat); out.write("
\n"); } // end renderHere @@ -80,7 +92,7 @@ public class LeftMenu implements ComponentRender */ private static Category logger = Category.getInstance(LeftMenu.class); - private static final Separator separator_singleton = new Separator(); + private static final Separator separator_singleton = new Separator(null); /*-------------------------------------------------------------------------------- * Attributes @@ -117,13 +129,13 @@ public class LeftMenu implements ComponentRender else if (n.getNodeName().equals("text")) { // add a text item DOMElementHelper h = new DOMElementHelper((Element)n); - menu_items.add(new TextItem(h.getElementText())); + menu_items.add(new Separator(new TextItem(h.getElementText()))); } // end else if else if (n.getNodeName().equals("link")) menu_items.add(new LinkItem((Element)n)); else if (n.getNodeName().equals("image")) - menu_items.add(new ImageItem((Element)n)); + menu_items.add(new Separator(new ImageItem((Element)n))); else { // menu definition has an unknown item logger.fatal("unknown element <" + n.getNodeName() + "/> inside ");