Community
Participate
Working Groups
Run Snippet026TreeViewerTabEditing. Run the Windows accessibility inspector, inspect32.exe (if you don't have this, you can get it from: http://www.microsoft.com/downloads/details.aspx?familyid=3755582A-A707-460A-BF21-1373316E13F0&displaylang=en Click the download button next to inspect32.exe in the table.) While looking at the Name: field in the inspect32 window, click on a cell in the Snippet's Tree. Using the keyboard and/or the mouse, navigate from cell to cell in the tree. Notice that the Name: field only reflects the cell label in Column 1. The user expects that the accessible Name is the focused cell's label text, not just the cell in Column 1. I have hacked up some proof-of-concept code to show approximately how accessibility can be added to this Tree. Note that this is awful code, and I don't know where to put it in all of the JFace code, so I threw most of it into the Snippet but I had to temporarily make 2 private JFace methods public to get it to compile, and there's one line needed in SWTFocusCellManager.... but this hack works perfectly. I am assuming that someone with knowledge of the JFace code can use this to help write the correct code. Here is the hack: Part 1: Paste the following at the end of the Snippet026TreeViewerTabEditing(final Shell shell) constructor: v.getTree().getAccessible().addAccessibleListener(new AccessibleAdapter() { public void getName(AccessibleEvent event) { ViewerCell cell = focusCellManager.getFocusCell(); if( cell == null ) return; ViewerRow row = cell.getViewerRow(); if( row == null ) return; Object element = row.getItem().getData(); ViewerColumn viewPart = v.getViewerColumn(cell.getColumnIndex()); if (viewPart == null) return; ColumnLabelProvider labelProvider = (ColumnLabelProvider)viewPart.getLabelProvider(); if (labelProvider == null) return; event.result = labelProvider.getText(element); } }); Part 2: Temporarily make ViewerColumn.getLabelProvider() and ColumnViewer.getViewerColumn(final int columnIndex) public, so that this compiles. Part 3: Paste the following at the end of setFocusCell(ViewerCell focusCell): getViewer().getControl().getAccessible().setFocus(ACC.CHILDID_SELF); Now start up inspect32.exe again and look at the Name: field. Click on any cell and notice that the Name: is now correct. Use the arrow keys to traverse, and notice that the name updates correctly. This will make it possible for screen readers to say the correct thing when the user navigates between cells. If it is at all possible, could a fix be determined in time for RC1? I have a customer who is hoping that this will be fixed for 3.5. Sorry for the very late notice.
Thanks for the code Carolyn. Boris - I'd take a look tomorrow and integrate the code into JFace so that no API change is needed.
Created attachment 135027 [details] Patch because it was so easy I'd vote with +1 because this a real issue with the current implementation and the feature looks save to me.
could you please attach the patch again, without the formatting changes?
Created attachment 135033 [details] Without formatting changes
Thanks for the very quick response, Tom! So, all of the code belonged in SWTFocusCellManager - I was so close! <grin>
+1 for RC1 from a code point of view. Carolyn, can you verify this for us once it's in a build?
released to CVS-HEAD >= 20090510
Hm - I forgot to set the target version appropriately :-( but the fix is in the code base. Carolyn could you verify that it works?
Confirmed. Thanks!
This issue was originally reported in version 3.5. Confirmed with Carolyn that the issue is still in version 3.42 (confirmed for accessibility for Optim Designer 9.1).