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/ColorEditor.java
protected void updateColorImage() {
		
		Display display= fButton.getDisplay();
		
		GC gc= new GC(fImage);
		gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
		gc.drawRectangle(0, 2, fExtent.x - 1, fExtent.y - 4);
		
		if (fColor != null)
			fColor.dispose();
			
		fColor= new Color(display, fColorValue);
		gc.setBackground(fColor);
		gc.fillRectangle(1, 3, fExtent.x - 2, fExtent.y - 5);
		gc.dispose();
		
		fButton.setImage(fImage);
	}
	
	protected Point computeImageSize(Control window) {
		GC gc= new GC(window);
		Font f= JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT);
		gc.setFont(f);
		int height= gc.getFontMetrics().getHeight();
		gc.dispose();
		Point p= new Point(height * 3 - 6, height);
		return p;
	}
}