⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 actionmenuitemtag.java

📁 GridSphere 门户 提供一个基于 portlet 的高级开放源代码门户。GridSphere 是在欧盟提供基金的 GridLab 项目下开发的
💻 JAVA
字号:
package org.gridsphere.provider.portletui.tags;import org.gridsphere.provider.portletui.beans.ActionMenuItemBean;import javax.servlet.jsp.JspException;import javax.servlet.jsp.JspWriter;import javax.servlet.jsp.tagext.Tag;/* * @author <a href="mailto:oliver.wehrens@aei.mpg.de">Oliver Wehrens</a> * @version $Id: ActionMenuItemTag.java 4666 2006-03-27 17:47:56Z novotny $ */public class ActionMenuItemTag extends ContainerTag {    protected boolean isSelected = false;    protected boolean seperator = false;    protected ActionMenuItemBean actionMenuItemBean = null;    public boolean isSelected() {        return isSelected;    }    public void setSelected(boolean selected) {        isSelected = selected;    }    public boolean isSeperator() {        return seperator;    }    public void setSeperator(boolean seperator) {        this.seperator = seperator;    }    public int doStartTag() throws JspException {        if (!beanId.equals("")) {            actionMenuItemBean = (ActionMenuItemBean) getTagBean();            if (actionMenuItemBean == null) {                actionMenuItemBean = new ActionMenuItemBean();            }        } else {            actionMenuItemBean = new ActionMenuItemBean();        }        // set info if not already set and we have something to set        //if (info!=null && actionMenuItemBean.getInfo()==null) actionMenuItemBean.setInfo(info);        Tag parent = getParent();        if (parent instanceof ActionMenuTag) {            ActionMenuTag actionMenuTag = (ActionMenuTag) parent;            if (actionMenuTag.getLayout() != null) actionMenuItemBean.setAlign(actionMenuTag.getLayout());            if (actionMenuTag.getMenutype() != null) actionMenuItemBean.setMenutype(actionMenuTag.getMenutype());            actionMenuItemBean.setSelected(isSelected);        }        String beanString = actionMenuItemBean.toStartString();        // Print the string        try {            pageContext.getOut().print(beanString);        } catch (Exception e) {            throw new JspException(e.getMessage());        }        return EVAL_BODY_INCLUDE;    }    public int doEndTag() throws JspException {        try {            JspWriter out = pageContext.getOut();            out.print(actionMenuItemBean.toEndString());        } catch (Exception e) {            throw new JspException(e.getMessage());        }        return EVAL_PAGE;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -