From: Matt <mat...@us...> - 2007-12-13 00:03:54
|
Update of /cvsroot/openqrm/base/openqrm-3.1.4-solaris/src/base/java/jlmenu/main/code/com/qlusters/jlmenu In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2979/base/openqrm-3.1.4-solaris/src/base/java/jlmenu/main/code/com/qlusters/jlmenu Added Files: MenuPage.java JLMenuTagMenu.java JLMenuTagItem.java JLMenuTagBody.java JLMenuTagFooter.java JavaMenu.java JavaVerticalMenu.java MenuItem.java MenuBuilder.java JavaHorizontalMenu.java JLMenuTagHeader.java Log Message: commit of the openQRM-server port for the Solaris OS by Siva --- NEW FILE: MenuBuilder.java --- /******************************************************************************* * The contents of this file are subject to the Qlusters Public License * Version 1.1 (the License); you may not use this file except in compliance * with the License. * You may obtain a copy of the License at * http://www.openqrm.org/content/view/33/69/. * * Software distributed under the License is distributed on an AS IS basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for * the specific language governing rights and limitations under the License. * * The Original Code is openQRM. * * The Initial Developer of the Original Code is Qlusters Corporation. Portions * created by Qlusters Corporation are Copyright (C) 2005-2007. All Rights * Reserved. * * Contributor(s): * * Description: * * Comments: ******************************************************************************/ package com.qlusters.jlmenu; import java.io.BufferedReader; import java.io.FileReader; import java.util.Iterator; import java.util.List; public class MenuBuilder { public static final String seperator = "|"; private MenuItem root = null; public MenuBuilder(MenuItem root) { this.root = root; } public MenuBuilder(String file, MenuItem root) { this(root); parseMenu(file); } public boolean parseMenu(String file) { BufferedReader reader = null; boolean result = false; try { reader = new BufferedReader(new FileReader(file)); result = parseMenu(reader); } catch (java.io.FileNotFoundException e) { System.err.println("Unable to find file " + file); } finally { try { if (reader != null) { reader.close(); } } catch (java.io.IOException e) { System.err.println("Unable to close file: " + e.getMessage()); } } return result; } /* (non-Javadoc) * @see com.qlusters.jlmenu.MenuBuilder#parseMenu(java.io.BufferedReader) */ public boolean parseMenu(BufferedReader reader) { boolean result = false; try { String line; MenuItem currentItem = root; int currentLevel = 1; boolean inComment = false; while ((line = reader.readLine()) != null) { line = line.trim(); // skip empty lines and comments int pos; String prefix = ""; String suffix = ""; boolean commentFound = false; if ((pos = line.indexOf("<!--")) != -1) { inComment = true; commentFound = true; prefix = line.substring(0, pos); } if ((pos = line.indexOf("-->")) != -1) { inComment = false; commentFound = true; suffix = line.substring(pos + 3); } if (commentFound) { line = prefix + suffix; } if (inComment && !commentFound) { // comment started, some lines before continue; } if (line.length() == 0 || line.charAt(0) == '#' || line.charAt(0) == ';') { continue; } String[] fields = line.split("[|]"); String[] tFields = new String[10]; int level = (line.charAt(0) != '%' ? fields[0].length() : fields[0].split("//").length); MenuItem newItem; for (int i = fields.length - 1; i >= 0; --i) { tFields[i] = fields[i]; } newItem = new MenuItem(tFields[1], tFields[1],tFields[2], tFields[3],tFields[4], tFields[5], stringToBool(tFields[5], true), stringToBool(tFields[6], false)); if (line.charAt(0) != '%') { if (level > currentLevel) { // change current item to last current child List children = currentItem.getChildren(); currentItem = (MenuItem) children.get(children.size()-1); currentLevel = level; } else while (level < currentLevel) { currentItem = currentItem.getParent(); currentLevel--; } currentItem.addChild(newItem); } else { // specified path addMenuItem(tFields[0].substring(1), newItem); } } result = true; } catch (java.io.IOException e) { System.err.println("Caught IOException: " + e.getMessage()); } return result; } protected boolean addMenuItem(int level, MenuItem item) { MenuItem lastItem = root; while (level > 1) { lastItem = lastItem.getLastChild(); if (lastItem == null) { // can't go down two levels at once. return false; } } lastItem.addChild(item); return true; } protected boolean addMenuItem(String path, MenuItem item) { MenuItem currentItem = root; if (path != null && path.length() > 0) { String[] pathIds = path.split("//"); find_path: for (int i = 0; i < pathIds.length; i++) { Iterator iter = currentItem.getChildren().iterator(); while (iter.hasNext()) { MenuItem iterItem = (MenuItem) iter.next(); if (iterItem.getId().equalsIgnoreCase(pathIds[i])) { currentItem = iterItem; continue find_path; } } // path not found MenuItem newItem = new MenuItem(pathIds[i], ""); currentItem.addChild(newItem); currentItem = newItem; } } currentItem.addChild(item); return true; } private boolean stringToBool(String str, boolean defaultValue) { if (str != null && str.length() > 0) { if (str.equalsIgnoreCase("true") || str.equals("1")) { return true; } else { return false; } } else { return defaultValue; } } } --- NEW FILE: MenuItem.java --- /******************************************************************************* * The contents of this file are subject to the Qlusters Public License * Version 1.1 (the License); you may not use this file except in compliance * with the License. * You may obtain a copy of the License at * http://www.openqrm.org/content/view/33/69/. * * Software distributed under the License is distributed on an AS IS basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for * the specific language governing rights and limitations under the License. * * The Original Code is openQRM. * * The Initial Developer of the Original Code is Qlusters Corporation. Portions * created by Qlusters Corporation are Copyright (C) 2005-2007. All Rights * Reserved. * * Contributor(s): * * Description: * * Comments: ******************************************************************************/ package com.qlusters.jlmenu; import java.util.ArrayList; import java.util.List; public class MenuItem { private String title = ""; private String description = ""; private String url = ""; private String icon = ""; private String target = ""; private boolean seperator = false; private boolean disabled = false; private boolean expanded = true; private MenuItem parent = null; private List<MenuItem> children = new ArrayList<MenuItem>(); private String id = ""; public MenuItem() { seperator = true; } private void createMenuItem(String id, String title, String url, String description, String icon, String target, boolean expanded, boolean disabled) { if (title == null) { System.err.println("Invalid menu item"); seperator=true; return; } this.title = title; this.id = title; if (id != null && id.length() > 0) { this.id = id; } this.description = (description != null ? description : ""); this.url = (url != null ? url : ""); this.icon = (icon != null ? icon : ""); this.target = (target != null ? target : ""); this.expanded = expanded; this.disabled = disabled; if (title.equals("---")) { seperator=true; } } public MenuItem(String id, String title, String url, String description, String icon, String target) { createMenuItem(id, title, url, description, icon, target, true, false); } public MenuItem(String title, String description) { createMenuItem(title, title, "", description, "", "", true, false); } public MenuItem(String id, String title, String url, String description, String icon, String target, boolean expanded, boolean disabled) { createMenuItem(id, title, url, description, icon, target, expanded, disabled); } public void addChild(MenuItem item) { item.parent = this; for (int i = 0; i < children.size(); i++) { MenuItem current = (MenuItem) children.get(i); if (current.id != null && !current.id.equals("---") && current.id.equalsIgnoreCase(item.getId())) { children.set(i, item); item.getChildren().addAll(current.getChildren()); return; } } children.add(item); } public String getDescription() { return description; } public String getIcon() { return icon; } public String getTarget() { return target; } public String getTitle() { return title; } public String getId() { return id; } public String getUrl() { return url; } public MenuItem getParent() { return parent; } public List<MenuItem> getChildren() { return children; } public MenuItem getLastChild() { if (children.size() > 0) { return (MenuItem) children.get(children.size()); } else { return null; } } public boolean hasChildren() { return (children.size() > 0); } public boolean isFirstChild() { return (parent.children.indexOf(this) == 0); } public boolean isLastChild() { return (parent.children.indexOf(this) == parent.children.size()-1); } public boolean isSeperator() { return seperator; } public boolean isDisabled() { return disabled; } public boolean isExpanded() { return expanded; } @Override public String toString() { return "title=" + title + ", description=" + description + ", url=" + url + ", id=" + id + ", icon=" + icon + ", target=" + target + ", disabled=" + disabled + ", expanded=" + expanded + ", #childeren=" + children.size(); } } --- NEW FILE: JLMenuTagItem.java --- /******************************************************************************* * The contents of this file are subject to the Qlusters Public License * Version 1.1 (the License); you may not use this file except in compliance * with the License. * You may obtain a copy of the License at * http://www.openqrm.org/content/view/33/69/. * * Software distributed under the License is distributed on an AS IS basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for * the specific language governing rights and limitations under the License. * * The Original Code is openQRM. * * The Initial Developer of the Original Code is Qlusters Corporation. Portions * created by Qlusters Corporation are Copyright (C) 2005-2007. All Rights * Reserved. * * Contributor(s): * * Description: * * Comments: ******************************************************************************/ package com.qlusters.jlmenu; import java.util.Iterator; import javax.servlet.jsp.JspException; import javax.servlet.jsp.tagext.BodyTagSupport; import javax.servlet.jsp.tagext.Tag; import org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager; public class JLMenuTagItem extends BodyTagSupport { Tag parent = null; String title = null; String description = null; String url = null; String disabledStr = null; String expandedStr = null; String icon = null; String target = null; String path = null; MenuItem item; private Object safeEvaluate(String tag, String value, Class cls) throws JspException { if (value == null) { return null; } return ExpressionEvaluatorManager.evaluate(tag, value, cls, this, pageContext); } private Object safeEvaluate(String tag, String value, Object def) throws JspException { if (value == null) { return def; } Object res = safeEvaluate(tag, value, def.getClass()); return res == null ? def : res; } @Override public int doStartTag() throws JspException { // until servlet 2.4 is supported... id = (String) safeEvaluate("id", id, String.class); title = (String) safeEvaluate("title", title, String.class); url = (String) safeEvaluate("url", url, String.class); description = (String) safeEvaluate("description", description, String.class); icon = (String) safeEvaluate("icon", icon, String.class); target = (String) safeEvaluate("target", target, String.class); boolean expanded = (Boolean) safeEvaluate("expanded", expandedStr, false); boolean disabled = (Boolean) safeEvaluate("disabled", disabledStr, false); item = new MenuItem(id, title, url, description, icon, target, expanded, disabled); parent = (Tag) pageContext.getRequest().getAttribute("menu-item"); addItem(item, path); pageContext.getRequest().setAttribute("menu-item", this); return super.doStartTag(); } private void addItem(MenuItem item, String path) throws JspException { MenuItem parentItem = null; if (path == null) { if (parent instanceof JLMenuTagMenu) { parentItem = ((JLMenuTagMenu) parent).getRoot(); } else { parentItem = ((JLMenuTagItem) parent).getItem(); } } else { // if path != null, we're just under jlmenu:menu parentItem = ((JLMenuTagMenu) parent).getRoot(); String[] pathTitles = path.split("//"); find_path: for (int i = 0; i < pathTitles.length; i++) { Iterator iter = parentItem.getChildren().iterator(); while (iter.hasNext()) { MenuItem iterItem = (MenuItem) iter.next(); if (iterItem.getTitle().equalsIgnoreCase(pathTitles[i])) { parentItem = iterItem; continue find_path; } } // path not found, create as neccessary MenuItem newItem = new MenuItem(pathTitles[i], ""); parentItem.addChild(newItem); parentItem = newItem; } } parentItem.addChild(item); } @Override public int doEndTag() throws JspException { pageContext.getRequest().setAttribute("menu-item", parent); return EVAL_PAGE; } @Override public void release() { this.item = null; super.release(); } private MenuItem getItem() { return item; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getDisabled() { return disabledStr; } public String getExpanded() { return expandedStr; } public void setDisabled(String disabled) { this.disabledStr = disabled; } public void setExpanded(String expanded) { this.expandedStr = expanded; } public String getIcon() { return icon; } public void setIcon(String icon) { this.icon = icon; } public String getTarget() { return target; } public void setTarget(String target) { this.target = target; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getPath() { return path; } public void setPath(String path) { this.path = path; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } } --- NEW FILE: JavaHorizontalMenu.java --- /******************************************************************************* * The contents of this file are subject to the Qlusters Public License * Version 1.1 (the License); you may not use this file except in compliance * with the License. * You may obtain a copy of the License at * http://www.openqrm.org/content/view/33/69/. * * Software distributed under the License is distributed on an AS IS basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for * the specific language governing rights and limitations under the License. * * The Original Code is openQRM. * * The Initial Developer of the Original Code is Qlusters Corporation. Portions * created by Qlusters Corporation are Copyright (C) 2005-2007. All Rights * Reserved. * * Contributor(s): * * Description: * * Comments: ******************************************************************************/ package com.qlusters.jlmenu; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Iterator; import java.util.TreeMap; public class JavaHorizontalMenu extends JavaMenu { protected String menuBody = ""; protected String menuMoveLayers = ""; protected TreeMap<Integer, String> menuFooter = new TreeMap<Integer, String>(); protected String childList = ""; protected String parentList = ""; protected String parentShortList = ""; protected int maxId = 0; protected int firstId = 0; protected Boolean clickToOpen = false; public JavaHorizontalMenu(String menuKey, String title) { super(menuKey, title); } public JavaHorizontalMenu(String menuKey, String title, String imgPrefix, String libjsPrefix) { super(menuKey, title, imgPrefix, libjsPrefix); } public void setClickToOpen(Boolean clickToOpen) { this.clickToOpen = clickToOpen; } public Boolean getClickToOpen() { return clickToOpen; } private String generateRefDiv(MenuItem item, int parentId, int id, boolean parentHasIcons) { if (!item.isDisabled()) return "<div id='refL" + id + "' class='item'>\n" + "<a id=\"" + item.getId() + "\" href=\"" + (item.getUrl().length() > 0 ? item.getUrl() : "javascript:void(0)") + "\" " + (item.getTarget().length() > 0 ? "target=\"" + item.getTarget() + "\" " : "") + (item.hasChildren() ? "onmouseover=\"moveLayerX('L" + id + "') ; moveLayerY('L" + id + "') ; LMPopUp('L" + id + "', false);\">" : "onmouseover=\"LMPopUp('L" + parentId + "', true);\">") + "<img align='top' src='" + imgPrefix + "/transparent.png' width='1' height='16' border='0' alt='' />" + (parentHasIcons ? (item.getIcon().length() > 0 ? "<img align='top' src='" + item.getIcon() + "' width='16' height='16' border='0' alt='O' />" : "<img align='top' src='" + imgPrefix + "/transparent.png' width='16' height='16' border='0' alt=' ' />") : "") + " " + item.getTitle() + (item.hasChildren() ? "<img class='fwdarr' src='" + imgPrefix + "/forward-arrow.png' width='4' height='7' border='0' alt='>>' />" : "") + " " + "</a>\n" + "</div>\n"; else return "<div id='refL" + id + "' class='disableditem'>\n" + "<a>" + "<img align='top' src='" + imgPrefix + "/transparent.png' width='1' height='16' border='0' alt='' />" + (parentHasIcons ? (item.getIcon().length() > 0 ? "<img align='top' src='" + item.getIcon() + "' width='16' height='16' border='0' alt='O' />" : "<img align='top' src='" + imgPrefix + "/transparent.png' width='16' height='16' border='0' alt=' ' />") : "") + " " + item.getTitle() + /* (item.hasChildren() ? "<img class='fwdarr' src='"+imgPrefix+"/forward-arrow-disabled.png' width='4' height='7' border='0' alt='>>' />" : "") + */ " " + "</a>\n" + "</div>\n"; } protected int processChildItem(StringBuffer buf, MenuItem item, int parentId, int lastId, int level, boolean hasIcons) { int id = lastId + 1; if (buf != null) { if (item.isSeperator()) { buf.append("<div class='separator'> </div>\n"); return lastId; } buf.append(generateRefDiv(item, parentId, id, hasIcons)); } if (childList.length() > 0) { childList += ",'L" + id + "'"; parentList += ",'L" + parentId + "'"; } else { childList += "'L" + id + "'"; parentList += "'L" + parentId + "'"; } if (item.hasChildren() && !item.isDisabled()) { if (parentShortList.length() > 0) { parentShortList += ",'L" + id + "'"; } else { parentShortList += "'L" + id + "'"; } StringBuffer childBuf = new StringBuffer( "<div id='L" + id + "' class='submenu' onmouseover='clearLMTO();' onmouseout='setLMTO();'>\n" + "<table border='0' cellspacing='0' cellpadding='0'>\n" + "<tr>\n" + "<td nowrap='nowrap'>\n" + "<div class='subframe'>\n"); boolean childrenHaveIcons = false; Iterator iter = item.getChildren().iterator(); while (iter.hasNext()) { MenuItem child = (MenuItem) iter.next(); if (child.getIcon().length() > 0) { childrenHaveIcons = true; break; } } iter = item.getChildren().iterator(); int nextId = id; while (iter.hasNext()) { MenuItem child = (MenuItem) iter.next(); nextId = processChildItem(childBuf, child, id, nextId, level + 1, childrenHaveIcons); } childBuf.append("</div>\n" + "</td>\n" + "</tr>\n" + "</table>\n" + "</div>\n\n"); menuFooter.put(new Integer(id), childBuf.toString()); id = nextId; } return id; } protected int processRootItem(MenuItem item, int lastId) { int id = lastId + 1; if (menuBody.length() == 0) { firstId = id; } if (item.isSeperator()) { menuBody += "<td><div class='horbarseperator'/></td>\n"; return lastId; } if (item.isDisabled()) { menuBody += "<td><div id='" + menuKey + "L" + id + "' class='horbaritemdisabled'>" + "<a " + " title='" + item.getDescription() + "'>" + "<img align='top' src='" + imgPrefix + "/transparent.png' width='1' height='16' border='0' alt='' />" + (item.getIcon().length() > 0 ? "<img align='top' src='" + item.getIcon() + "' width='16' height='16' border='0' alt='O' /> " : "") + item.getTitle() + /* (item.hasChildren() ? " <img src='"+imgPrefix+"/down-arrow-disabled.png' width='9' height='5' border='0' alt='>>' />" : "")+ */ " </a></div></td>\n"; return id; } menuBody += "<td><div id='" + menuKey + "L" + id + "' class='horbaritem' onmouseover='clearLMTO();' onmouseout='setLMTO();'>" + "<a href=\"" + (item.getUrl().length() > 0 ? item.getUrl() : "javascript:void(0)") + "\" " + (item.getTarget().length() > 0 ? "target=\"" + item.getTarget() + "\" " : "") + (item.hasChildren() ? (clickToOpen ? "onmousedown=\"moveLayerX1('L" + id + "', '" + menuKey + "') ; LMPopUp('L" + id + "', false);\"" : "onmouseover=\"moveLayerX1('L" + id + "', '" + menuKey + "') ; LMPopUp('L" + id + "', false);\"") : "onmouseover='shutdown();'") + " title='" + item.getDescription() + "'>" + "<img align='top' src='" + imgPrefix + "/transparent.png' width='1' height='16' border='0' alt='' />" + (item.getIcon().length() > 0 ? "<img align='top' src='" + item.getIcon() + "' width='16' height='16' border='0' alt='O' /> " : "") + item.getTitle() + (item.hasChildren() ? " <img src='" + imgPrefix + "/down-arrow.png' border='0' alt='>>' />" : "") + " </a></div></td>\n"; if (item.hasChildren()) { menuMoveLayers += " setTop('L" + id + "', " + menuKey + "TOP + " + menuKey + "HEIGHT);\n" + " moveLayerX1('L" + id + "', '" + menuKey + "');\n"; } if (item.hasChildren()) { id = processChildItem(null, item, 0, id - 1, 1, false); } return id; } @Override public void prepareMenu() { if (menuPage != null) { Integer pageMaxId = (Integer) menuPage.getAttribute("horizMaxId"); if (pageMaxId != null) { maxId = pageMaxId.intValue(); } } Iterator iter = root.getChildren().iterator(); while (iter.hasNext()) { MenuItem child = (MenuItem) iter.next(); maxId = processRootItem(child, maxId); } if (menuPage != null) { menuPage.setAttribute("horizMaxId", new Integer(maxId)); ArrayList horizMenuSet = (ArrayList) menuPage .getAttribute("horizMenus"); if (horizMenuSet == null) { horizMenuSet = new ArrayList(); } horizMenuSet.add(this); menuPage.setAttribute("horizMenus", horizMenuSet); } } @Override public void printMenu(PrintWriter out) { out.print("<div class='horbar'>\n" + "<table border='0' cellspacing='0' cellpadding='0'>\n" + "<tr>\n" + menuBody + "</tr>\n" + "</table>\n" + "</div>\n"); } @Override public void printHeader(PrintWriter out) { super.printHeader(out); } @Override public void printFooter(PrintWriter out) { if (menuPage == null || !menuPage.getHeaderPrint(JavaHorizontalMenu.class)) { String printChildList = null; String printParentList = null; String printParentShortList = null; String printMenuMoveLayers = ""; String printMenuOffsets = ""; Integer printMaxId = new Integer(maxId); if (menuPage == null) { printChildList = childList; printParentList = parentList; printParentShortList = parentShortList; printMenuMoveLayers = menuMoveLayers; printMenuOffsets = " var " + menuKey + "TOP = getOffsetTop('" + menuKey + "L" + firstId + "');\n" + " var " + menuKey + "HEIGHT = getOffsetHeight('" + menuKey + "L" + firstId + "');\n"; } else { printMaxId = (Integer) menuPage.getAttribute("horizMaxId"); ArrayList horizMenuSet = (ArrayList) menuPage .getAttribute("horizMenus"); Iterator iter = horizMenuSet.iterator(); while (iter.hasNext()) { JavaHorizontalMenu menu = (JavaHorizontalMenu) iter.next(); if (menu.childList.length() > 0) { if (printChildList != null) { printChildList += "," + menu.childList; } else { printChildList = menu.childList; } } if (menu.parentList.length() > 0) { if (printParentList != null) { printParentList += "," + menu.parentList; } else { printParentList = menu.parentList; } } if (menu.parentShortList.length() > 0) { if (printParentShortList != null) { printParentShortList += "," + menu.parentShortList; } else { printParentShortList = menu.parentShortList; } } printMenuMoveLayers += menu.menuMoveLayers; printMenuOffsets += " var " + menu.menuKey + "TOP = getOffsetTop('" + menu.menuKey + "L" + menu.firstId + "');\n" + " var " + menu.menuKey + "HEIGHT = getOffsetHeight('" + menu.menuKey + "L" + menu.firstId + "');\n"; } } out .print("<script language='JavaScript' type='text/javascript' src='" + libjsPrefix + "/layersmenu-library.js'></script>\n" + "<script language='JavaScript' type='text/javascript' src='" + libjsPrefix + "/layersmenu.js'></script>\n" + "\n" + "<!-- beginning of menu header - PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/ -->\n" + "\n" + "<script language='JavaScript' type='text/javascript'>\n" + "<!--\n" + "\n" + "menuTopShift = 6;\n" + "menuRightShift = 7;\n" + "menuLeftShift = 2;\n" + "\n" + "var thresholdY = 1;\n" + "var abscissaStep = 140;\n" + "\n" + "toBeHidden = new Array();\n" + "toBeHiddenLeft = new Array();\n" + "toBeHiddenTop = new Array();\n" + "\n" + "listl = [" + printParentShortList + "];\n" + "var numl = listl.length;\n" + "\n" + "father = new Array();\n" + "for (i=1; i<=" + printMaxId + "; i++) {\n" + " father['L' + i] = '';\n" + "}\n" + "father_keys = [" + printChildList + "];\n" + "father_vals = [" + printParentList + "];\n" + "for (i=0; i<father_keys.length; i++) {\n" + " father[father_keys[i]] = father_vals[i];\n" + "}\n" + "\n" + "lwidth = new Array();\n" + "var lwidthDetected = 0;\n" + "\n" + "function moveLayers()\n" + "{\n" + " if (!lwidthDetected) {\n" + " for (i=0; i<numl; i++) {\n" + " lwidth[listl[i]] = getOffsetWidth(listl[i]);\n" + " }\n" + " lwidthDetected = 1;\n" + " }\n" + " if (IE4) {\n" + " for (i=0; i<numl; i++) {\n" + " setWidth(listl[i], abscissaStep);\n" + " }\n" + " }\n" + printMenuOffsets + printMenuMoveLayers + "\n" + "}\n" + "\n" + "back = new Array();\n" + "for (i=1; i<=" + maxId + "; i++) {\n" + " back['L' + i] = 0;\n" + "}\n" + "\n" + "// -->\n" + "</script>\n" + "\n" + "<!-- end of menu header - PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/ -->\n"); if (menuPage != null) { menuPage.setHeaderPrint(JavaHorizontalMenu.class); } } if (menuPage == null || !menuPage.getFooterPrint(JavaHorizontalMenu.class)) { out .print("<!-- beginning of menu footer - PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/ -->\n"); } Iterator iter = menuFooter.keySet().iterator(); while (iter.hasNext()) { out.print(menuFooter.get(iter.next())); } if (menuPage == null || !menuPage.getFooterPrint(JavaHorizontalMenu.class)) { out .print("<script language='JavaScript' type='text/javascript'>\n" + "<!--\n" + "loaded = 1;\n" + "//-->\n" + "</script>\n" + "\n" + "<!-- end of menu footer - PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/ -->\n"); if (menuPage != null) { menuPage.setFooterPrint(JavaHorizontalMenu.class); } } } } --- NEW FILE: MenuPage.java --- /******************************************************************************* * The contents of this file are subject to the Qlusters Public License * Version 1.1 (the License); you may not use this file except in compliance * with the License. * You may obtain a copy of the License at * http://www.openqrm.org/content/view/33/69/. * * Software distributed under the License is distributed on an AS IS basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for * the specific language governing rights and limitations under the License. * * The Original Code is openQRM. * * The Initial Developer of the Original Code is Qlusters Corporation. Portions * created by Qlusters Corporation are Copyright (C) 2005-2007. All Rights * Reserved. * * Contributor(s): * * Description: * * Comments: ******************************************************************************/ package com.qlusters.jlmenu; import java.util.HashMap; import java.util.TreeSet; public class MenuPage { private TreeSet<String> headerPrintSet = new TreeSet<String>(); private TreeSet<String> footerPrintSet = new TreeSet<String>(); private HashMap<String,Object> hashMap = new HashMap<String,Object>(); public MenuPage() { } protected boolean getHeaderPrint(java.lang.Class headerClass) { return headerPrintSet.contains(headerClass.getName()); } protected void setHeaderPrint(Class headerClass) { headerPrintSet.add(headerClass.getName()); } protected boolean getFooterPrint(java.lang.Class footerClass) { return footerPrintSet.contains(footerClass.getName()); } protected void setFooterPrint(Class footerClass) { footerPrintSet.add(footerClass.getName()); } protected void setAttribute(String key, Object value) { hashMap.put(key, value); } protected Object getAttribute(String key) { return hashMap.get(key); } } --- NEW FILE: JLMenuTagMenu.java --- /******************************************************************************* * The contents of this file are subject to the Qlusters Public License * Version 1.1 (the License); you may not use this file except in compliance * with the License. * You may obtain a copy of the License at * http://www.openqrm.org/content/view/33/69/. * * Software distributed under the License is distributed on an AS IS basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for * the specific language governing rights and limitations under the License. * * The Original Code is openQRM. * * The Initial Developer of the Original Code is Qlusters Corporation. Portions * created by Qlusters Corporation are Copyright (C) 2005-2007. All Rights * Reserved. * * Contributor(s): * * Description: * * Comments: ******************************************************************************/ package com.qlusters.jlmenu; import java.io.BufferedReader; import java.io.StringReader; import java.io.StringWriter; import java.util.HashMap; import javax.servlet.jsp.JspException; import javax.servlet.jsp.el.ELException; import javax.servlet.jsp.el.ELParseException; import javax.servlet.jsp.el.Expression; import javax.servlet.jsp.el.ExpressionEvaluator; import javax.servlet.jsp.el.FunctionMapper; import javax.servlet.jsp.el.VariableResolver; import javax.servlet.jsp.tagext.BodyTagSupport; import org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager; public class JLMenuTagMenu extends BodyTagSupport { static final long serialVersionUID = -7608003420112900294L; public static final int MENU_TYPE_DEBUG = 1; public static final int MENU_TYPE_VERTICAL = 2; public static final int MENU_TYPE_HORIZONTAL = 3; public static final int SIMPLE_BODY=1; public static final int TAGS_BODY=2; private String title = ""; private int type = MENU_TYPE_HORIZONTAL; private int bodyType = TAGS_BODY; private String imgPrefix = "/menus/menuimages"; private String libjsPrefix = "/menus/libjs"; private String clickToOpen = "true"; private Boolean clickToOpenBool = true; private MenuBuilder menuBuilder = null; private JavaMenu menu = null; private MenuItem root = null; @Override public int doStartTag() throws JspException { root = new MenuItem(); // until servlet 2.4 is supported... id = (String) ExpressionEvaluatorManager.evaluate("id", id, String.class, this, pageContext); title = (String) ExpressionEvaluatorManager.evaluate("title", title, String.class, this, pageContext); if (clickToOpen != null) { clickToOpenBool = (Boolean) ExpressionEvaluatorManager.evaluate("clickToOpen", clickToOpen, Boolean.class, this, pageContext); } if (bodyType == SIMPLE_BODY) { menuBuilder = new MenuBuilder(root); } pageContext.getRequest().setAttribute("menu-item", this); // pageContext.getRequest().setAttribute("menu_" + id + "_builder", menuBuilder); return EVAL_BODY_BUFFERED; } @Override public int doAfterBody() throws JspException { if (bodyType == TAGS_BODY) { return SKIP_BODY; // body is evaluated by tags } // If we've been through the body, grab // the contents String output = ""; if(bodyContent != null) { StringWriter sw = new StringWriter(); try { bodyContent.writeOut(sw); output = sw.toString(); } catch(java.io.IOException e) {} } // Resolve the actual command by assuming // the provided value is a script in the // expression language ExpressionEvaluator ee = pageContext.getExpressionEvaluator(); VariableResolver vr = pageContext.getVariableResolver(); // No default function mapper is provided or // needed FunctionMapper fm = null; Expression expr = null; try { expr = ee.parseExpression(output, String.class, fm); } catch (ELParseException e) { throw new JspException( "Unable to parse expression: " + output, e); } catch (ELException e) { throw new JspException( "Unable to evaluate expression" + output, e); } try { output = (String) expr.evaluate(vr); } catch (ELException e) { throw new JspException( "Unable to evaluate expression: " + output, e); } menuBuilder.parseMenu(new BufferedReader(new StringReader(output))); return SKIP_BODY; } @Override public int doEndTag() throws JspException { switch (type) { case MENU_TYPE_VERTICAL: menu = new JavaVerticalMenu(id, title, imgPrefix, libjsPrefix); break; case MENU_TYPE_HORIZONTAL: menu = new JavaHorizontalMenu(id, title, imgPrefix, libjsPrefix); ((JavaHorizontalMenu) menu).setClickToOpen(clickToOpenBool); break; case MENU_TYPE_DEBUG: menu = new JavaMenu(id, title, imgPrefix, libjsPrefix); } MenuPage menuPage = (MenuPage) pageContext.getRequest().getAttribute("JLMenu_page"); if (menuPage == null) { menuPage = new MenuPage(); pageContext.getRequest().setAttribute("JLMenu_page", menuPage); } menu.setRoot(root); menu.setMenuPage(menuPage); menu.prepareMenu(); HashMap menuMap = (HashMap) pageContext.getRequest().getAttribute("JLMenu_menus"); if (menuMap == null) { menuMap = new HashMap(); } menuMap.put(id, menu); pageContext.getRequest().setAttribute("JLMenu_menus", menuMap); return EVAL_PAGE; } @Override public void release() { menu = null; root = null; super.release(); } public String getType() { switch (type) { case MENU_TYPE_VERTICAL: return "Vertical"; case MENU_TYPE_HORIZONTAL: return "Horizontal"; case MENU_TYPE_DEBUG: default: return "DEBUG"; } } public void setType(String type) { if (type.equalsIgnoreCase("vertical")) { this.type = MENU_TYPE_VERTICAL; } else if (type.equalsIgnoreCase("horizontal")) { this.type = MENU_TYPE_HORIZONTAL; } else { this.type = MENU_TYPE_DEBUG; } } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getImgPrefix() { return imgPrefix; } public void setImgPrefix(String imgPrefix) { this.imgPrefix = imgPrefix; } public String getLibjsPrefix() { return libjsPrefix; } public void setLibjsPrefix(String libjsPrefix) { this.libjsPrefix = libjsPrefix; } public String getBodyType() { return bodyType == TAGS_BODY ? "tags" : "simple"; } public void setBodyType(String bodyType) { if (bodyType.equalsIgnoreCase("tags")) { this.bodyType = TAGS_BODY; } else { this.bodyType = SIMPLE_BODY; } } public void setClickToOpen(String clickToOpen) { this.clickToOpen = clickToOpen; } public String getClickToOpen() { return clickToOpen; } public MenuItem getRoot() { return root; } } --- NEW FILE: JavaMenu.java --- /******************************************************************************* * The contents of this file are subject to the Qlusters Public License * Version 1.1 (the License); you may not use this file except in compliance * with the License. * You may obtain a copy of the License at * http://www.openqrm.org/content/view/33/69/. * * Software distributed under the License is distributed on an AS IS basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for * the specific language governing rights and limitations under the License. * * The Original Code is openQRM. * * The Initial Developer of the Original Code is Qlusters Corporation. Portions * created by Qlusters Corporation are Copyright (C) 2005-2007. All Rights * Reserved. * * Contributor(s): * * Description: * * Comments: ******************************************************************************/ package com.qlusters.jlmenu; import java.io.PrintWriter; import java.util.Iterator; public class JavaMenu extends Object { protected MenuItem root = new MenuItem(); protected String title; protected String menuKey; protected String imgPrefix = "/menus/menuimages"; protected String libjsPrefix = "/menus/libjs"; protected MenuPage menuPage = null; protected Boolean TRUE = new Boolean(true); protected Boolean FALSE = new Boolean(false); public JavaMenu(String menuKey, String title) { this.root = new MenuItem("root","root"); this.menuKey = menuKey; this.title = title; } public JavaMenu(String menuKey, String title, String imgPrefix, String libjsPrefix) { this.root = new MenuItem("root","root"); this.menuKey = menuKey; this.title = title; this.imgPrefix = imgPrefix; this.libjsPrefix = libjsPrefix; } public void prepareMenu() { } public boolean buildMenu(String filename) { MenuBuilder menuBuilder = new MenuBuilder(root); menuBuilder.parseMenu(filename); prepareMenu(); return true; } public void setRoot(MenuItem root) { this.root = root; } public void printMenuItem(PrintWriter out, MenuItem droot, int level) { if (!droot.hasChildren()) return; Iterator nodes = droot.getChildren().iterator(); while (nodes.hasNext()) { MenuItem item = (MenuItem) nodes.next(); out.println("Item:" + level + "|" + item.getTitle() + "|" + item.getUrl() + "|" + item.getDescription() + "|" + item.getIcon() + "|"); if (item.hasChildren()) { printMenuItem(out, item, level + 1); } } } public void printMenu(PrintWriter out) { printMenuItem(out, root, 1); } public void printHeader(PrintWriter out) { if (menuPage == null || !menuPage.getHeaderPrint(JavaMenu.class)) { out.print( "<script language='JavaScript' type='text/javascript'>\n"+ "<!--\n"+ "// PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/\n"+ "\n"+ "DOM = (document.getElementById) ? 1 : 0;\n"+ "NS4 = (document.layers) ? 1 : 0;\n"+ "// We need to explicitly detect Konqueror\n"+ "// because Konqueror 3 sets IE = 1 ... AAAAAAAAAARGHHH!!!\n"+ "Konqueror = (navigator.userAgent.indexOf('Konqueror') > -1) ? 1 : 0;\n"+ "// We need to detect Konqueror 2.2 as it does not handle the window.onresize event\n"+ "Konqueror22 = (navigator.userAgent.indexOf('Konqueror 2.2') > -1 || navigator.userAgent.indexOf('Konqueror/2.2') > -1) ? 1 : 0;\n"+ "Konqueror30 =\n"+ " (\n"+ " navigator.userAgent.indexOf('Konqueror 3.0') > -1\n"+ " || navigator.userAgent.indexOf('Konqueror/3.0') > -1\n"+ " || navigator.userAgent.indexOf('Konqueror 3;') > -1\n"+ " || navigator.userAgent.indexOf('Konqueror/3;') > -1\n"+ " || navigator.userAgent.indexOf('Konqueror 3)') > -1\n"+ " || navigator.userAgent.indexOf('Konqueror/3)') > -1\n"+ " )\n"+ " ? 1 : 0;\n"+ "Konqueror31 = (navigator.userAgent.indexOf('Konqueror 3.1') > -1 || navigator.userAgent.indexOf('Konqueror/3.1') > -1) ? 1 : 0;\n"+ "// We need to detect Konqueror 3.2 and 3.3 as they are affected by the see-through effect only for 2 form elements\n"+ "Konqueror32 = (navigator.userAgent.indexOf('Konqueror 3.2') > -1 || navigator.userAgent.indexOf('Konqueror/3.2') > -1) ? 1 : 0;\n"+ "Konqueror33 = (navigator.userAgent.indexOf('Konqueror 3.3') > -1 || navigator.userAgent.indexOf('Konqueror/3.3') > -1) ? 1 : 0;\n"+ "Opera = (navigator.userAgent.indexOf('Opera') > -1) ? 1 : 0;\n"+ "Opera5 = (navigator.userAgent.indexOf('Opera 5') > -1 || navigator.userAgent.indexOf('Opera/5') > -1) ? 1 : 0;\n"+ "Opera6 = (navigator.userAgent.indexOf('Opera 6') > -1 || navigator.userAgent.indexOf('Opera/6') > -1) ? 1 : 0;\n"+ "Opera56 = Opera5 || Opera6;\n"+ "IE = (navigator.userAgent.indexOf('MSIE') > -1) ? 1 : 0;\n"+ "IE = IE && !Opera;\n"+ "IE5 = IE && DOM;\n"+ "IE4 = (document.all) ? 1 : 0;\n"+ "IE4 = IE4 && IE && !DOM;\n"+ "// -->\n"+ "</script>\n" ); if (menuPage != null) { menuPage.setHeaderPrint(JavaMenu.class); } } } public void printFooter(PrintWriter out) { } public void setTitle(String title) { this.title = title; } public MenuPage getMenuPage() { return menuPage; } public void setMenuPage(MenuPage menuPage) { this.menuPage = menuPage; } } --- NEW FILE: JLMenuTagFooter.java --- /******************************************************************************* * The contents of this file are subject to the Qlusters Public License * Version 1.1 (the License); you may not use this file except in compliance * with the License. * You may obtain a copy of the License at * http://www.openqrm.org/content/view/33/69/. * * Software distributed under the License is distributed on an AS IS basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for * the specific language governing rights and limitations under the License. * * The Original Code is openQRM. * * The Initial Developer of the Original Code is Qlusters Corporation. Portions * created by Qlusters Corporation are Copyright (C) 2005-2007. All Rights * Reserved. * * Contributor(s): * * Description: * * Comments: ******************************************************************************/ package com.qlusters.jlmenu; import java.io.PrintWriter; import java.util.HashMap; import java.util.Iterator; import javax.servlet.jsp.tagext.TagSupport; public class JLMenuTagFooter extends TagSupport { static final long serialVersionUID = 788030897462454836L; @Override public int doStartTag() { HashMap menuMap = (HashMap) pageContext.getRequest().getAttribute("JLMenu_menus"); if (menuMap == null) { // no menu on the page - no need to print footer return SKIP_BODY; } Iterator iter = menuMap.values().iterator(); while (iter.hasNext()) { JavaMenu menu = (JavaMenu) iter.next(); if (menu != null) { menu.printFooter(new PrintWriter(pageContext.getOut())); } } return SKIP_BODY; } @Override public int doEndTag() { return EVAL_PAGE; } } --- NEW FILE: JLMenuTagBody.java --- /******************************************************************************* * The contents of this file are subject to the Qlusters Public License * Version 1.1 (the License); you may not use this file except in compliance * with the License. * You may obtain a copy of the License at * http://www.openqrm.org/content/view/33/69/. * * Software distributed under the License is distributed on an AS IS basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for * the specific language governing rights and limitations under the License. * * The Original Code is openQRM. * * The Initial Developer of the Original Code is Qlusters Corporation. Portions * created by Qlusters Corporation are Copyright (C) 2005-2007. All Rights * Reserved. * * Contributor(s): * * Description: * * Comments: ******************************************************************************/ package com.qlusters.jlmenu; import java.io.PrintWriter; import java.util.HashMap; import javax.servlet.jsp.JspException; import javax.servlet.jsp.tagext.TagSupport; import org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager; public class JLMenuTagBody extends TagSupport { static final long serialVersionUID = 279637490151836240L; @Override public int doEndTag() throws JspException { HashMap menuMap = (HashMap) pageContext.getRequest().getAttribute("JLMenu_menus"); id = (String) ExpressionEvaluatorManager.evaluate("id", id, String.class, this, pageContext); JavaMenu menu = (JavaMenu) menuMap.get(id); if (menu != null) { menu.printMenu(new PrintWriter(pageContext.getOut())); } return EVAL_PAGE; } } --- NEW FILE: JLMenuTagHeader.java --- /******************************************************************************* * The contents of this file are subject to the Qlusters Public License * Version 1.1 (the License); you may not use this file except in compliance * with the License. * You may obtain a copy of the License at * http://www.openqrm.org/content/view/33/69/. * * Software distributed under the License is distributed on an AS IS basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for * the specific language governing rights and limitations under the License. * * The Original Code is openQRM. * * The Initial Developer of the Original Code is Qlusters Corporation. Portions * created by Qlusters Corporation are Copyright (C) 2005-2007. All Rights * Reserved. * * Contributor(s): * * Description: * * Comments: ******************************************************************************/ package com.qlusters.jlmenu; import java.io.PrintWriter; import java.util.HashMap; import java.util.Iterator; import javax.servlet.jsp.tagext.TagSupport; public class JLMenuTagHeader extends TagSupport { static final long serialVersionUID = 5230661821800788775L; @Override public int doStartTag() { HashMap menuMap = (HashMap) pageContext.getRequest().getAttribute("JLMenu_menus"); Iterator iter = menuMap.values().iterator(); while (iter.hasNext()) { JavaMenu menu = (JavaMenu) iter.next(); if (menu != null) { menu.printHeader(new PrintWriter(pageContext.getOut())); } } return SKIP_BODY; } @Override public int doEndTag() { return EVAL_PAGE; } } --- NEW FILE: JavaVerticalMenu.java --- /******************************************************************************* * The contents of this file are subject to the Qlusters Public License * Version 1.1 (the License); you may not use this file except in compliance * with the License. * You may obtain a copy of the License at * http://www.openqrm.org/content/view/33/69/. * * Software distributed under the License is distributed on an AS IS basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for * the specific language governing rights and limitations under the License. * * The Original Code is openQRM. * * The Initial Developer of the Original Code is Qlusters Corporation. Portions * created by Qlusters Corporation are Copyright (C) 2005-2007. All Rights * Reserved. * * Contributor(s): * * Description: * * Comments: ******************************************************************************/ package com.qlusters.jlmenu; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Iterator; public class JavaVerticalMenu extends JavaMenu { protected ArrayList<Integer> collapsibleItems = new ArrayList<Integer>(); protected ArrayList<Boolean> lastItems = new ArrayList<Boolean>(); public JavaVerticalMenu(String menuKey, String title) { super(menuKey, title); } public JavaVerticalMenu(String menuKey, String title, String imgPrefix, String libjsPrefix) { super(menuKey, title, imgPrefix, libjsPrefix); } protected int printMenuItem(PrintWriter out, MenuItem item, int lastId, int level) { int id = lastId + 1; while (lastItems.size() < level + 1) { lastItems.add(FALSE); } if (item.isLastChild()) { lastItems.set(level, TRUE); } else { lastItems.set(level, FALSE); } out.println("<div id='"+menuKey+id+"' class='treemenudiv"+(item.isDisabled()?"disabled":"")+"'>"); if (level == 1 && item.isFirstChild() && !item.hasChildren()) { out.print("<img align='top' border='0' class='imgs' src='"+imgPrefix+"/tree_split_first.png' alt='|-' />"); } for (int i = 1; i < level; ++i) { if (lastItems.get(i) == TRUE) { out.print("<img align='top' border='0' class='imgs' src='"+imgPrefix+"/tree_space.png' alt=' ' />"); } else { out.print("<img align='top' border='0' class='imgs' src='"+imgPrefix+"/tree_vertline.png' alt='| ' />"); } } if (item.hasChildren() && !item.isDisabled()) { collapsibleItems.add(new Integer(id)); out.print("<a onmousedown=\"toggletreemenu_"+menuKey+"('"+id+"')\">"); if (item.isLastChild()) { out.print("<img align='top' border='0' class='imgs' id='"+menuKey+id+"node' src='"+imgPrefix+"/tree_expand_corner.png' alt='--' />"); } else { out.print("<img align='top' border='0' class='imgs' id='"+menuKey+id+"node' src='"+imgPrefix+"/tree_expand.png' alt='--' />"); } out.print("</a>"); } else { if (item.isLastChild()){ out.print("<img align='top' border='0' class='imgs' id='"+menuKey+id+"node' src='"+imgPrefix+"/tree_corner.png' alt='+-' />"); } else if (item.isSeperator()) { out.print("<img align='top' border='0' class='imgs' src='"+imgPrefix+"/tree_vertline.png' alt='| ' />"); out.println("<a class='treemenuseparator'> </a>\n</div>"); return id; } else if (level > 1 || !item.isFirstChild()) { out.print("<img align='top' border='0' class='imgs' id='"+menuKey+id+"node' src='"+imgPrefix+"/tree_split.png' alt='|-' />"); } } if (item.getUrl().length() > 0 && !item.isDisabled()) { out.print("<a href=\""+item.getUrl()+"\" title='"+item.getDescription()+"' "+ (item.getTarget().length() > 0 ? "target=\"" + item.getTarget() + "\" " : "")+ ">"); } if (item.getIcon().length() > 0) { out.print("<img align='top' border='0' id='"+menuKey+id+"folder' src='"+item.getIcon()+"' alt='->' />"); } else if (item.hasChildren()) { out.print("<img align='top' border='0' class='imgs' id='"+menuKey+id+"folder' src='"+imgPrefix+"/tree_folder_closed.png' alt='->' />"); } else { out.print("<img align='top' border='0' class='imgs' src='"+imgPrefix+"/tree_leaf.png' alt='->' />"); } if (item.getUrl().length() > 0 && !item.isDisabled()) { out.print("</a>"); } out.println(" <a id=\"" + item.getId() + "\" " + (item.getUrl().length() > 0 && !item.isDisabled() ? " href=\""+item.getUrl()+"\" "+ (item.getTarget().length() > 0 ? "target=\"" + item.getTarget() + "\" " : "") : " href='javascript:void(0)'" ) + " title='"+item.getDescription()+"' class='phplm"+ (item.isDisabled() ? "disabled" : "") + "'>"+item.getTitle()+"</a>"); out.println("</div>"); if (item.hasChildren() && !item.isDisabled()) { out.println("<div id='"+menuKey+id+"son' style='display:none' class='treemenudiv'>"); Iterator iter = item.getChildren().iterator(); while (iter.hasNext()) { MenuItem child = (MenuItem) iter.next(); id = printMenuItem(out, child, id, level + 1); } out.println("</div>"); } return id; } @Override public void printMenu(PrintWriter out) { out.println("<div class='normalbox'>\n" + "<div class='normal'>\n" + title + "\n" + "</div>\n" + "<script language='JavaSc... [truncated message content] |