mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-09 07:35:49 +00:00
8378057: CAccessibility roleKey and AWTAccessor.AccessibleBundleAccessor are Redundant
Reviewed-by: kizune, serb
This commit is contained in:
parent
8ef39a22d8
commit
7e5acdc6fa
@ -116,7 +116,9 @@ final class CAccessibility implements PropertyChangeListener {
|
||||
if (newValue instanceof Accessible) {
|
||||
AccessibleContext nvAC = ((Accessible) newValue).getAccessibleContext();
|
||||
AccessibleRole nvRole = nvAC.getAccessibleRole();
|
||||
if (!ignoredRoles.contains(roleKey(nvRole))) {
|
||||
String roleStr = nvRole == null ? null :
|
||||
AWTAccessor.getAccessibleBundleAccessor().getKey(nvRole);
|
||||
if (!ignoredRoles.contains(roleStr)) {
|
||||
focusChanged();
|
||||
}
|
||||
}
|
||||
@ -1034,8 +1036,10 @@ final class CAccessibility implements PropertyChangeListener {
|
||||
// "ignored", and we should skip it and its descendants
|
||||
if (isShowing(context)) {
|
||||
final AccessibleRole role = context.getAccessibleRole();
|
||||
if (role != null && ignoredRoles != null &&
|
||||
ignoredRoles.contains(roleKey(role))) {
|
||||
String roleStr = role == null ? null :
|
||||
AWTAccessor.getAccessibleBundleAccessor().getKey(role);
|
||||
if (roleStr != null && ignoredRoles != null &&
|
||||
ignoredRoles.contains(roleStr)) {
|
||||
// Get the child's unignored children.
|
||||
_addChildren(child, whichChildren, false,
|
||||
childrenAndRoles, ChildrenOperations.COMMON);
|
||||
@ -1096,8 +1100,6 @@ final class CAccessibility implements PropertyChangeListener {
|
||||
return isShowing(parentContext);
|
||||
}
|
||||
|
||||
private static native String roleKey(AccessibleRole aRole);
|
||||
|
||||
public static Object[] getChildren(final Accessible a, final Component c) {
|
||||
if (a == null) return null;
|
||||
return invokeAndWait(new Callable<Object[]>() {
|
||||
|
||||
@ -325,20 +325,6 @@ static BOOL JavaAccessibilityIsSupportedAttribute(id element, NSString *attribut
|
||||
return [[element accessibilityAttributeNames] indexOfObject:attribute] != NSNotFound;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: sun_lwawt_macosx_CAccessibility
|
||||
* Method: roleKey
|
||||
* Signature: (Ljavax/accessibility/AccessibleRole;)Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL Java_sun_lwawt_macosx_CAccessibility_roleKey
|
||||
(JNIEnv *env, jclass clz, jobject axRole)
|
||||
{
|
||||
DECLARE_CLASS_RETURN(sjc_AccessibleRole, "javax/accessibility/AccessibleRole", NULL);
|
||||
DECLARE_FIELD_RETURN(sjf_key, sjc_AccessibleRole, "key", "Ljava/lang/String;", NULL);
|
||||
return (*env)->GetObjectField(env, axRole, sjf_key);
|
||||
}
|
||||
|
||||
|
||||
// errors from NSAccessibilityErrors
|
||||
void JavaAccessibilityRaiseSetAttributeToIllegalTypeException(const char *functionName, id element, NSString *attribute, id value)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user