[Ejtools-cvs] CVS: applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/web/taglib
Brought to you by:
letiemble
From: Laurent E. <let...@us...> - 2002-05-24 21:19:16
|
Update of /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/web/taglib In directory usw-pr-cvs1:/tmp/cvs-serv31461/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/web/taglib Added Files: ConnectTag.java TreeRendererImpl.java Log Message: Initial import --- NEW FILE: ConnectTag.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package net.sourceforge.ejtools.jndibrowser.web.taglib; import javax.servlet.ServletContext; import javax.servlet.jsp.JspException; import javax.servlet.jsp.tagext.TagSupport; import net.sourceforge.ejtools.jndibrowser.web.Constants; /** * Description of the Class * * @author letiemble * @created 1 mars 2002 * @todo Javadoc to complete */ public class ConnectTag extends TagSupport { /** The key of the application-scope bean we look for. */ private String name = Constants.TREE; /** The page to which we should forward for the user to log on. */ private String page = "/connect.do"; /** * Description of the Method * * @return Description of the Returned Value * @exception JspException Description of Exception */ public int doEndTag() throws JspException { boolean valid = false; ServletContext context = pageContext.getServletContext(); if (context.getAttribute(name) != null) { valid = true; } // Forward control based on the results if (valid) { return (EVAL_PAGE); } else { try { pageContext.forward(page); } catch (Exception e) { throw new JspException(e.toString()); } return (SKIP_PAGE); } } /** * Description of the Method * * @return Description of the Returned Value * @exception JspException Description of Exception */ public int doStartTag() throws JspException { return (SKIP_BODY); } /** * Getter for the name attribute * * @return The value of name attribute */ public String getName() { return (this.name); } /** * Getter for the page attribute * * @return The value of page attribute */ public String getPage() { return (this.page); } /** Description of the Method */ public void release() { super.release(); this.name = Constants.TREE; this.page = "/connect.do"; } /** * Setter for the name attribute * * @param name The new value for name attribute */ public void setName(String name) { this.name = name; } /** * Setter for the page attribute * * @param page The new value for page attribute */ public void setPage(String page) { this.page = page; } } --- NEW FILE: TreeRendererImpl.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package net.sourceforge.ejtools.jndibrowser.web.taglib; import net.sourceforge.ejtools.jndibrowser.model.JNDIContext; import net.sourceforge.ejtools.jndibrowser.model.JNDIEntry; import net.sourceforge.ejtools.servlet.http.jsp.tagext.TreeRenderer; /** * Description of the Class * * @author letiemble * @created 25 avril 2002 * @todo Javadoc to complete */ public class TreeRendererImpl implements TreeRenderer { /** * Gets the icon attribute of the TreeRendererImpl object * * @param o Description of the Parameter * @return The icon value */ public String getIcon(Object o) { if (net.sourceforge.ejtools.jndibrowser.model.JNDIContext.class.equals(o.getClass())) { return "images/tree/folder.gif"; } if (net.sourceforge.ejtools.jndibrowser.model.JNDIEntry.class.equals(o.getClass())) { return "images/tree/page.gif"; } return null; } } |