1 16 17 18 package org.apache.struts.webapp.example2; 19 20 21 import javax.faces.component.UIComponent; 22 import javax.faces.el.ValueBinding; 23 import javax.faces.webapp.UIComponentTag; 24 25 26 33 34 public class LinkSubscriptionTag extends UIComponentTag { 35 36 37 39 40 43 protected String name = "subscription"; 44 45 public void setName(String name) { 46 this.name = name; 47 } 48 49 50 53 protected String page = null; 54 55 public void setPage(String page) { 56 this.page = page; 57 } 58 59 60 62 63 66 public String getComponentType() { 67 68 return ("Output"); 69 70 } 71 72 73 76 public String getRendererType() { 77 78 return ("LinkSubscription"); 79 80 } 81 82 83 86 public void release() { 87 88 super.release(); 89 this.name = "subscription"; 90 this.page = null; 91 92 } 93 94 95 97 98 103 protected void setProperties(UIComponent component) { 104 105 super.setProperties(component); 106 if (name != null) { 107 if (isValueReference(name)) { 108 ValueBinding vb = 109 getFacesContext().getApplication().createValueBinding(name); 110 component.setValueBinding("name", vb); 111 } else { 112 component.getAttributes().put("name", name); 113 } 114 } 115 if (page != null) { 116 if (isValueReference(page)) { 117 ValueBinding vb = 118 getFacesContext().getApplication().createValueBinding(page); 119 component.setValueBinding("page", vb); 120 } else { 121 component.getAttributes().put("page", page); 122 } 123 } 124 125 } 126 127 128 } 129 | Popular Tags |