JDK-8139194 : CAccessible does not add listeners to some custom accessible components
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.accessibility
  • Affected Version: 8u45
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: other
  • CPU: x86
  • Submitted: 2015-06-23
  • Updated: 2016-06-02
  • Resolved: 2016-06-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9Resolved
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Darwin macpro 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64

A DESCRIPTION OF THE PROBLEM :
The mac version does not add accessible listeners to custom AccessibleContexts that implement AccessibleEditableText and or AccessibleExtendedText, such that when things like selections change, the user is not notified. They are notified with a JTextComponent since the logic has:
    if (c instanceof JTextComponent) {
            JTextComponent tc = (JTextComponent) c;
            AXTextChangeNotifier listener = new AXTextChangeNotifier();
            tc.getDocument().addDocumentListener(listener);
            tc.addCaretListener(listener);
        }
but it doesn't listen to custom ones.

Note: the sample code routes the AccessibleContext that way because I don't want to have to write a dummy one my self for demonstration.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Use the panel in the sample code in a form. Select some text with the mouse

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Voice over speaks the selected text
ACTUAL -
Nothing happens

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
public class CustomAccessible extends javax.swing.JPanel {

	private final JScrollPane sneakyPane;
	private final JEditorPane innerPane;
	/**
	 * Creates new form CustomAccessible
	 */
	public CustomAccessible() {
		innerPane = new JEditorPane();
		innerPane.setText("The quick brown fox jumped over the lazy dog");
		sneakyPane = new JScrollPane(){
			@Override
			public AccessibleContext getAccessibleContext() {
				return null;
			}

		};
		sneakyPane.setViewportView(innerPane);
		initComponents();
		add(sneakyPane);
	}

	/**
	 * This method is called from within the constructor to initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is always
	 * regenerated by the Form Editor.
	 */
	@SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setLayout(new javax.swing.BoxLayout(this, javax.swing.BoxLayout.LINE_AXIS));
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables



	@Override
	public AccessibleContext getAccessibleContext() {
		return innerPane.getAccessibleContext();
	}
	
	private static class SneakyScrollArea extends JScrollPane{

		@Override
		public AccessibleContext getAccessibleContext() {
			return null;
		}

	}


}

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
There is none.


Comments
Duplicate of JDK-8076554
12-10-2015

Found this interesting commentary: http://tools.android.com/tech-docs/accessibility/editor
12-10-2015

Moving to JDK project. Has example code for the condition. Setting Fix/Version to JDK 9 for Dev evaluation. Will consider N-bp as needed.
08-10-2015