1 16 package org.apache.myfaces.custom.swapimage; 17 18 import org.apache.myfaces.taglib.html.HtmlGraphicImageTagBase; 19 20 import javax.faces.component.UIComponent; 21 22 39 public class HtmlSwapImageTag 40 extends HtmlGraphicImageTagBase 41 { 42 private static final String RENDERER_TYPE = "org.apache.myfaces.SwapImage"; 43 44 private static final String SWAP_IMG_URL_ATTR = "swapImageUrl"; 45 private static final String ACTIVE_IMG_URL_ATTR = "activeImageUrl"; 46 47 private String _swapImageUrl; 48 private String _activeImageUrl; 49 50 public String getComponentType() 51 { 52 return HtmlSwapImage.COMPONENT_TYPE; 53 } 54 55 public String getRendererType() 56 { 57 return RENDERER_TYPE; 58 } 59 60 public void release() { 61 super.release(); 62 _swapImageUrl=null; 63 _activeImageUrl=null; 64 } 65 66 protected void setProperties(UIComponent component) 67 { 68 super.setProperties(component); 69 70 setStringProperty(component, SWAP_IMG_URL_ATTR, _swapImageUrl); 71 setStringProperty(component, ACTIVE_IMG_URL_ATTR, _activeImageUrl); 72 } 73 74 public void setSwapImageUrl(String swapImageUrl) 75 { 76 _swapImageUrl = swapImageUrl; 77 } 78 79 public void setActiveImageUrl(String activeImageUrl) 80 { 81 _activeImageUrl = activeImageUrl; 82 } 83 84 public void setOnmouseover(String onmouseover) 85 { 86 throw new UnsupportedOperationException (HtmlSwapImageTag.class.getName() + ".setOnmouseover not supported."); 87 } 88 89 public void setOnmousedown(String onmousedown) 90 { 91 throw new UnsupportedOperationException (HtmlSwapImageTag.class.getName() + ".setOnmousedown not supported."); 92 } 93 94 public void setOnmouseup(String onmouseup) 95 { 96 throw new UnsupportedOperationException (HtmlSwapImageTag.class.getName() + ".setOnmouseup not supported."); 97 } 98 99 public void setOnmousemove(String onmousemove) 100 { 101 throw new UnsupportedOperationException (HtmlSwapImageTag.class.getName() + ".setOnmousemove not supported."); 102 } 103 104 public void setOnmouseout(String onmouseout) 105 { 106 throw new UnsupportedOperationException (HtmlSwapImageTag.class.getName() + ".setOnmouseout not supported."); 107 } 108 } 109 | Popular Tags |