-
Notifications
You must be signed in to change notification settings - Fork 583
8384483: Create implementation of NSAccessibilityTable protocol #2217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
f005ca5
52d6cc5
99f9c70
e93291e
8172963
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -801,6 +801,20 @@ public enum AccessibleAttribute { | |
| */ | ||
| VERTICAL_SCROLLBAR(Node.class), | ||
|
|
||
| /** | ||
| * Returns the range of visible items in an indexed control. | ||
| * <ul> | ||
| * <li>Used by: ListView and TableView </li> | ||
| * <li>Needs notify: no </li> | ||
| * <li>Return Type: {@code int[]} containing the first item index and the | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please specify how it encodes a no-range case. it looks like the code returns [0,0], but is this right?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The {0, 0} is the valid range, we should not return empty array or null in any case. |
||
| * number of visible items </li> | ||
| * <li>Parameters: </li> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Parameters: should describe the structure (see |
||
| * </ul> | ||
| * | ||
| * @since 28 | ||
| */ | ||
| VISIBLE_ITEM_RANGE(int[].class), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
minor: the values in this enum are not sorted alphabetically - should they? do we care?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I have no idea. If that would be a change in the public API i would definitely say yes, for the attribute - since we add it and not changing the meaning of the existing attribute - may be? Gray area for me honestly. @kevinrushforth Any comments?
That would require more processing on the native side so i would just leave it as is. It is a technical attribute that is required to pass information from the skin level to the native a11y helper - it is not supposed to be available for any other purposes.
Not really. Changing the existing code just to sort the enum - i would hate to do so, i prefer to keep the history cleaner, it's an old code, technical binding of the parameters to the native bound variables, nobody really looks at it except the compiler.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AccessibleAttribute is public API. The new attribute also needs (it's fine to keep it an
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Oh well. Time to learn how to create CSR for JavaFX. Yaaaaay.... [/sarcasm off]
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It's new API, so yes, a CSR is in order.
Yeah, let's not do this. In addition to creating diff churn for no good reason, this would techincally be an incompatible change, since it would change the result of the "ordinal()" method. In practice I can't imagine that wouldn't matter, but ...
Same way as you would for the JDK. :)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Although, I see that we've inserted enums in the middle before, and this does too, so nm about the compatibility point. Still, let's not have the churn. |
||
|
|
||
| /** | ||
| * Returns true if node is visible, otherwise false. | ||
| * <ul> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| /* | ||
| * Copyright (c) 2026, 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. | ||
| */ | ||
|
|
||
| #import "AccessibleBase.h" | ||
| #import <AppKit/NSAccessibility.h> | ||
|
|
||
| @interface JFXListAccessibility : AccessibleBase { | ||
| }; | ||
|
|
||
| - (NSAccessibilityRole)accessibilityRole; | ||
| - (NSString *)accessibilityLabel; | ||
| - (BOOL)isAccessibilityEnabled; | ||
| - (NSArray *)accessibilityChildren; | ||
| - (id)accessibilityParent; | ||
| - (NSRect)accessibilityFrame; | ||
| - (NSInteger)accessibilityColumnCount; | ||
| - (NSInteger)accessibilityRowCount; | ||
| - (NSArray *)accessibilityRows; | ||
| - (NSArray *)accessibilitySelectedRows; | ||
| - (void)setAccessibilitySelectedRows:(NSArray *)selectedRows; | ||
| @end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this code is not being hit when scrolling with the mouse.
should the change in the viewport origin result in VISIBLE_ITEM_RANGE being updated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not until the VO requests the data. Which happens when it detects change in the selected row or when we enter/exit the table or list with VO selection shortcuts.