On Tue, 31 Mar 2026 02:22:02 GMT, Jeremy Wood <[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.)

I am not sufficiently familiar with the design and philosophy of the public 
APIs to know if this is the right direction.
It is a non-trivial and wide-ranging change, and adding a method to an 
interface that external code might implement without an obvious default method 
implementation is something we'd need to think about.
I was hoping for something much simpler and more specific.

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

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

Reply via email to