Returns this element's tab index, if it has one. If the tab index is outside the valid range (less than 0 or greater than 32767 ), this method returns #TAB_INDEX_OUT_OF_BOUNDS. If this element does not have a tab index, or its tab index is otherwise invalid, this met
()
| 445 | * @return this element's tab index |
| 446 | */ |
| 447 | public Short getTabIndex() { |
| 448 | final String index = getAttributeDirect("tabindex"); |
| 449 | if (index == null || index.isEmpty()) { |
| 450 | return null; |
| 451 | } |
| 452 | try { |
| 453 | final long l = Long.parseLong(index); |
| 454 | if (l >= 0 && l <= Short.MAX_VALUE) { |
| 455 | return Short.valueOf((short) l); |
| 456 | } |
| 457 | return TAB_INDEX_OUT_OF_BOUNDS; |
| 458 | } |
| 459 | catch (final NumberFormatException e) { |
| 460 | return null; |
| 461 | } |
| 462 | } |
| 463 | |
| 464 | /** |
| 465 | * Returns the first element with the specified tag name that is an ancestor to this element, or |
no test coverage detected