Example usage for com.google.gwt.aria.client Roles getAlertRole

List of usage examples for com.google.gwt.aria.client Roles getAlertRole

Introduction

In this page you can find the example usage for com.google.gwt.aria.client Roles getAlertRole.

Prototype

public static AlertRole getAlertRole() 

Source Link

Usage

From source file:com.vaadin.client.ApplicationConnection.java

License:Apache License

public void init(WidgetSet widgetSet, ApplicationConfiguration cnf) {
    getLogger().info("Starting application " + cnf.getRootPanelId());
    getLogger().info("Using theme: " + cnf.getThemeName());

    getLogger().info("Vaadin application servlet version: " + cnf.getServletVersion());

    if (!cnf.getServletVersion().equals(Version.getFullVersion())) {
        getLogger().severe("Warning: your widget set seems to be built with a different "
                + "version than the one used on server. Unexpected " + "behavior may occur.");
    }//from  w  w w  . ja v a2  s . c o  m

    this.widgetSet = widgetSet;
    configuration = cnf;

    layoutManager.setConnection(this);
    loadingIndicator.setConnection(this);
    serverRpcQueue.setConnection(this);
    messageHandler.setConnection(this);
    messageSender.setConnection(this);

    ComponentLocator componentLocator = new ComponentLocator(this);

    String appRootPanelName = cnf.getRootPanelId();
    // remove the end (window name) of autogenerated rootpanel id
    appRootPanelName = appRootPanelName.replaceFirst("-\\d+$", "");

    initializeTestbenchHooks(componentLocator, appRootPanelName);

    initializeClientHooks();

    uIConnector.init(cnf.getRootPanelId(), this);

    // Connection state handler preloads the reconnect dialog, which uses
    // overlay container. This in turn depends on VUI being attached
    // (done in uiConnector.init)
    connectionStateHandler.setConnection(this);

    tooltip.setOwner(uIConnector.getWidget());

    getLoadingIndicator().show();

    heartbeat.init(this);

    // Ensure the overlay container is added to the dom and set as a live
    // area for assistive devices
    Element overlayContainer = VOverlay.getOverlayContainer(this);
    Roles.getAlertRole().setAriaLiveProperty(overlayContainer, LiveValue.ASSERTIVE);
    VOverlay.setOverlayContainerLabel(this, getUIConnector().getState().overlayContainerLabel);
    Roles.getAlertRole().setAriaRelevantProperty(overlayContainer, RelevantValue.ADDITIONS);
}

From source file:com.vaadin.client.ui.VNotification.java

License:Apache License

private void setWaiAriaRole(NotificationTypeConfiguration styleSetup) {
    Roles.getAlertRole().set(getElement());

    if (styleSetup != null && styleSetup.notificationRole != null) {
        if (NotificationRole.STATUS == styleSetup.notificationRole) {
            Roles.getStatusRole().set(getElement());
        }/*  w w w . j a va  2  s.c  o  m*/
    }
}

From source file:com.vaadin.client.ui.VOverlay.java

License:Apache License

/**
 * Set the label of the container element, where tooltip, notification and
 * dialgs are added to.//from ww w .  j a  va  2  s  . c o m
 * 
 * @param applicationConnection
 *            the application connection for which to change the label
 * @param overlayContainerLabel
 *            label for the container
 */
public static void setOverlayContainerLabel(ApplicationConnection applicationConnection,
        String overlayContainerLabel) {
    Roles.getAlertRole().setAriaLabelProperty(VOverlay.getOverlayContainer(applicationConnection),
            overlayContainerLabel);
}