Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8304085

New interface for Accessibility announcements

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 21
    • client-libs
    • None

      Summary
      We need to define and implement a new interface that will allow java applications to make announce tthrough the accessibility subsystem.
      Problem:
      Current implementation of the Java accessibility subsystem does not allow application to request to speak out the arbitrary string when application status changed. For example - when application performs some background task and it wants to announce that the task is complete or when application requires some action to be done in specific period of time - like announcing that current session is about to expire and some input is needed in order to prevent it.
      Solution
      The idea of the change is to provide an API and implement the native code to make it work on all supported platforms.
      Specification
      --- /dev/null
      +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleAnnouncer.java
      @@ -0,0 +1,55 @@
      +/*
      + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
      + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      + *
      + * This code is free software; you can redistribute it and/or modify it
      + * under the terms of the GNU General Public License version 2 only, as
      + * published by the Free Software Foundation. Oracle designates this
      + * particular file as subject to the "Classpath" exception as provided
      + * by Oracle in the LICENSE file that accompanied this code.
      + *
      + * This code is distributed in the hope that it will be useful, but WITHOUT
      + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
      + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
      + * version 2 for more details (a copy is included in the LICENSE file that
      + * accompanied this code).
      + *
      + * You should have received a copy of the GNU General Public License version
      + * 2 along with this work; if not, write to the Free Software Foundation,
      + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
      + *
      + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
      + * or visit www.oracle.com if you need additional information or have any
      + * questions.
      + */
      +
      +package javax.accessibility;
      +
      +import javax.accessibility.Accessible;
      +import java.lang.annotation.Native;
      +
      +/**
      + * This interface provides the ability to speak a given string using screen readers.
      + */
      +public interface AccessibleAnnouncer {
      +
      + /**
      + * messages do not interrupt the current speech, they are spoken after the screen reader has spoken the current phrase
      + */
      + @Native int ANNOUNCE_WITHOUT_INTERRUPTING_CURRENT_OUTPUT = 0;
      +
      + /**
      + * messages interrupt the current speech, but only when the focus is on the window of the calling application
      + */
      + @Native int ANNOUNCE_WITH_INTERRUPTING_CURRENT_OUTPUT = 1;
      +
      + /**
      + * This method makes an announcement with the specified priority from an accessible to which the announcing relates
      + *
      + * @param a an accessible to which the announcing relates
      + * @param str string for announcing
      + * @param priority priority for announcing
      + */
      + void announce(Accessible a, final String str, final int priority);
      +
      +}

            asemenov Artem Semenov
            asemenov Artem Semenov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: