public class AriaHelper extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ASSISTIVE_DEVICE_ONLY_STYLE |
Constructor and Description |
---|
AriaHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
bindCaption(com.google.gwt.user.client.ui.Widget widget,
com.google.gwt.dom.client.Element captionElement)
Binds a caption (label in HTML speak) to the form element as required by
WAI-ARIA specification.
|
static String |
ensureHasId(com.google.gwt.dom.client.Element element)
Makes sure that the provided element has an id attribute.
|
static void |
handleInputInvalid(com.google.gwt.dom.client.Element element,
boolean invalid)
Handles the required actions depending of the input element contains
unaccepted input.
|
static void |
handleInputInvalid(com.google.gwt.user.client.ui.Widget widget,
boolean invalid)
Handles the required actions depending of the input Widget contains
unaccepted input.
|
static void |
handleInputRequired(com.google.gwt.dom.client.Element element,
boolean required)
Handles the required actions depending of the input element being
required or not.
|
static void |
handleInputRequired(com.google.gwt.user.client.ui.Widget widget,
boolean required)
Handles the required actions depending of the input Widget being required
or not.
|
static void |
setVisibleForAssistiveDevicesOnly(com.google.gwt.dom.client.Element element,
boolean assistiveOnly)
Allows to move an element out of the visible area of the browser window.
|
public static final String ASSISTIVE_DEVICE_ONLY_STYLE
public static void bindCaption(com.google.gwt.user.client.ui.Widget widget, com.google.gwt.dom.client.Element captionElement)
widget
- Widget, that should be bound to the captioncaptionElement
- Element with of caption to bindpublic static void handleInputRequired(com.google.gwt.user.client.ui.Widget widget, boolean required)
widget
- Widget, typically an input Widget like TextFieldrequired
- boolean, true when the element is requiredpublic static void handleInputRequired(com.google.gwt.dom.client.Element element, boolean required)
element
- Element, typically from an input Widget like TextFieldrequired
- boolean, true when the element is requiredpublic static void handleInputInvalid(com.google.gwt.user.client.ui.Widget widget, boolean invalid)
widget
- Widget, typically an input Widget like TextFieldinvalid
- boolean, true when the Widget input has an errorpublic static void handleInputInvalid(com.google.gwt.dom.client.Element element, boolean invalid)
element
- Element, typically an input Widget like TextFieldinvalid
- boolean, true when the element input has an errorpublic static String ensureHasId(com.google.gwt.dom.client.Element element)
element
- Element to checkpublic static void setVisibleForAssistiveDevicesOnly(com.google.gwt.dom.client.Element element, boolean assistiveOnly)
element
- Element to move out of sightassistiveOnly
- true
when element should only be visible for assistive
devices, false
to make the element visible for allCopyright © 2018 Vaadin Ltd. All rights reserved.