On Mon, 30 Mar 2026 18:47:07 GMT, Phil Race <[email protected]> wrote:

> I think it sounds like an inconsistent mess.

Well that's something of a relief. (That is: at least you're not telling me 
that the design is fine and I'm just misunderstanding it.)

> And internally we probably should never be calling APIs that like 
> getAccessibleActionDescription() to use in the implementation, if that is, 
> they can be returning localized messages for an end user.
We should be doing something else.

I agree. Here is my first choice (assuming changing existing method signatures 
is a nonstarter) for a "something else" we could try:

https://github.com/openjdk/jdk/compare/master...mickleness:8377938B?expand=1

This preserves `AccessibleAction.getAccessibleActionDescription(int)`, but it 
adds `AccessibleAction.getAccessibleActionType(int)`. This new method returns a 
constant field from AccessibleAction. (It's modeled after 
BufferedImage#getType().)

In your opinion is that approach worth pursuing, or would you like to see 
something else?

(One last important piece of context: JavaAccessibilityActions.m hardwires its 
own table of actions:

void initializeActions() {
    int actionsCount = 5;

    sActions = [[NSMutableDictionary alloc] initWithCapacity:actionsCount];

    [sActions setObject:NSAccessibilityPressAction forKey:@"click"];
    [sActions setObject:NSAccessibilityIncrementAction forKey:@"increment"];
    [sActions setObject:NSAccessibilityDecrementAction forKey:@"decrement"];
    [sActions setObject:NSAccessibilityShowMenuAction forKey:@"toggle popup"];
    [sActions setObject:NSAccessibilityPressAction forKey:@"toggleexpand"];
    ...


So this is what we'd be cross referencing when we consult the new `type` 
method.)

-------------

PR Comment: https://git.openjdk.org/jdk/pull/30181#issuecomment-4159394805

Reply via email to