1 16 package org.apache.myfaces.custom.datascroller; 17 18 import org.apache.myfaces.component.UserRoleAware; 19 import org.apache.myfaces.taglib.UIComponentTagBase; 20 21 import javax.faces.component.UIComponent; 22 23 73 public class HtmlDataScrollerTag 74 extends UIComponentTagBase 75 { 76 78 private static final String FOR_ATTR = "for"; 79 private static final String FAST_STEP_ATTR = "fastStep"; 80 private static final String PAGE_INDEX_ATTR = "pageIndexVar"; 81 private static final String PAGE_COUNT_ATTR = "pageCountVar"; 82 private static final String ROWS_COUNT_ATTR = "rowsCountVar"; 83 private static final String DISPLAYED_ROWS_COUNT_ATTR = "displayedRowsCountVar"; 84 private static final String FIRST_ROW_INDEX_ATTR = "firstRowIndexVar"; 85 private static final String LAST_ROW_INDEX_ATTR = "lastRowIndexVar"; 86 private static final String STYLE_CLASS_ATTR = "styleClass"; 87 private static final String STYLE_ATTR = "style"; 88 private static final String PAGINATOR_ATTR = "paginator"; 89 private static final String PAGINATOR_MAX_PAGES_ATTR = "paginatorMaxPages"; 90 private static final String PAGINATOR_TABLE_CLASS_ATTR = "paginatorTableClass"; 91 private static final String PAGINATOR_TABLE_STYLE_ATTR = "paginatorTableStyle"; 92 private static final String PAGINATOR_COL_CLASS_ATTR = "paginatorColumnClass"; 93 private static final String PAGINATOR_COL_STYLE_ATTR = "paginatorColumnStyle"; 94 private static final String PAGINATOR_ACTCOL_CLASS_ATTR = "paginatorActiveColumnClass"; 95 private static final String PAGINATOR_ACTCOL_STYLE_ATTR = "paginatorActiveColumnStyle"; 96 97 private String _for; 98 private String _fastStep; 99 private String _pageIndexVar; 100 private String _pageCountVar; 101 private String _rowsCountVar; 102 private String _displayedRowsCountVar; 103 private String _firstRowIndexVar; 104 private String _lastRowIndexVar; 105 private String _paginator; 106 private String _styleClass; 107 private String _style; 108 private String _paginatorMaxPages; 109 private String _paginatorTableClass; 110 private String _paginatorTableStyle; 111 private String _paginatorColumnClass; 112 private String _paginatorColumnStyle; 113 private String _paginatorActiveColumnClass; 114 private String _paginatorActiveColumnStyle; 115 116 private String _enabledOnUserRole; 118 private String _visibleOnUserRole; 119 120 public void release() { 121 super.release(); 122 _for=null; 123 _fastStep=null; 124 _pageIndexVar=null; 125 _pageCountVar=null; 126 _rowsCountVar=null; 127 _displayedRowsCountVar=null; 128 _firstRowIndexVar=null; 129 _lastRowIndexVar=null; 130 _paginator=null; 131 _styleClass=null; 132 _style=null; 133 _paginatorMaxPages=null; 134 _paginatorTableClass=null; 135 _paginatorTableStyle=null; 136 _paginatorColumnClass=null; 137 _paginatorColumnStyle=null; 138 _paginatorActiveColumnClass=null; 139 _paginatorActiveColumnStyle=null; 140 _enabledOnUserRole=null; 141 _visibleOnUserRole=null; 142 } 143 144 public String getComponentType() 145 { 146 return HtmlDataScroller.COMPONENT_TYPE; 147 } 148 149 public String getRendererType() 150 { 151 return HtmlDataScrollerRenderer.RENDERER_TYPE; 152 } 153 154 protected void setProperties(UIComponent component) 155 { 156 super.setProperties(component); 157 158 setStringProperty(component, FOR_ATTR, _for); 159 setIntegerProperty(component, FAST_STEP_ATTR, _fastStep); 160 setStringProperty(component, PAGE_INDEX_ATTR, _pageIndexVar); 161 setStringProperty(component, PAGE_COUNT_ATTR, _pageCountVar); 162 setStringProperty(component, ROWS_COUNT_ATTR, _rowsCountVar); 163 setStringProperty(component, DISPLAYED_ROWS_COUNT_ATTR, _displayedRowsCountVar); 164 setStringProperty(component, FIRST_ROW_INDEX_ATTR, _firstRowIndexVar); 165 setStringProperty(component, LAST_ROW_INDEX_ATTR, _lastRowIndexVar); 166 setStringProperty(component, STYLE_CLASS_ATTR, _styleClass); 167 setStringProperty(component, STYLE_ATTR, _style); 168 setBooleanProperty(component, PAGINATOR_ATTR, _paginator); 169 setIntegerProperty(component, PAGINATOR_MAX_PAGES_ATTR, _paginatorMaxPages); 170 setStringProperty(component, PAGINATOR_TABLE_CLASS_ATTR, _paginatorTableClass); 171 setStringProperty(component, PAGINATOR_TABLE_STYLE_ATTR, _paginatorTableStyle); 172 setStringProperty(component, PAGINATOR_COL_CLASS_ATTR, _paginatorColumnClass); 173 setStringProperty(component, PAGINATOR_COL_STYLE_ATTR, _paginatorColumnStyle); 174 setStringProperty(component, PAGINATOR_ACTCOL_CLASS_ATTR, _paginatorActiveColumnClass); 175 setStringProperty(component, PAGINATOR_ACTCOL_STYLE_ATTR, _paginatorActiveColumnStyle); 176 177 setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole); 178 setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole); 179 } 180 181 public void setFor(String aFor) 183 { 184 _for = aFor; 185 } 186 187 public void setFastStep(String fastStep) 188 { 189 _fastStep = fastStep; 190 } 191 192 public void setPageCountVar(String pageCountVar) 193 { 194 _pageCountVar = pageCountVar; 195 } 196 197 public void setPageIndexVar(String pageIndexVar) 198 { 199 _pageIndexVar = pageIndexVar; 200 } 201 202 public void setRowsCountVar(String rowsCountVar) 203 { 204 _rowsCountVar = rowsCountVar; 205 } 206 207 public void setDisplayedRowsCountVar(String displayedRowsCountVar) 208 { 209 _displayedRowsCountVar = displayedRowsCountVar; 210 } 211 212 public void setFirstRowIndexVar(String firstRowIndexVar) 213 { 214 _firstRowIndexVar = firstRowIndexVar; 215 } 216 217 public void setLastRowIndexVar(String lastRowIndexVar) 218 { 219 _lastRowIndexVar = lastRowIndexVar; 220 } 221 222 public void setStyle(String style) 223 { 224 _style = style; 225 } 226 227 public void setStyleClass(String styleClass) 228 { 229 _styleClass = styleClass; 230 } 231 232 public void setPaginator(String paginator) 233 { 234 _paginator = paginator; 235 } 236 237 public void setPaginatorMaxPages(String paginatorMaxPages) 238 { 239 _paginatorMaxPages = paginatorMaxPages; 240 } 241 242 public void setPaginatorTableClass(String paginatorTableClass) 243 { 244 _paginatorTableClass = paginatorTableClass; 245 } 246 247 public void setPaginatorColumnClass(String paginatorColumnClass) 248 { 249 _paginatorColumnClass = paginatorColumnClass; 250 } 251 252 public void setPaginatorColumnStyle(String paginatorColumnStyle) 253 { 254 _paginatorColumnStyle = paginatorColumnStyle; 255 } 256 257 public void setPaginatorTableStyle(String paginatorTableStyle) 258 { 259 _paginatorTableStyle = paginatorTableStyle; 260 } 261 262 public void setPaginatorActiveColumnClass(String paginatorActiveColumnClass) 263 { 264 this._paginatorActiveColumnClass = paginatorActiveColumnClass; 265 } 266 267 public void setPaginatorActiveColumnStyle(String paginatorActiveColumnStyle) 268 { 269 _paginatorActiveColumnStyle = paginatorActiveColumnStyle; 270 } 271 272 public void setEnabledOnUserRole(String enabledOnUserRole) 274 { 275 _enabledOnUserRole = enabledOnUserRole; 276 } 277 278 public void setVisibleOnUserRole(String visibleOnUserRole) 279 { 280 _visibleOnUserRole = visibleOnUserRole; 281 } 282 } 283 | Popular Tags |