1 16 package org.apache.myfaces.renderkit.html; 17 18 import org.apache.myfaces.util.ArrayUtils; 19 20 21 82 public final class HTML 83 { 84 85 private HTML() 86 { 87 } 89 90 public static final String ALIGN_ATTR = "align"; 92 public static final String DATAFLD_ATTR = "datafld"; 93 public static final String DATASRC_ATTR = "datasrc"; 94 public static final String DATAFORMATAS_ATTR = "dataformatas"; 95 public static final String BORDER_ATTR = "border"; 96 public static final String WIDTH_ATTR = "width"; 97 public static final String READONLY_ATTR = "readonly"; 98 public static final String ACCEPT_ATTR = "accept"; 99 100 public static final String ONCLICK_ATTR = "onclick"; 102 public static final String ONDBLCLICK_ATTR = "ondblclick"; 103 public static final String ONMOUSEDOWN_ATTR = "onmousedown"; 104 public static final String ONMOUSEUP_ATTR = "onmouseup"; 105 public static final String ONMOUSEOVER_ATTR = "onmouseover"; 106 public static final String ONMOUSEMOVE_ATTR = "onmousemove"; 107 public static final String ONMOUSEOUT_ATTR = "onmouseout"; 108 public static final String ONKEYPRESS_ATTR = "onkeypress"; 109 public static final String ONKEYDOWN_ATTR = "onkeydown"; 110 public static final String ONKEYUP_ATTR = "onkeyup"; 111 public static final String [] EVENT_HANDLER_ATTRIBUTES_WITHOUT_ONCLICK = 112 { 113 ONDBLCLICK_ATTR, 114 ONMOUSEDOWN_ATTR, 115 ONMOUSEUP_ATTR, 116 ONMOUSEOVER_ATTR, 117 ONMOUSEMOVE_ATTR, 118 ONMOUSEOUT_ATTR, 119 ONKEYPRESS_ATTR, 120 ONKEYDOWN_ATTR, 121 ONKEYUP_ATTR 122 }; 123 public static final String [] EVENT_HANDLER_ATTRIBUTES = 124 (String []) ArrayUtils.concat( 125 EVENT_HANDLER_ATTRIBUTES_WITHOUT_ONCLICK, 126 new String [] {ONCLICK_ATTR}); 127 128 public static final String ONFOCUS_ATTR = "onfocus"; 130 public static final String ONBLUR_ATTR = "onblur"; 131 public static final String ONSELECT_ATTR = "onselect"; 132 public static final String ONCHANGE_ATTR = "onchange"; 133 public static final String [] COMMON_FIELD_EVENT_ATTRIBUTES = 134 { 135 ONFOCUS_ATTR, 136 ONBLUR_ATTR, 137 ONSELECT_ATTR, 138 ONCHANGE_ATTR 139 }; 140 141 public static final String DIR_ATTR = "dir"; 143 public static final String LANG_ATTR = "lang"; 144 public static final String STYLE_ATTR = "style"; 145 public static final String TITLE_ATTR = "title"; 146 public static final String STYLE_CLASS_ATTR = "styleClass"; public static final String [] UNIVERSAL_ATTRIBUTES_WITHOUT_STYLE = 148 { 149 DIR_ATTR, 150 LANG_ATTR, 151 TITLE_ATTR, 152 153 }; 155 public static final String [] UNIVERSAL_ATTRIBUTES = 156 (String []) ArrayUtils.concat( 157 UNIVERSAL_ATTRIBUTES_WITHOUT_STYLE, 158 new String [] {STYLE_ATTR, STYLE_CLASS_ATTR}); 159 160 public static final String CLASS_ATTR = "class"; 163 164 public static final String ACCESSKEY_ATTR = "accesskey"; 166 public static final String TABINDEX_ATTR = "tabindex"; 167 public static final String DISABLED_ATTR = "disabled"; 168 public static final String [] COMMON_FIELD_ATTRIBUTES_WITHOUT_DISABLED = 169 { 170 ACCESSKEY_ATTR, 171 TABINDEX_ATTR 172 }; 173 public static final String [] COMMON_FIELD_ATTRIBUTES = 174 (String []) ArrayUtils.concat( 175 COMMON_FIELD_ATTRIBUTES_WITHOUT_DISABLED, 176 new String [] {DISABLED_ATTR}); 177 178 public static final String [] COMMON_PASSTROUGH_ATTRIBUTES = 180 (String []) ArrayUtils.concat( 181 EVENT_HANDLER_ATTRIBUTES, 182 UNIVERSAL_ATTRIBUTES); 183 public static final String [] COMMON_PASSTROUGH_ATTRIBUTES_WITHOUT_STYLE = 184 (String []) ArrayUtils.concat( 185 EVENT_HANDLER_ATTRIBUTES, 186 UNIVERSAL_ATTRIBUTES_WITHOUT_STYLE); 187 public static final String [] COMMON_PASSTROUGH_ATTRIBUTES_WITHOUT_ONCLICK = 188 (String []) ArrayUtils.concat( 189 EVENT_HANDLER_ATTRIBUTES_WITHOUT_ONCLICK, 190 UNIVERSAL_ATTRIBUTES); 191 public static final String [] COMMON_FIELD_PASSTROUGH_ATTRIBUTES_WITHOUT_DISABLED = 192 (String []) ArrayUtils.concat( 193 COMMON_PASSTROUGH_ATTRIBUTES, 194 COMMON_FIELD_ATTRIBUTES_WITHOUT_DISABLED, 195 COMMON_FIELD_EVENT_ATTRIBUTES); 196 public static final String [] COMMON_FIELD_PASSTROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_ONCLICK = 197 (String []) ArrayUtils.concat( 198 COMMON_PASSTROUGH_ATTRIBUTES_WITHOUT_ONCLICK, 199 COMMON_FIELD_ATTRIBUTES_WITHOUT_DISABLED, 200 COMMON_FIELD_EVENT_ATTRIBUTES); 201 202 public static final String TARGET_ATTR = "target"; public static final String CHARSET_ATTR = "charset"; 205 public static final String COORDS_ATTR = "coords"; 206 public static final String HREF_ATTR = "href"; 207 public static final String HREFLANG_ATTR = "hreflang"; 208 public static final String REL_ATTR = "rel"; 209 public static final String REV_ATTR = "rev"; 210 public static final String SHAPE_ATTR = "shape"; 211 public static final String TYPE_ATTR = "type"; 212 public static final String [] ANCHOR_ATTRIBUTES = 213 { 214 ACCESSKEY_ATTR, 215 CHARSET_ATTR, 216 COORDS_ATTR, 217 HREFLANG_ATTR, 218 REL_ATTR, 219 REV_ATTR, 220 SHAPE_ATTR, 221 TABINDEX_ATTR, 222 TARGET_ATTR, 223 TYPE_ATTR 224 }; 225 public static final String [] ANCHOR_PASSTHROUGH_ATTRIBUTES = 226 (String []) ArrayUtils.concat( 227 ANCHOR_ATTRIBUTES, 228 COMMON_PASSTROUGH_ATTRIBUTES); 229 public static final String [] ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_STYLE = 230 (String []) ArrayUtils.concat( 231 ANCHOR_ATTRIBUTES, 232 COMMON_PASSTROUGH_ATTRIBUTES_WITHOUT_STYLE); 233 234 public static final String ACCEPT_CHARSET_ATTR = "accept-charset"; 236 public static final String ENCTYPE_ATTR = "enctype"; 237 public static final String ONRESET_ATTR = "onreset"; 238 public static final String ONSUMBIT_ATTR = "onsubmit"; 239 public static final String [] FORM_ATTRIBUTES = 240 { 241 ACCEPT_ATTR, 242 ACCEPT_CHARSET_ATTR, 243 ENCTYPE_ATTR, 244 ONRESET_ATTR, 245 ONSUMBIT_ATTR, 246 TARGET_ATTR, 247 }; 248 public static final String [] FORM_PASSTHROUGH_ATTRIBUTES = 249 (String []) ArrayUtils.concat( 250 FORM_ATTRIBUTES, 251 COMMON_PASSTROUGH_ATTRIBUTES); 252 253 public static final String SRC_ATTR = "src"; 255 public static final String ALT_ATTR = "alt"; 256 public static final String HEIGHT_ATTR = "height"; 257 public static final String HSPACE_ATTR = "hspace"; 258 public static final String ISMAP_ATTR = "ismap"; 259 public static final String LONGDESC_ATTR = "longdesc"; 260 public static final String USEMAP_ATTR = "usemap"; 261 public static final String VSPACE_ATTR = "vspace"; 262 263 public static final String [] IMG_ATTRIBUTES = 264 { 265 ALIGN_ATTR, 266 ALT_ATTR, 267 BORDER_ATTR, 268 HEIGHT_ATTR, 269 HSPACE_ATTR, 270 ISMAP_ATTR, 271 LONGDESC_ATTR, 272 USEMAP_ATTR, 273 VSPACE_ATTR, 274 WIDTH_ATTR 275 }; 276 public static final String [] IMG_PASSTHROUGH_ATTRIBUTES = 277 (String []) ArrayUtils.concat( 278 IMG_ATTRIBUTES, 279 COMMON_PASSTROUGH_ATTRIBUTES); 280 281 public static final String SIZE_ATTR = "size"; 283 public static final String CHECKED_ATTR = "checked"; 284 public static final String MAXLENGTH_ATTR = "maxlength"; 285 286 public static final String [] INPUT_ATTRIBUTES = { 287 ALIGN_ATTR, 288 ALT_ATTR, 289 CHECKED_ATTR, 290 DATAFLD_ATTR, 291 DATASRC_ATTR, 292 DATAFORMATAS_ATTR, 293 MAXLENGTH_ATTR, 294 READONLY_ATTR, 295 SIZE_ATTR, 296 }; 297 public static final String [] INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED = 298 (String []) ArrayUtils.concat( 299 INPUT_ATTRIBUTES, 300 COMMON_FIELD_PASSTROUGH_ATTRIBUTES_WITHOUT_DISABLED); 301 302 public static final String INPUT_TYPE_SUBMIT = "submit"; 304 public static final String INPUT_TYPE_IMAGE = "image"; 305 public static final String INPUT_TYPE_HIDDEN = "hidden"; 306 public static final String INPUT_TYPE_CHECKBOX = "checkbox"; 307 public static final String INPUT_TYPE_PASSWORD = "password"; 308 public static final String INPUT_TYPE_TEXT = "text"; 309 public static final String INPUT_TYPE_RADIO = "radio"; 310 311 public static final String [] BUTTON_ATTRIBUTES = 313 { 314 ALIGN_ATTR, 315 ALT_ATTR, 316 DATAFLD_ATTR, 317 DATASRC_ATTR, 318 DATAFORMATAS_ATTR, 319 }; 320 public static final String [] BUTTON_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED = 321 (String []) ArrayUtils.concat( 322 BUTTON_ATTRIBUTES, 323 COMMON_FIELD_PASSTROUGH_ATTRIBUTES_WITHOUT_DISABLED); 324 public static final String [] BUTTON_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_ONCLICK = 325 (String []) ArrayUtils.concat( 326 BUTTON_ATTRIBUTES, 327 COMMON_FIELD_PASSTROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_ONCLICK); 328 329 public static final String FRAMEBORDER_ATTR = "frameborder"; 331 public static final String SCROLLING_ATTR = "scrolling"; 332 333 public static final String FOR_ATTR = "for"; 335 public static final String [] LABEL_ATTRIBUTES = 336 { 337 ACCESSKEY_ATTR, 338 ONBLUR_ATTR, 339 ONFOCUS_ATTR 340 }; 342 public static final String [] LABEL_PASSTHROUGH_ATTRIBUTES = 343 (String []) ArrayUtils.concat( 344 LABEL_ATTRIBUTES, 345 COMMON_PASSTROUGH_ATTRIBUTES); 346 347 public static final String MULTIPLE_ATTR = "multiple"; 349 350 public static final String [] SELECT_ATTRIBUTES = 351 { 352 DATAFLD_ATTR, 353 DATASRC_ATTR, 354 DATAFORMATAS_ATTR, 355 }; 356 public static final String [] SELECT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED = 357 (String []) ArrayUtils.concat( 358 SELECT_ATTRIBUTES, 359 COMMON_FIELD_PASSTROUGH_ATTRIBUTES_WITHOUT_DISABLED); 360 361 public static final String BGCOLOR_ATTR = "bgcolor"; 363 public static final String CELLPADDING_ATTR = "cellpadding"; 364 public static final String CELLSPACING_ATTR = "cellspacing"; 365 public static final String FRAME_ATTR = "frame"; 366 public static final String RULES_ATTR = "rules"; 367 public static final String SUMMARY_ATTR = "summary"; 368 public static final String [] TABLE_ATTRIBUTES = { 369 ALIGN_ATTR, 370 BGCOLOR_ATTR, 371 BORDER_ATTR, 372 CELLPADDING_ATTR, 373 CELLSPACING_ATTR, 374 DATAFLD_ATTR, 375 DATASRC_ATTR, 376 DATAFORMATAS_ATTR, 377 FRAME_ATTR, 378 RULES_ATTR, 379 SUMMARY_ATTR, 380 WIDTH_ATTR 381 }; 382 public static final String [] TABLE_PASSTHROUGH_ATTRIBUTES = 383 (String []) ArrayUtils.concat( 384 TABLE_ATTRIBUTES, 385 COMMON_PASSTROUGH_ATTRIBUTES); 386 387 public static final String COLS_ATTR = "cols"; 389 public static final String ROWS_ATTR = "rows"; 390 public static final String [] TEXTAREA_ATTRIBUTES = 391 { 392 COLS_ATTR, 393 DATAFLD_ATTR, 394 DATASRC_ATTR, 395 DATAFORMATAS_ATTR, 396 READONLY_ATTR, 397 ROWS_ATTR, 398 }; 399 public static final String [] TEXTAREA_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED = 400 (String []) ArrayUtils.concat( 401 TEXTAREA_ATTRIBUTES, 402 COMMON_FIELD_PASSTROUGH_ATTRIBUTES_WITHOUT_DISABLED); 403 404 public static final String [] INPUT_FILE_UPLOAD_ATTRIBUTES = 406 { 407 ACCEPT_ATTR 408 }; 409 public static final String [] INPUT_FILE_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED = 410 (String []) ArrayUtils.concat( 411 INPUT_FILE_UPLOAD_ATTRIBUTES, 412 INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED); 413 414 415 421 422 public static final String [] MESSAGE_PASSTHROUGH_ATTRIBUTES_WITHOUT_TITLE_STYLE_AND_STYLE_CLASS = 423 (String []) ArrayUtils.concat( 424 new String [] {DIR_ATTR, LANG_ATTR}, 425 EVENT_HANDLER_ATTRIBUTES); 426 427 428 public static final String [] SELECT_TABLE_PASSTHROUGH_ATTRIBUTES = 430 new String [] {STYLE_ATTR, STYLE_CLASS_ATTR, BORDER_ATTR}; 431 432 public static final String ID_ATTR = "id"; 434 public static final String NAME_ATTR = "name"; 435 public static final String VALUE_ATTR = "value"; 436 public static final String METHOD_ATTR = "method"; 437 public static final String ACTION_ATTR = "action"; 438 public static final String COLSPAN_ATTR = "colspan"; 439 public static final String SCOPE_ATTR = "scope"; 440 public static final String LABEL_ATTR = "label"; 441 public static final String SELECTED_ATTR = "selected"; 442 443 public static final String SCOPE_COLGROUP_VALUE = "colgroup"; 445 446 public static final String SPAN_ELEM = "span"; 448 public static final String DIV_ELEM = "div"; 449 public static final String INPUT_ELEM = "input"; 450 public static final String BUTTON_ELEM = "button"; 451 public static final String SELECT_ELEM = "select"; 452 public static final String OPTION_ELEM = "option"; 453 public static final String OPTGROUP_ELEM = "optgroup"; 454 public static final String TEXTAREA_ELEM = "textarea"; 455 public static final String FORM_ELEM = "form"; 456 public static final String ANCHOR_ELEM = "a"; 457 public static final String H1_ELEM = "h1"; 458 public static final String H2_ELEM = "h2"; 459 public static final String H3_ELEM = "h3"; 460 public static final String H4_ELEM = "h4"; 461 public static final String H5_ELEM = "h5"; 462 public static final String H6_ELEM = "h6"; 463 public static final String IFRAME_ELEM = "iframe"; 464 public static final String IMG_ELEM = "img"; 465 public static final String LABEL_ELEM = "label"; 466 public static final String TABLE_ELEM = "table"; 467 public static final String TR_ELEM = "tr"; 468 public static final String TH_ELEM = "th"; 469 public static final String TD_ELEM = "td"; 470 public static final String TBODY_ELEM = "tbody"; 471 public static final String TFOOT_ELEM = "tfoot"; 472 public static final String THEAD_ELEM = "thead"; 473 public static final String STYLE_ELEM = "style"; 474 public static final String SCRIPT_ELEM = "script"; 475 public static final String SCRIPT_TYPE_ATTR = "type"; 476 public static final String SCRIPT_TYPE_TEXT_JAVASCRIPT = "text/javascript"; 477 public static final String SCRIPT_LANGUAGE_ATTR = "language"; 478 public static final String SCRIPT_LANGUAGE_JAVASCRIPT = "JavaScript"; 479 480 public static final String UL_ELEM = "ul"; 481 public static final String OL_ELEM = "ol"; 482 public static final String LI_ELEM = "li"; 483 484 485 public static final String BR_ELEM = "br"; 487 488 489 public static final String NBSP_ENTITY = " "; 491 492 public static final String HREF_PATH_SEPARATOR = "/"; 493 public static final String HREF_PATH_FROM_PARAM_SEPARATOR = "?"; 494 public static final String HREF_PARAM_SEPARATOR = "&"; 495 public static final String HREF_PARAM_NAME_FROM_VALUE_SEPARATOR = "="; 496 497 } 498 | Popular Tags |