Bug 97671 [preferences] Java Preference Pages using in accessible Color selection
RC1 The Linked Mode and Syntax colouring pages are both using a color button with no accessibility information. When someone using a screen reader selects it they will get no feedback as to what the button is for - just a random graphic. I assume you are not using the JFace ColorSelector as that has an accessible listener. Here is our code in ColorSelector if you need it for reference: fButton.getAccessible().addAccessibleListener(new AccessibleAdapter() { /* * (non-Javadoc) * * @see org.eclipse.swt.accessibility.AccessibleAdapter#getName(org.eclipse.swt.accessibility.AccessibleEvent) */ public void getName(AccessibleEvent e) { e.result = JFaceResources.getString("ColorSelector.Name"); //$NON-NLS-1$ } });
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorColoringConfigurationBlock.java
{ createHighlightedRange(17,  2, 12, SemanticHighlightings.STATIC_METHOD_INVOCATION), createHighlightedRange(17,  2, 12, SemanticHighlightings.METHOD) },
			{ createHighlightedRange(18, 9,  3, SemanticHighlightings.METHOD) },
			{ createHighlightedRange(18, 13,  5, SemanticHighlightings.LOCAL_VARIABLE) },
			{ createHighlightedRange(18, 22,  9, SemanticHighlightings.AUTOBOXING) },
		};
	}
	/**
	 * Create a highlighted range on the previewers document with the given line, column, length and key.
	 * 
	 * @param line the line
	 * @param column the column
	 * @param length the length
	 * @param key the key
	 * @return the highlighted range
	 * @since 3.0
	 */
	private HighlightedRange createHighlightedRange(int line, int column, int length, String key) {
		try {
			IDocument document= fPreviewViewer.getDocument();
			int offset= document.getLineOffset(line) + column;
			return new HighlightedRange(offset, length, key);
		} catch (BadLocationException x) {
			JavaPlugin.log(x);
		}
		return null;
	}
	/**
	 * Returns the current highlighting color list item.
	 * 
	 * @return the current highlighting color list item