1 package fr.improve.struts.taglib.layout; 2 3 import javax.servlet.jsp.JspException ; 4 5 import org.apache.struts.Globals; 6 7 import fr.improve.struts.taglib.layout.skin.Skin; 8 import fr.improve.struts.taglib.layout.util.LayoutUtils; 9 10 13 public class ImageTag extends ActionTag { 14 protected String src; 15 protected String srcKey; 16 protected String property =""; 17 protected String pageKey; 18 protected String page; 19 protected String locale = Globals.LOCALE_KEY; 20 protected String bundle = Globals.MESSAGES_KEY; 21 protected String border; 22 protected String altKey; 23 protected String alt; 24 protected String name; 25 public ImageTag() { 26 tag = new org.apache.struts.taglib.html.ImageTag(); 27 } 28 33 public java.lang.String getAlt() { 34 return alt; 35 } 36 41 public java.lang.String getAltKey() { 42 return altKey; 43 } 44 49 public java.lang.String getBorder() { 50 return border; 51 } 52 57 public java.lang.String getBundle() { 58 return bundle; 59 } 60 65 public java.lang.String getLocale() { 66 return locale; 67 } 68 73 public java.lang.String getPage() { 74 return page; 75 } 76 81 public java.lang.String getPageKey() { 82 return pageKey; 83 } 84 89 public java.lang.String getProperty() { 90 return property; 91 } 92 97 public java.lang.String getSrc() { 98 return src; 99 } 100 105 public java.lang.String getSrcKey() { 106 return srcKey; 107 } 108 public void release() { 109 super.release(); 110 src = null; 111 srcKey = null; 112 property = ""; 113 pageKey = null; 114 page = null; 115 locale = Globals.LOCALE_KEY; 116 bundle = Globals.MESSAGES_KEY; 117 altKey = null; 118 alt = null; 119 name = null; 120 tag.release(); 121 } 122 127 public void setAlt(java.lang.String newAlt) { 128 alt = newAlt; 129 } 130 135 public void setAltKey(java.lang.String newAltKey) { 136 altKey = newAltKey; 137 } 138 143 public void setBorder(java.lang.String newBorder) { 144 border = newBorder; 145 } 146 151 public void setBundle(java.lang.String newBundle) { 152 bundle = newBundle; 153 } 154 159 public void setLocale(java.lang.String newLocale) { 160 locale = newLocale; 161 } 162 167 public void setPage(java.lang.String newPage) { 168 page = newPage; 169 } 170 175 public void setPageKey(java.lang.String newPageKey) { 176 pageKey = newPageKey; 177 } 178 183 public void setProperty(java.lang.String newProperty) { 184 property = newProperty; 185 } 186 191 public void setSrc(java.lang.String newSrc) { 192 src = newSrc; 193 } 194 199 public void setSrcKey(java.lang.String newSrcKey) { 200 srcKey = newSrcKey; 201 } 202 protected void copyProperties() throws JspException { 203 super.copyProperties(); 205 206 if (name!=null) { 208 StringBuffer lc_buffer = new StringBuffer (); 210 211 Skin lc_skin = LayoutUtils.getSkin(pageContext.getSession()); 213 214 String lc_imgSrc = lc_skin.getImageDirectory(pageContext.getRequest()); 216 lc_buffer.append(lc_imgSrc); 217 if (!lc_imgSrc.endsWith("/") && !name.startsWith("/")) { 218 lc_buffer.append('/'); 219 } 220 221 lc_buffer.append(name); 223 ((org.apache.struts.taglib.html.ImageTag) tag).setSrc(lc_buffer.toString()); 225 } 226 } 227 public String getName() { 228 return name; 229 } 230 public void setName(String name) { 231 this.name = name; 232 } 233 } 234 | Popular Tags |