GWT 2.5.0.rc1

com.google.gwt.aria.client
Class Roles

java.lang.Object
  extended by com.google.gwt.aria.client.Roles

public final class Roles
extends java.lang.Object

Class containing the ARIA roles as defined by W3C ARIA specification. A WAI-ARIA role is set on an element using a role attribute. An element role is constant and is not supposed to change.

This is the central class in this ARIA API because it contains all defined roles which can be set to HTML elements. Each role in this class is a Role instance. The Role class contains methods for getting and setting states and properties.

Lets say we have an image button widget and we want to make it visible to a reader as a button, accompanied with some help text for the button usage. For the purpose we need to add a 'button' role to the image and set label that the reader can interpret. We set the 'button' role for an image (img) with the call: Roles.getButtonRole.set(img.getElement()) and set the 'aria-label' property by calling: Roles.getButtonRole().setAriaLabelProperty(img.getElement, "test")

ARIA states are used similarly to ARIA properties by using the Roles.getButtonRole().setAriaEnabledState(img.getElement(), isEnabled) method. Although States and Properties are structurally the same, they are separated in 2 classes in this API because they are semantically different and have different usage. There exist the concept of extra properties and for now the only example is tabindex. If we want to set the tabindex to 0 for the button, we need to call Roles.getButtonRole().setTabindexExtraAttribute(img.getElement(), 0).

There are 4 groups of roles:

  1. Abstract roles -- used as base types for applied roles. They are not used by Web Authors and would not be exposed as role definitions for incorporation into a Web page. Base classes are referenced within the taxonomy and are used to build a picture of the role taxonomy class hierarchy within the taxonomy.
  2. Widget roles -- act as standalone user interface widgets or as part of larger, composite widgets
  3. Widget container roles -- act as composite user interface widgets. These roles typically act as containers that manage other, contained widgets
  4. Document structure roles -- describe structures that organize content in a page. Document structures are not usually interactive
  5. Landmark Roles -- regions of the page intended as navigational landmarks

For more details about ARIA roles check


Constructor Summary
Roles()
           
 
Method Summary
static AlertdialogRole getAlertdialogRole()
           
static AlertRole getAlertRole()
           
static ApplicationRole getApplicationRole()
           
static ArticleRole getArticleRole()
           
static BannerRole getBannerRole()
           
static ButtonRole getButtonRole()
           
static CheckboxRole getCheckboxRole()
           
static ColumnheaderRole getColumnheaderRole()
           
static ComboboxRole getComboboxRole()
           
static ComplementaryRole getComplementaryRole()
           
static ContentinfoRole getContentinfoRole()
           
static DefinitionRole getDefinitionRole()
           
static DialogRole getDialogRole()
           
static DirectoryRole getDirectoryRole()
           
static DocumentRole getDocumentRole()
           
static FormRole getFormRole()
           
static GridcellRole getGridcellRole()
           
static GridRole getGridRole()
           
static GroupRole getGroupRole()
           
static HeadingRole getHeadingRole()
           
static ImgRole getImgRole()
           
static LinkRole getLinkRole()
           
static ListboxRole getListboxRole()
           
static ListitemRole getListitemRole()
           
static ListRole getListRole()
           
static LogRole getLogRole()
           
static MainRole getMainRole()
           
static MarqueeRole getMarqueeRole()
           
static MathRole getMathRole()
           
static MenubarRole getMenubarRole()
           
static MenuitemcheckboxRole getMenuitemcheckboxRole()
           
static MenuitemradioRole getMenuitemradioRole()
           
static MenuitemRole getMenuitemRole()
           
static MenuRole getMenuRole()
           
static NavigationRole getNavigationRole()
           
static NoteRole getNoteRole()
           
static OptionRole getOptionRole()
           
static PresentationRole getPresentationRole()
           
static ProgressbarRole getProgressbarRole()
           
static RadiogroupRole getRadiogroupRole()
           
static RadioRole getRadioRole()
           
static RegionRole getRegionRole()
           
static RowgroupRole getRowgroupRole()
           
static RowheaderRole getRowheaderRole()
           
static RowRole getRowRole()
           
static ScrollbarRole getScrollbarRole()
           
static SearchRole getSearchRole()
           
static SeparatorRole getSeparatorRole()
           
static SliderRole getSliderRole()
           
static SpinbuttonRole getSpinbuttonRole()
           
static StatusRole getStatusRole()
           
static TablistRole getTablistRole()
           
static TabpanelRole getTabpanelRole()
           
static TabRole getTabRole()
           
static TextboxRole getTextboxRole()
           
static TimerRole getTimerRole()
           
static ToolbarRole getToolbarRole()
           
static TooltipRole getTooltipRole()
           
static TreegridRole getTreegridRole()
           
static TreeitemRole getTreeitemRole()
           
static TreeRole getTreeRole()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Roles

public Roles()
Method Detail

getAlertdialogRole

public static AlertdialogRole getAlertdialogRole()

getAlertRole

public static AlertRole getAlertRole()

getApplicationRole

public static ApplicationRole getApplicationRole()

getArticleRole

public static ArticleRole getArticleRole()

getBannerRole

public static BannerRole getBannerRole()

getButtonRole

public static ButtonRole getButtonRole()

getCheckboxRole

public static CheckboxRole getCheckboxRole()

getColumnheaderRole

public static ColumnheaderRole getColumnheaderRole()

getComboboxRole

public static ComboboxRole getComboboxRole()

getComplementaryRole

public static ComplementaryRole getComplementaryRole()

getContentinfoRole

public static ContentinfoRole getContentinfoRole()

getDefinitionRole

public static DefinitionRole getDefinitionRole()

getDialogRole

public static DialogRole getDialogRole()

getDirectoryRole

public static DirectoryRole getDirectoryRole()

getDocumentRole

public static DocumentRole getDocumentRole()

getFormRole

public static FormRole getFormRole()

getGridcellRole

public static GridcellRole getGridcellRole()

getGridRole

public static GridRole getGridRole()

getGroupRole

public static GroupRole getGroupRole()

getHeadingRole

public static HeadingRole getHeadingRole()

getImgRole

public static ImgRole getImgRole()

getLinkRole

public static LinkRole getLinkRole()

getListboxRole

public static ListboxRole getListboxRole()

getListitemRole

public static ListitemRole getListitemRole()

getListRole

public static ListRole getListRole()

getLogRole

public static LogRole getLogRole()

getMainRole

public static MainRole getMainRole()

getMarqueeRole

public static MarqueeRole getMarqueeRole()

getMathRole

public static MathRole getMathRole()

getMenubarRole

public static MenubarRole getMenubarRole()

getMenuitemcheckboxRole

public static MenuitemcheckboxRole getMenuitemcheckboxRole()

getMenuitemradioRole

public static MenuitemradioRole getMenuitemradioRole()

getMenuitemRole

public static MenuitemRole getMenuitemRole()

getMenuRole

public static MenuRole getMenuRole()

getNavigationRole

public static NavigationRole getNavigationRole()

getNoteRole

public static NoteRole getNoteRole()

getOptionRole

public static OptionRole getOptionRole()

getPresentationRole

public static PresentationRole getPresentationRole()

getProgressbarRole

public static ProgressbarRole getProgressbarRole()

getRadiogroupRole

public static RadiogroupRole getRadiogroupRole()

getRadioRole

public static RadioRole getRadioRole()

getRegionRole

public static RegionRole getRegionRole()

getRowgroupRole

public static RowgroupRole getRowgroupRole()

getRowheaderRole

public static RowheaderRole getRowheaderRole()

getRowRole

public static RowRole getRowRole()

getScrollbarRole

public static ScrollbarRole getScrollbarRole()

getSearchRole

public static SearchRole getSearchRole()

getSeparatorRole

public static SeparatorRole getSeparatorRole()

getSliderRole

public static SliderRole getSliderRole()

getSpinbuttonRole

public static SpinbuttonRole getSpinbuttonRole()

getStatusRole

public static StatusRole getStatusRole()

getTablistRole

public static TablistRole getTablistRole()

getTabpanelRole

public static TabpanelRole getTabpanelRole()

getTabRole

public static TabRole getTabRole()

getTextboxRole

public static TextboxRole getTextboxRole()

getTimerRole

public static TimerRole getTimerRole()

getToolbarRole

public static ToolbarRole getToolbarRole()

getTooltipRole

public static TooltipRole getTooltipRole()

getTreegridRole

public static TreegridRole getTreegridRole()

getTreeitemRole

public static TreeitemRole getTreeitemRole()

getTreeRole

public static TreeRole getTreeRole()

GWT 2.5.0.rc1