com.vaadin.polymer.iron.widget.IronA11yAnnouncer Maven / Gradle / Ivy
/*
* This code was generated with Vaadin Web Component GWT API Generator,
* from iron-a11y-announcer project by The Polymer Authors
* that is licensed with http://polymer.github.io/LICENSE.txt license.
*/
package com.vaadin.polymer.iron.widget;
import com.vaadin.polymer.iron.*;
import com.vaadin.polymer.*;
import com.vaadin.polymer.elemental.*;
import com.vaadin.polymer.PolymerWidget;
import com.google.gwt.core.client.JsArray;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.core.client.JavaScriptObject;
/**
* iron-a11y-announcer
is a singleton element that is intended to add a11y
to features that require on-demand announcement from screen readers. In
order to make use of the announcer, it is best to request its availability
in the announcing element.
* Example:
* Polymer({
*
* is: 'x-chatty',
*
* attached: function() {
* // This will create the singleton element if it has not
* // been created yet:
* Polymer.IronA11yAnnouncer.requestAvailability();
* }
* });
*
*
*
After the iron-a11y-announcer
has been made available, elements can
make announces by firing bubbling iron-announce
events.
* Example:
* this.fire('iron-announce', {
* text: 'This is an announcement!'
* }, { bubbles: true });
*
*
*
Note: announcements are only audible if you have a screen reader enabled.
*/
public class IronA11yAnnouncer extends PolymerWidget {
/**
* Default Constructor.
*/
public IronA11yAnnouncer() {
this("");
}
/**
* Constructor used by UIBinder to create widgets with content.
*/
public IronA11yAnnouncer(String html) {
super(IronA11yAnnouncerElement.TAG, IronA11yAnnouncerElement.SRC, html);
}
/**
* Gets a handle to the Polymer object's underlying DOM element.
*/
public IronA11yAnnouncerElement getPolymerElement() {
return (IronA11yAnnouncerElement) getElement();
}
/**
* The value of mode is used to set the aria-live
attribute
for the element that will be announced. Valid values are: off
,
polite
and assertive
.
*
* JavaScript Info:
* @property mode
* @type String
*
*/
public String getMode() {
return getPolymerElement().getMode();
}
/**
* The value of mode is used to set the aria-live
attribute
for the element that will be announced. Valid values are: off
,
polite
and assertive
.
*
* JavaScript Info:
* @property mode
* @type String
*
*/
public void setMode(String value) {
getPolymerElement().setMode(value);
}
/**
* Cause a text string to be announced by screen readers.
*
* JavaScript Info:
* @method announce
* @param {string} text
*
*
*/
public void announce(String text) {
getPolymerElement().announce(text);
}
}