menutag.java
来自「一个实用工具类」· Java 代码 · 共 872 行 · 第 1/2 页
JAVA
872 行
writer.print("</TD>\n"); if (i > 0) { writer.print("<TD><IMG SRC=\"/img/l-separateur.gif\" border=0></TD>\n"); } i++; } writer.print("</TR>\n"); writer.print("</TABLE>\n"); } writer.print("</DIV>\n"); } private void initCommonVarsForDynamicMenu(JspWriter jspWriter) throws JspException { try { if ( f_top != null ) { jspWriter.println("StartTop=" + f_top + "; "); } if ( f_left != null ) { jspWriter.println("StartLeft=" + f_left + "; "); } jspWriter.println("FirstLineHorizontal=" + (f_orientation.equalsIgnoreCase(ORIENTATION_HORZ) ? "1" : "0") + "; " ); if ( f_lowBgColor != null ) { jspWriter.println("LowBgColor='" + f_lowBgColor + "'; "); } if ( f_lowSubBgColor != null ) { jspWriter.println("LowSubBgColor='" + f_lowSubBgColor + "'; "); } if ( f_highBgColor != null ) { jspWriter.println("HighBgColor='" + f_highBgColor + "'; "); } if ( f_highSubBgColor != null ) { jspWriter.println("HighSubBgColor='" + f_highSubBgColor + "'; "); } if ( f_fontLowColor != null ) { jspWriter.println("FontLowColor='" + f_fontLowColor + "'; "); } if ( f_fontSubLowColor != null ) { jspWriter.println("FontSubLowColor='" + f_fontSubLowColor + "'; "); } if ( f_fontHighColor != null ) { jspWriter.println("FontHighColor='" + f_fontHighColor + "'; "); } if ( f_fontSubHighColor != null ) { jspWriter.println("FontSubHighColor='" + f_fontSubHighColor + "'; "); } if ( f_borderColor != null ) { jspWriter.println("BorderColor='" + f_borderColor + "'; "); } if ( f_borderSubColor != null ) { jspWriter.println("BorderSubColor='" + f_borderSubColor + "'; "); } if ( f_borderWidth != null ) { jspWriter.println("BorderWidth=" + f_borderWidth + "; "); } if ( f_borderBtwnElmnts != null ) { jspWriter.println("BorderBtwnElmnts=" + f_borderBtwnElmnts + "; "); } } catch (IOException e) { throw new JspException(e); } } /** * @see Tag#doStartTag() */ public int doStartTag() throws JspException { try { JspWriter jspWriter = pageContext.getOut(); ButorMenu menu = getMenu(); Object contextKey = Thread.currentThread(); IContext context = ContextService.getContext(contextKey); if (context == null) { Log.logStr(this, Log.LOG_TYPE_WARN, "printDynamicLink()", "Can't find context."); } Locale locale = context.getLocale(); if (menu != null) { IMenuItem menuItems[] = menu.getItems(); if ( new Boolean(f_dynamic).booleanValue() ) { jspWriter.println("<script type='text/javascript'>"); jspWriter.println("NoOffFirstLineMenus=" + menuItems.length + "; "); initCommonVarsForDynamicMenu(jspWriter); for (int i = 0; i < menuItems.length; i++) { createDynamicMenu(jspWriter, menuItems[i], "" + (i+1), locale); } jspWriter.println("</script>"); jspWriter.println("<script type='text/javascript' src='/menu.js'></script>"); jspWriter.println("<noscript>Your browser does not support script</noscript>"); } else { if (f_orientation.equals(ORIENTATION_HORZ)) { boolean getSelectionFromSession = getSelectedLinkFromSession(menuItems); for (int i = 0; i < menuItems.length; i++) { if (i > 0) { jspWriter.print(" | "); } printMenu(jspWriter, menuItems[i], 0, getSelectionFromSession); } } else { jspWriter.print("<table>"); for (int i = 0; i < menuItems.length; i++) { printMenu(jspWriter, menuItems[i], 0, false); } jspWriter.print("</table>"); } } } } catch (IOException e) { throw new JspException(e); } return EVAL_BODY_INCLUDE; } /** * @see Tag#release() */ public void release() { f_menuId = null; f_orientation = null; f_sort = null; f_dynamic = "false"; } /******************************* Setter/Getter method *********************************/ /** * Set the id of the menu * @param name java.lang.String */ public void setMenuId(String id) { f_menuId = id; } /** * Get the id of the menu * @return java.lang.String */ public String getMenuId() { return f_menuId; } /** * Set the orientation of the menu * @param orientation java.lang.String */ public void setOrientation(String orientation) { f_orientation = orientation; } /** * Get the orientation of the menu * @return java.lang.String */ public String getOrientation() { return f_orientation; } /** * Set the sorting mode * @param sort java.lang.String */ public void setSort(String sort) { f_sort = sort; } /** * Get the sorting mode * @return java.lang.String */ public String getSort() { return f_sort; } /** * Returns the styleClass. * @return String */ public String getStyleClass() { return f_styleClass; } /** * Sets the styleClass. * @param styleClass The styleClass to set */ public void setStyleClass(String styleClass) { f_styleClass = styleClass; } /** * Returns the f_dynamic. * @return String */ public String getDynamic() { return f_dynamic; } /** * Sets the f_dynamic. * @param f_dynamic The f_dynamic to set */ public void setDynamic(String dynamic) { f_dynamic = dynamic; } /** * Returns the f_left. * @return String */ public String getLeft() { return f_left; } /** * Returns the f_top. * @return String */ public String getTop() { return f_top; } /** * Sets the f_left. * @param f_left The f_left to set */ public void setLeft(String left) { f_left = left; } /** * Sets the f_top. * @param f_top The f_top to set */ public void setTop(String top) { f_top = top; } /** * Returns the f_borderBtwnElmnts. * @return String */ public String getBorderBtwnElmnts() { return f_borderBtwnElmnts; } /** * Returns the f_borderColor. * @return String */ public String getBorderColor() { return f_borderColor; } /** * Returns the f_borderSubColor. * @return String */ public String getBorderSubColor() { return f_borderSubColor; } /** * Returns the f_borderWidth. * @return String */ public String getBorderWidth() { return f_borderWidth; } /** * Returns the f_fontHighColor. * @return String */ public String getFontHighColor() { return f_fontHighColor; } /** * Returns the f_fontLowColor. * @return String */ public String getFontLowColor() { return f_fontLowColor; } /** * Returns the f_fontSubHighColor. * @return String */ public String getFontSubHighColor() { return f_fontSubHighColor; } /** * Returns the f_fontSubLowColor. * @return String */ public String getFontSubLowColor() { return f_fontSubLowColor; } /** * Returns the f_highBgColor. * @return String */ public String getHighBgColor() { return f_highBgColor; } /** * Returns the f_highSubBgColor. * @return String */ public String getHighSubBgColor() { return f_highSubBgColor; } /** * Returns the f_lowBgColor. * @return String */ public String getLowBgColor() { return f_lowBgColor; } /** * Returns the f_lowSubBgColor. * @return String */ public String getLowSubBgColor() { return f_lowSubBgColor; } /** * Sets the f_borderBtwnElmnts. * @param f_borderBtwnElmnts The f_borderBtwnElmnts to set */ public void setBorderBtwnElmnts(String borderBtwnElmnts) { f_borderBtwnElmnts = borderBtwnElmnts; } /** * Sets the f_borderColor. * @param f_borderColor The f_borderColor to set */ public void setBorderColor(String borderColor) { f_borderColor = borderColor; } /** * Sets the f_borderSubColor. * @param f_borderSubColor The f_borderSubColor to set */ public void setBorderSubColor(String borderSubColor) { f_borderSubColor = borderSubColor; } /** * Sets the f_borderWidth. * @param f_borderWidth The f_borderWidth to set */ public void setBorderWidth(String borderWidth) { f_borderWidth = borderWidth; } /** * Sets the f_fontHighColor. * @param f_fontHighColor The f_fontHighColor to set */ public void setFontHighColor(String fontHighColor) { f_fontHighColor = fontHighColor; } /** * Sets the f_fontLowColor. * @param f_fontLowColor The f_fontLowColor to set */ public void setFontLowColor(String fontLowColor) { f_fontLowColor = fontLowColor; } /** * Sets the f_fontSubHighColor. * @param f_fontSubHighColor The f_fontSubHighColor to set */ public void setFontSubHighColor(String fontSubHighColor) { f_fontSubHighColor = fontSubHighColor; } /** * Sets the f_fontSubLowColor. * @param f_fontSubLowColor The f_fontSubLowColor to set */ public void setFontSubLowColor(String fontSubLowColor) { f_fontSubLowColor = fontSubLowColor; } /** * Sets the f_highBgColor. * @param f_highBgColor The f_highBgColor to set */ public void setHighBgColor(String highBgColor) { f_highBgColor = highBgColor; } /** * Sets the f_highSubBgColor. * @param f_highSubBgColor The f_highSubBgColor to set */ public void setHighSubBgColor(String highSubBgColor) { f_highSubBgColor = highSubBgColor; } /** * Sets the f_lowBgColor. * @param f_lowBgColor The f_lowBgColor to set */ public void setLowBgColor(String lowBgColor) { f_lowBgColor = lowBgColor; } /** * Sets the f_lowSubBgColor. * @param f_lowSubBgColor The f_lowSubBgColor to set */ public void setLowSubBgColor(String lowSubBgColor) { f_lowSubBgColor = lowSubBgColor; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?