1 16 package org.apache.myfaces.custom.tree; 17 18 import javax.faces.component.html.HtmlCommandLink; 19 import javax.faces.context.FacesContext; 20 21 22 38 public class HtmlTreeImageCommandLink 39 extends HtmlCommandLink 40 { 41 42 public static final String COMPONENT_TYPE = "org.apache.myfaces.HtmlTreeImageCommandLink"; 43 private static final String DEFAULT_RENDERER_TYPE = "org.apache.myfaces.HtmlTreeImageCommandLink"; 44 45 private String image; 46 47 48 public HtmlTreeImageCommandLink() 49 { 50 setRendererType(DEFAULT_RENDERER_TYPE); 51 } 52 53 54 public String getFamily() 55 { 56 return "org.apache.myfaces.HtmlTree"; 57 } 58 59 60 public String getImage() 61 { 62 return image; 63 } 64 65 66 public void setImage(String image) 67 { 68 this.image = image; 69 } 70 71 72 public Object saveState(FacesContext context) 73 { 74 Object values[] = new Object [2]; 75 values[0] = super.saveState(context); 76 values[1] = image; 77 return ((Object )(values)); 78 } 79 80 81 public void restoreState(FacesContext context, Object state) 82 { 83 Object values[] = (Object [])state; 84 super.restoreState(context, values[0]); 85 image = (String )values[1]; 86 } 87 } 88 | Popular Tags |