1 25 26 package org.objectweb.jonas.webapp.taglib; 27 28 import javax.servlet.http.HttpServletRequest ; 29 import javax.servlet.http.HttpServletResponse ; 30 import javax.servlet.jsp.tagext.BodyTagSupport ; 31 32 import org.objectweb.jonas.webapp.jonasadmin.WhereAreYou; 33 34 37 public class WhereAreYouTag extends BodyTagSupport { 38 39 41 43 private boolean usingWhere = false; 44 45 public boolean isUsingWhere() { 46 return usingWhere; 47 } 48 49 public boolean getUsingWhere() { 50 return usingWhere; 51 } 52 53 public void setUsingWhere(boolean usingWhere) { 54 this.usingWhere = usingWhere; 55 } 56 57 59 public String getSelectedNameNode() { 60 String sName = null; 61 WhereAreYou oWhere = getWhereAreYouInstance(); 62 if (oWhere != null) { 63 sName = oWhere.getSelectedNameNode(); 64 } 65 return sName; 66 } 67 68 public TreeControlNode getSelectedTreeControlNode() { 69 TreeControlNode oNode = null; 70 WhereAreYou oWhere = getWhereAreYouInstance(); 71 if (oWhere != null) { 72 oNode = oWhere.getSelectedTreeControlNode(); 73 } 74 return oNode; 75 } 76 77 public String getImagesRoot() { 78 String sImagesRoot = null; 79 WhereAreYou oWhere = getWhereAreYouInstance(); 80 if (oWhere != null) { 81 sImagesRoot = oWhere.getImagesRoot(); 82 } 83 return sImagesRoot; 84 } 85 86 public boolean isTreeToRefresh() { 87 boolean bRefresh = false; 88 WhereAreYou oWhere = getWhereAreYouInstance(); 89 if (oWhere != null) { 90 bRefresh = oWhere.isTreeToRefresh(); 91 } 92 return bRefresh; 93 } 94 95 public String getUrlToRefreshSelectedNode() { 96 String sUrl = null; 97 WhereAreYou oWhere = getWhereAreYouInstance(); 98 if (oWhere != null) { 99 sUrl = oWhere.getUrlToRefreshSelectedNode((HttpServletRequest ) pageContext.getRequest() 100 , (HttpServletResponse ) pageContext.getResponse()); 101 } 102 return sUrl; 103 } 104 105 107 protected WhereAreYou getWhereAreYouInstance() { 108 return (WhereAreYou) pageContext.getSession().getAttribute(WhereAreYou.SESSION_NAME); 109 } 110 } 111 | Popular Tags |