1 16 package org.apache.myfaces.taglib; 17 18 import org.apache.myfaces.renderkit.JSFAttr; 19 20 import javax.faces.component.UIComponent; 21 import javax.faces.webapp.UIComponentTag; 22 23 64 public abstract class UIComponentTagBase 65 extends UIComponentTag 66 { 67 69 private String _forceId; 71 private String _forceIdIndex = "true"; 72 private String _javascriptLocation; 73 private String _imageLocation; 74 private String _styleLocation; 75 76 private String _value; 78 private String _converter; 79 81 public void release() { 82 super.release(); 83 84 _forceId=null; 85 _forceIdIndex = "true"; 87 88 _value=null; 89 _converter=null; 90 } 91 92 protected void setProperties(UIComponent component) 93 { 94 super.setProperties(component); 95 96 setBooleanProperty(component, JSFAttr.FORCE_ID_ATTR, _forceId); 97 setBooleanProperty(component, JSFAttr.FORCE_ID_INDEX_ATTR, _forceIdIndex); 98 if (_javascriptLocation != null) setStringProperty(component, JSFAttr.JAVASCRIPT_LOCATION, _javascriptLocation); 99 if (_imageLocation != null) setStringProperty(component, JSFAttr.IMAGE_LOCATION, _imageLocation); 100 if (_styleLocation != null) setStringProperty(component, JSFAttr.STYLE_LOCATION, _styleLocation); 101 102 104 setValueProperty(component, _value); 105 setConverterProperty(component, _converter); 106 } 107 108 115 public void setForceId(String aForceId) 116 { 117 _forceId = aForceId; 118 } 119 120 126 public void setForceIdIndex(String aForceIdIndex) 127 { 128 _forceIdIndex = aForceIdIndex; 129 } 130 131 public void setValue(String value) 132 { 133 _value = value; 134 } 135 136 public void setConverter(String converter) 137 { 138 _converter = converter; 139 } 140 141 142 148 public void setJavascriptLocation(String aJavascriptLocation) 149 { 150 _javascriptLocation = aJavascriptLocation; 151 } 152 153 159 public void setImageLocation(String aImageLocation) 160 { 161 _imageLocation = aImageLocation; 162 } 163 164 170 public void setStyleLocation(String aStyleLocation) 171 { 172 _styleLocation = aStyleLocation; 173 } 174 175 177 protected void setIntegerProperty(UIComponent component, String propName, String value) 178 { 179 UIComponentTagUtils.setIntegerProperty(getFacesContext(), component, propName, value); 180 } 181 182 protected void setStringProperty(UIComponent component, String propName, String value) 183 { 184 UIComponentTagUtils.setStringProperty(getFacesContext(), component, propName, value); 185 } 186 187 protected void setBooleanProperty(UIComponent component, String propName, String value) 188 { 189 UIComponentTagUtils.setBooleanProperty(getFacesContext(), component, propName, value); 190 } 191 192 private void setValueProperty(UIComponent component, String value) 193 { 194 UIComponentTagUtils.setValueProperty(getFacesContext(), component, value); 195 } 196 197 private void setConverterProperty(UIComponent component, String value) 198 { 199 UIComponentTagUtils.setConverterProperty(getFacesContext(), component, value); 200 } 201 202 protected void setValidatorProperty(UIComponent component, String value) 203 { 204 UIComponentTagUtils.setValidatorProperty(getFacesContext(), component, value); 205 } 206 207 protected void setActionProperty(UIComponent component, String action) 208 { 209 UIComponentTagUtils.setActionProperty(getFacesContext(), component, action); 210 } 211 212 protected void setActionListenerProperty(UIComponent component, String actionListener) 213 { 214 UIComponentTagUtils.setActionListenerProperty(getFacesContext(), component, actionListener); 215 } 216 217 protected void setValueChangedListenerProperty(UIComponent component, String valueChangedListener) 218 { 219 UIComponentTagUtils.setValueChangedListenerProperty(getFacesContext(), component, valueChangedListener); 220 } 221 222 protected void setValueBinding(UIComponent component, 223 String propName, 224 String value) 225 { 226 UIComponentTagUtils.setValueBinding(getFacesContext(), component, propName, value); 227 } 228 229 230 } 231 232 | Popular Tags |