Roles
. There are getters for all ARIA roles. For each
role there are get/set/remove methods defined for all (own and inherited) supported states
and properties.@Deprecated public final class Accessibility extends Object
Allows ARIA attributes to be added to widgets so that they can be identified by assistive technologies.
A 'role' describes the role a widget plays in a page: i.e. a checkbox widget is assigned a "checkbox" role.
A 'state' describes the current state of the widget. For example, a checkbox widget has the state "checked", which is given a value of "true" or "false" depending on whether it is currently checked or unchecked.
See the MDC page on Accessible DHTML for more information.
Note that although this API is public, the ARIA specification is still somewhat in flux. As a result, this API is subject to change as the specification stabilizes; we will do our best to keep the community updated on changes.
Modifier and Type | Field and Description |
---|---|
static String |
ROLE_BUTTON
Deprecated.
|
static String |
ROLE_MENUBAR
Deprecated.
|
static String |
ROLE_MENUITEM
Deprecated.
|
static String |
ROLE_TAB
Deprecated.
|
static String |
ROLE_TABLIST
Deprecated.
|
static String |
ROLE_TABPANEL
Deprecated.
|
static String |
ROLE_TREE
Deprecated.
|
static String |
ROLE_TREEITEM
Deprecated.
|
static String |
STATE_ACTIVEDESCENDANT
Deprecated.
|
static String |
STATE_EXPANDED
Deprecated.
|
static String |
STATE_HASPOPUP
Deprecated.
|
static String |
STATE_LEVEL
Deprecated.
|
static String |
STATE_POSINSET
Deprecated.
|
static String |
STATE_PRESSED
Deprecated.
|
static String |
STATE_SELECTED
Deprecated.
|
static String |
STATE_SETSIZE
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static String |
getRole(Element elem)
Deprecated.
Requests the string value of the role with the specified namespace.
|
static String |
getState(Element elem,
String stateName)
Deprecated.
Requests the string value of the state with the specified namespace.
|
static void |
removeState(Element elem,
String stateName)
Deprecated.
Removes the state from the given element.
|
static void |
setRole(Element elem,
String roleName)
Deprecated.
Assigns the specified element the specified role and value for that role.
|
static void |
setState(Element elem,
String stateName,
String stateValue)
Deprecated.
Assigns the specified element the specified state and value for that state.
|
public static final String ROLE_TREE
public static final String ROLE_TREEITEM
public static final String ROLE_BUTTON
public static final String ROLE_TABLIST
public static final String ROLE_TAB
public static final String ROLE_TABPANEL
public static final String ROLE_MENUBAR
public static final String ROLE_MENUITEM
public static final String STATE_ACTIVEDESCENDANT
public static final String STATE_POSINSET
public static final String STATE_SETSIZE
public static final String STATE_SELECTED
public static final String STATE_EXPANDED
public static final String STATE_LEVEL
public static final String STATE_HASPOPUP
public static final String STATE_PRESSED
public static String getRole(Element elem)
elem
- the element which has the specified rolepublic static String getState(Element elem, String stateName)
elem
- the element which has the specified statestateName
- the name of the statepublic static void removeState(Element elem, String stateName)
elem
- the element which has the specified statestateName
- the name of the state to removepublic static void setRole(Element elem, String roleName)
elem
- the element to be given the specified roleroleName
- the name of the rolepublic static void setState(Element elem, String stateName, String stateValue)
elem
- the element to be given the specified statestateName
- the name of the statestateValue
- the value of the stateCopyright © 2018. All rights reserved.