1 16 package org.apache.myfaces.custom.calendar; 17 18 import org.apache.myfaces.component.UserRoleAware; 19 import org.apache.myfaces.taglib.html.HtmlInputTagBase; 20 21 import javax.faces.component.UIComponent; 22 23 61 public class HtmlInputCalendarTag 62 extends HtmlInputTagBase 63 { 64 66 public String getComponentType() 67 { 68 return HtmlInputCalendar.COMPONENT_TYPE; 69 } 70 71 public String getRendererType() 72 { 73 return "org.apache.myfaces.Calendar"; 74 } 75 76 78 80 82 85 88 private String _monthYearRowClass; 90 private String _weekRowClass; 91 private String _dayCellClass; 92 private String _currentDayCellClass; 93 private String _renderAsPopup; 94 private String _addResources; 95 private String _popupDateFormat; 96 private String _popupButtonString; 97 private String _popupGotoString = null; 98 private String _popupTodayString = null; 99 private String _popupWeekString = null; 100 private String _popupScrollLeftMessage = null; 101 private String _popupScrollRightMessage = null; 102 private String _popupSelectMonthMessage = null; 103 private String _popupSelectYearMessage = null; 104 private String _popupSelectDateMessage = null; 105 106 private String _enabledOnUserRole; 108 private String _visibleOnUserRole; 109 110 public void release() { 111 super.release(); 112 113 _monthYearRowClass = null; 114 _weekRowClass = null; 115 _dayCellClass = null; 116 _currentDayCellClass = null; 117 _renderAsPopup = null; 118 _addResources = null; 119 _popupDateFormat = null; 120 _popupButtonString = null; 121 _popupGotoString = null; 122 _popupTodayString = null; 123 _popupWeekString = null; 124 _popupScrollLeftMessage = null; 125 _popupScrollRightMessage = null; 126 _popupSelectMonthMessage = null; 127 _popupSelectYearMessage = null; 128 _popupSelectDateMessage = null; 129 _enabledOnUserRole = null; 130 _visibleOnUserRole = null; 131 132 } 133 134 135 protected void setProperties(UIComponent component) 136 { 137 super.setProperties(component); 138 139 setStringProperty(component, "monthYearRowClass", _monthYearRowClass); 140 setStringProperty(component, "weekRowClass", _weekRowClass); 141 setStringProperty(component, "dayCellClass", _dayCellClass); 142 setStringProperty(component, "currentDayCellClass", _currentDayCellClass); 143 setBooleanProperty(component,"renderAsPopup",_renderAsPopup); 144 setBooleanProperty(component,"addResources",(_addResources==null?Boolean.TRUE.toString():_addResources)); 145 setStringProperty(component,"popupDateFormat",_popupDateFormat); 146 setStringProperty(component,"popupButtonString",_popupButtonString); 147 setStringProperty(component,"popupGotoString",_popupGotoString); 148 setStringProperty(component,"popupTodayString",_popupTodayString); 149 setStringProperty(component,"popupWeekString",_popupWeekString); 150 setStringProperty(component,"popupScrollLeftMessage",_popupScrollLeftMessage); 151 setStringProperty(component,"popupScrollRightMessage",_popupScrollRightMessage); 152 setStringProperty(component,"popupSelectMonthMessage",_popupSelectMonthMessage); 153 setStringProperty(component,"popupSelectYearMessage",_popupSelectYearMessage); 154 setStringProperty(component,"popupSelectDateMessage",_popupSelectDateMessage); 155 156 157 setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole); 158 setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole); 159 } 160 161 public void setMonthYearRowClass(String monthYearRowClass) 162 { 163 _monthYearRowClass = monthYearRowClass; 164 } 165 166 public void setWeekRowClass(String weekRowClass) 167 { 168 _weekRowClass = weekRowClass; 169 } 170 171 public void setDayCellClass(String dayCellClass) 172 { 173 _dayCellClass = dayCellClass; 174 } 175 176 public void setCurrentDayCellClass(String currentDayCellClass) 177 { 178 _currentDayCellClass = currentDayCellClass; 179 } 180 181 public void setRenderAsPopup(String renderAsPopup) 182 { 183 _renderAsPopup = renderAsPopup; 184 } 185 186 public void setAddResources(String addResources) 187 { 188 _addResources = addResources; 189 } 190 191 public void setPopupDateFormat(String popupDateFormat) 192 { 193 _popupDateFormat = popupDateFormat; 194 } 195 196 public void setPopupButtonString(String popupButtonString) 197 { 198 _popupButtonString = popupButtonString; 199 } 200 201 public void setEnabledOnUserRole(String enabledOnUserRole) 202 { 203 _enabledOnUserRole = enabledOnUserRole; 204 } 205 206 public void setVisibleOnUserRole(String visibleOnUserRole) 207 { 208 _visibleOnUserRole = visibleOnUserRole; 209 } 210 211 public void setPopupGotoString(String popupGotoString) 212 { 213 _popupGotoString = popupGotoString; 214 } 215 216 public void setPopupScrollLeftMessage(String popupScrollLeftMessage) 217 { 218 _popupScrollLeftMessage = popupScrollLeftMessage; 219 } 220 221 public void setPopupScrollRightMessage(String popupScrollRightMessage) 222 { 223 _popupScrollRightMessage = popupScrollRightMessage; 224 } 225 226 public void setPopupSelectDateMessage(String popupSelectDateMessage) 227 { 228 _popupSelectDateMessage = popupSelectDateMessage; 229 } 230 231 public void setPopupSelectMonthMessage(String popupSelectMonthMessage) 232 { 233 _popupSelectMonthMessage = popupSelectMonthMessage; 234 } 235 236 public void setPopupSelectYearMessage(String popupSelectYearMessage) 237 { 238 _popupSelectYearMessage = popupSelectYearMessage; 239 } 240 241 public void setPopupTodayString(String popupTodayString) 242 { 243 _popupTodayString = popupTodayString; 244 } 245 246 public void setPopupWeekString(String popupWeekString) 247 { 248 _popupWeekString = popupWeekString; 249 } 250 } 251 | Popular Tags |