JBR-5221 Add announcing to JBRAPI

This commit is contained in:
Artem Semenov
2023-01-27 17:38:12 +03:00
committed by jbrbot
parent 7c4f0a02ae
commit 889f929229
4 changed files with 50 additions and 3 deletions

View File

@@ -49,6 +49,8 @@ public class JBRApiModule {
.clientProxy("java.awt.Desktop$DesktopActionsHandler", "com.jetbrains.DesktopActions$Handler")
.service("com.jetbrains.ProjectorUtils")
.withStatic("overrideGraphicsEnvironment", "overrideLocalGraphicsEnvironment", "java.awt.GraphicsEnvironment")
.withStatic("setLocalGraphicsEnvironmentProvider", "setLocalGraphicsEnvironmentProvider", "java.awt.GraphicsEnvironment");
.withStatic("setLocalGraphicsEnvironmentProvider", "setLocalGraphicsEnvironmentProvider", "java.awt.GraphicsEnvironment")
.service("com.jetbrains.AccessibleAnnouncer")
.withStatic("announce", "announce", "sun.swing.AccessibleAnnouncer");
}
}

View File

@@ -0,0 +1,44 @@
/*
* Copyright 2000-2022 JetBrains s.r.o.
* 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.
*
* 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 com.jetbrains;
import javax.accessibility.Accessible;
/**
* This interface provides the ability to speak a given string using screen readers.
*
*/
public interface AccessibleAnnouncer {
/*CONST sun.swing.AccessibleAnnouncer.ANNOUNCE_**/
/**
* 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);
}

View File

@@ -6,9 +6,9 @@
# 2. When only new API is added, or some existing API was @Deprecated - increment MINOR, reset PATCH to 0
# 3. For major backwards incompatible API changes - increment MAJOR, reset MINOR and PATCH to 0
VERSION = 0.0.7
VERSION = 0.0.8
# Hash is used to track changes to jetbrains.api, so you would not forget to update version when needed.
# When you make any changes, "make jbr-api" will fail and ask you to update hash and version number here.
HASH = 50DD43AD1517742CC33F31C7E5098
HASH = 1C63E17B3C89BC479BA6F1D8AC8F1AD

View File

@@ -57,6 +57,7 @@ public class JBRApiTest {
private static void testServices() {
Objects.requireNonNull(JBR.getExtendedGlyphCache().getSubpixelResolution());
Objects.requireNonNull(JBRFileDialog.get(new FileDialog((Frame) null)));
Objects.requireNonNull(JBR.getAccessibleAnnouncer());
if (!System.getProperty("os.name").toLowerCase().contains("linux")) {
Objects.requireNonNull(JBR.getRoundedCornersManager());
}