List of usage examples for com.google.gwt.aria.client LiveValue ASSERTIVE
LiveValue ASSERTIVE
To view the source code for com.google.gwt.aria.client LiveValue ASSERTIVE.
Click Source Link
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 ww.j a va 2 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.VAbstractPopupCalendar.java
License:Apache License
public VAbstractPopupCalendar(PANEL calendarPanel, R resolution) { super(resolution); calendarToggle.setText(""); calendarToggle.addClickHandler(this); calendarToggle.addDomHandler(new MouseOverHandler() { @Override/* w w w . j a va 2 s. c o m*/ public void onMouseOver(MouseOverEvent event) { cursorOverCalendarToggleButton = true; } }, MouseOverEvent.getType()); calendarToggle.addDomHandler(new MouseOutHandler() { @Override public void onMouseOut(MouseOutEvent event) { cursorOverCalendarToggleButton = false; } }, MouseOutEvent.getType()); // -2 instead of -1 to avoid FocusWidget.onAttach to reset it calendarToggle.getElement().setTabIndex(-2); Roles.getButtonRole().set(calendarToggle.getElement()); Roles.getButtonRole().setAriaHiddenState(calendarToggle.getElement(), true); add(calendarToggle); // Description of the usage of the widget for assisitve device users descriptionForAssisitveDevicesElement = DOM.createDiv(); descriptionForAssisitveDevicesElement.setInnerText(TextualDateFieldState.DESCRIPTION_FOR_ASSISTIVE_DEVICES); AriaHelper.ensureHasId(descriptionForAssisitveDevicesElement); Roles.getTextboxRole().setAriaDescribedbyProperty(text.getElement(), Id.of(descriptionForAssisitveDevicesElement)); AriaHelper.setVisibleForAssistiveDevicesOnly(descriptionForAssisitveDevicesElement, true); calendar = calendarPanel; calendar.setParentField(this); calendar.setFocusOutListener(new FocusOutListener() { @Override public boolean onFocusOut(DomEvent<?> event) { event.preventDefault(); closeCalendarPanel(); return true; } }); // FIXME: Problem is, that the element with the provided id does not // exist yet in html. This is the same problem as with the context menu. // Apply here the same fix (#11795) Roles.getTextboxRole().setAriaControlsProperty(text.getElement(), Id.of(calendar.getElement())); Roles.getButtonRole().setAriaControlsProperty(calendarToggle.getElement(), Id.of(calendar.getElement())); calendar.setSubmitListener(new SubmitListener() { @Override public void onSubmit() { // Update internal value and send valuechange event if immediate updateValue(calendar.getDate()); // Update text field (a must when not immediate). buildDate(true); closeCalendarPanel(); } @Override public void onCancel() { closeCalendarPanel(); } }); popup = new VOverlay(true, false); popup.setOwner(this); FlowPanel wrapper = new FlowPanel(); selectedDate = new Label(); selectedDate.setStyleName(getStylePrimaryName() + "-selecteddate"); AriaHelper.setVisibleForAssistiveDevicesOnly(selectedDate.getElement(), true); Roles.getTextboxRole().setAriaLiveProperty(selectedDate.getElement(), LiveValue.ASSERTIVE); Roles.getTextboxRole().setAriaAtomicProperty(selectedDate.getElement(), true); wrapper.add(selectedDate); wrapper.add(calendar); popup.setWidget(wrapper); popup.addCloseHandler(this); DOM.setElementProperty(calendar.getElement(), "id", "PID_VAADIN_POPUPCAL"); sinkEvents(Event.ONKEYDOWN); updateStyleNames(); }
From source file:com.vaadin.client.ui.VPopupCalendar.java
License:Apache License
public VPopupCalendar() { super();/* w ww.j a v a2 s .c o m*/ calendarToggle.setText(""); calendarToggle.addClickHandler(this); calendarToggle.addDomHandler(new MouseOverHandler() { @Override public void onMouseOver(MouseOverEvent event) { cursorOverCalendarToggleButton = true; } }, MouseOverEvent.getType()); calendarToggle.addDomHandler(new MouseOutHandler() { @Override public void onMouseOut(MouseOutEvent event) { cursorOverCalendarToggleButton = false; } }, MouseOutEvent.getType()); // -2 instead of -1 to avoid FocusWidget.onAttach to reset it calendarToggle.getElement().setTabIndex(-2); Roles.getButtonRole().set(calendarToggle.getElement()); Roles.getButtonRole().setAriaHiddenState(calendarToggle.getElement(), true); add(calendarToggle); // Description of the usage of the widget for assisitve device users descriptionForAssisitveDevicesElement = DOM.createDiv(); descriptionForAssisitveDevicesElement.setInnerText(PopupDateFieldState.DESCRIPTION_FOR_ASSISTIVE_DEVICES); AriaHelper.ensureHasId(descriptionForAssisitveDevicesElement); Roles.getTextboxRole().setAriaDescribedbyProperty(text.getElement(), Id.of(descriptionForAssisitveDevicesElement)); AriaHelper.setVisibleForAssistiveDevicesOnly(descriptionForAssisitveDevicesElement, true); calendar = GWT.create(VCalendarPanel.class); calendar.setParentField(this); calendar.setFocusOutListener(new FocusOutListener() { @Override public boolean onFocusOut(DomEvent<?> event) { event.preventDefault(); closeCalendarPanel(); return true; } }); // FIXME: Problem is, that the element with the provided id does not // exist yet in html. This is the same problem as with the context menu. // Apply here the same fix (#11795) Roles.getTextboxRole().setAriaControlsProperty(text.getElement(), Id.of(calendar.getElement())); Roles.getButtonRole().setAriaControlsProperty(calendarToggle.getElement(), Id.of(calendar.getElement())); calendar.setSubmitListener(new SubmitListener() { @Override public void onSubmit() { // Update internal value and send valuechange event if immediate updateValue(calendar.getDate()); // Update text field (a must when not immediate). buildDate(true); closeCalendarPanel(); } @Override public void onCancel() { closeCalendarPanel(); } }); popup = new VOverlay(true, false, true); popup.setOwner(this); FlowPanel wrapper = new FlowPanel(); selectedDate = new Label(); selectedDate.setStyleName(getStylePrimaryName() + "-selecteddate"); AriaHelper.setVisibleForAssistiveDevicesOnly(selectedDate.getElement(), true); Roles.getTextboxRole().setAriaLiveProperty(selectedDate.getElement(), LiveValue.ASSERTIVE); Roles.getTextboxRole().setAriaAtomicProperty(selectedDate.getElement(), true); wrapper.add(selectedDate); wrapper.add(calendar); popup.setWidget(wrapper); popup.addCloseHandler(this); DOM.setElementProperty(calendar.getElement(), "id", "PID_VAADIN_POPUPCAL"); sinkEvents(Event.ONKEYDOWN); updateStyleNames(); }
From source file:com.vaadin.client.VTooltip.java
License:Apache License
/** * Used to show tooltips; usually used via the singleton in * {@link ApplicationConnection}. NOTE that #setOwner(Widget)} should be * called after instantiating./*w ww . j av a 2 s .c om*/ * * @see ApplicationConnection#getVTooltip() */ public VTooltip() { super(false, false, true); setStyleName(CLASSNAME); FlowPanel layout = new FlowPanel(); setWidget(layout); layout.add(em); DOM.setElementProperty(description, "className", CLASSNAME + "-text"); DOM.appendChild(layout.getElement(), description); setSinkShadowEvents(true); // When a tooltip is shown, the content of the tooltip changes. With a // tooltip being a live-area, this change is notified to a assistive // device. Roles.getTooltipRole().set(getElement()); Roles.getTooltipRole().setAriaLiveProperty(getElement(), LiveValue.ASSERTIVE); Roles.getTooltipRole().setAriaRelevantProperty(getElement(), RelevantValue.ADDITIONS); // Tooltip needs to be on top of other VOverlay elements. setZIndex(VOverlay.Z_INDEX + 1); }
From source file:com.vaadin.v7.client.ui.VPopupCalendar.java
License:Apache License
public VPopupCalendar() { super();/*from w w w .j a v a2 s. com*/ calendarToggle.setText(""); calendarToggle.addClickHandler(this); calendarToggle.addDomHandler(new MouseOverHandler() { @Override public void onMouseOver(MouseOverEvent event) { cursorOverCalendarToggleButton = true; } }, MouseOverEvent.getType()); calendarToggle.addDomHandler(new MouseOutHandler() { @Override public void onMouseOut(MouseOutEvent event) { cursorOverCalendarToggleButton = false; } }, MouseOutEvent.getType()); // -2 instead of -1 to avoid FocusWidget.onAttach to reset it calendarToggle.getElement().setTabIndex(-2); Roles.getButtonRole().set(calendarToggle.getElement()); Roles.getButtonRole().setAriaHiddenState(calendarToggle.getElement(), true); add(calendarToggle); // Description of the usage of the widget for assisitve device users descriptionForAssisitveDevicesElement = DOM.createDiv(); descriptionForAssisitveDevicesElement.setInnerText(PopupDateFieldState.DESCRIPTION_FOR_ASSISTIVE_DEVICES); AriaHelper.ensureHasId(descriptionForAssisitveDevicesElement); Roles.getTextboxRole().setAriaDescribedbyProperty(text.getElement(), Id.of(descriptionForAssisitveDevicesElement)); AriaHelper.setVisibleForAssistiveDevicesOnly(descriptionForAssisitveDevicesElement, true); calendar = GWT.create(VCalendarPanel.class); calendar.setParentField(this); calendar.setFocusOutListener(new FocusOutListener() { @Override public boolean onFocusOut(DomEvent<?> event) { event.preventDefault(); closeCalendarPanel(); return true; } }); // FIXME: Problem is, that the element with the provided id does not // exist yet in html. This is the same problem as with the context menu. // Apply here the same fix (#11795) Roles.getTextboxRole().setAriaControlsProperty(text.getElement(), Id.of(calendar.getElement())); Roles.getButtonRole().setAriaControlsProperty(calendarToggle.getElement(), Id.of(calendar.getElement())); calendar.setSubmitListener(new SubmitListener() { @Override public void onSubmit() { // Update internal value and send valuechange event if immediate updateValue(calendar.getDate()); // Update text field (a must when not immediate). buildDate(true); closeCalendarPanel(); } @Override public void onCancel() { closeCalendarPanel(); } }); popup = new VOverlay(true, false); popup.setOwner(this); FlowPanel wrapper = new FlowPanel(); selectedDate = new Label(); selectedDate.setStyleName(getStylePrimaryName() + "-selecteddate"); AriaHelper.setVisibleForAssistiveDevicesOnly(selectedDate.getElement(), true); Roles.getTextboxRole().setAriaLiveProperty(selectedDate.getElement(), LiveValue.ASSERTIVE); Roles.getTextboxRole().setAriaAtomicProperty(selectedDate.getElement(), true); wrapper.add(selectedDate); wrapper.add(calendar); popup.setWidget(wrapper); popup.addCloseHandler(this); DOM.setElementProperty(calendar.getElement(), "id", "PID_VAADIN_POPUPCAL"); sinkEvents(Event.ONKEYDOWN); updateStyleNames(); }
From source file:gov.wa.wsdot.mobile.client.activities.mountainpasses.MountainPassesViewGwtImpl.java
License:Open Source License
private void accessibilityPrepare() { // Add ARIA roles for accessibility Roles.getButtonRole().set(backButton.getElement()); Roles.getButtonRole().setAriaLabelProperty(backButton.getElement(), "back"); Roles.getHeadingRole().set(heading.getElement()); Roles.getProgressbarRole().set(progressIndicator.getElement()); Roles.getProgressbarRole().setAriaLabelProperty(progressIndicator.getElement(), "loading indicator"); Roles.getProgressbarRole().setAriaLiveProperty(progressIndicator.getElement(), LiveValue.ASSERTIVE); // TODO Hide pull down until we can figure out how to get VoiceOver to work with it Roles.getButtonRole().setAriaHiddenState(pullArrowHeader.getElement(), true); }
From source file:gov.wa.wsdot.mobile.client.activities.socialmedia.blogger.BlogViewGwtImpl.java
License:Open Source License
private void accessibilityPrepare() { // Add ARIA roles for accessibility Roles.getButtonRole().set(backButton.getElement()); Roles.getButtonRole().setAriaLabelProperty(backButton.getElement(), "back"); Roles.getHeadingRole().set(heading.getElement()); Roles.getProgressbarRole().set(progressIndicator.getElement()); Roles.getProgressbarRole().setAriaLabelProperty(progressIndicator.getElement(), "loading indicator"); Roles.getProgressbarRole().setAriaLiveProperty(progressIndicator.getElement(), LiveValue.ASSERTIVE); // TODO Hide pull down until we can figure out how to get VoiceOver to work with it Roles.getButtonRole().setAriaHiddenState(pullArrowHeader.getElement(), true); }
From source file:gov.wa.wsdot.mobile.client.activities.socialmedia.twitter.TwitterViewGwtImpl.java
License:Open Source License
private void accessibilityPrepare() { // Add ARIA roles for accessibility Roles.getButtonRole().set(backButton.getElement()); Roles.getButtonRole().setAriaLabelProperty(backButton.getElement(), "back"); Roles.getHeadingRole().set(heading.getElement()); Roles.getMenuRole().set(twitterAccounts.getElement()); Roles.getMenuRole().setAriaLabelProperty(twitterAccounts.getElement(), "select a twitter account"); Roles.getMenuRole().setTabindexExtraAttribute(twitterAccounts.getElement(), 0); Roles.getProgressbarRole().setAriaLabelProperty(progressIndicator.getElement(), "loading indicator"); Roles.getProgressbarRole().setAriaLiveProperty(progressIndicator.getElement(), LiveValue.ASSERTIVE); // TODO Hide pull down until we can figure out how to get VoiceOver to work with it Roles.getButtonRole().setAriaHiddenState(pullArrowHeader.getElement(), true); }
From source file:org.unitime.timetable.gwt.client.aria.AriaStatus.java
License:Apache License
protected AriaStatus(Element element, boolean assertive) { setElement(element);//from ww w .j a v a 2s . c o m setStyleName("unitime-AriaStatus"); Roles.getStatusRole().set(getElement()); Roles.getStatusRole().setAriaLiveProperty(getElement(), assertive ? LiveValue.ASSERTIVE : LiveValue.POLITE); Roles.getStatusRole().setAriaAtomicProperty(getElement(), true); }