From 525f80129379a74a7b7a39b4a3afef988ad50c33 Mon Sep 17 00:00:00 2001 From: Gerald Mitchell Date: Wed, 15 Sep 2021 22:50:59 -0400 Subject: [PATCH] Bug 575949: The section title cannot be read out The section title "Elements" can not be read out from Syntax Coloring Preferences page. "Preview" could also not be read out. Change-Id: Ia8e8261739100808eda7bccb28b4c2fca5d59210 Reported-by: Gerald Mitchell Signed-off-by: Gerald Mitchell --- .../CEditorColoringConfigurationBlock.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorColoringConfigurationBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorColoringConfigurationBlock.java index a162968943e..ff63377fd90 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorColoringConfigurationBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorColoringConfigurationBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2020 IBM Corporation and others. + * Copyright (c) 2000, 2021 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -56,6 +56,8 @@ import org.eclipse.jface.viewers.TreeViewer; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerComparator; import org.eclipse.swt.SWT; +import org.eclipse.swt.accessibility.AccessibleAdapter; +import org.eclipse.swt.accessibility.AccessibleEvent; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; @@ -647,6 +649,13 @@ class CEditorColoringConfigurationBlock extends AbstractConfigurationBlock { gd.widthHint = maxWidth; fListViewer.getControl().setLayoutData(gd); + // add the coloring element label text as the name for the list viewer + fListViewer.getControl().getAccessible().addAccessibleListener(new AccessibleAdapter() { + @Override + public void getName(AccessibleEvent e) { + e.result = PreferencesMessages.CEditorColoringConfigurationBlock_coloring_element; + } + }); Composite stylesComposite = new Composite(editorComposite, SWT.NONE); layout = new GridLayout(); @@ -711,6 +720,13 @@ class CEditorColoringConfigurationBlock extends AbstractConfigurationBlock { gd.widthHint = convertWidthInCharsToPixels(20); gd.heightHint = convertHeightInCharsToPixels(5); previewer.setLayoutData(gd); + // add the preview label text as the name to the previewer + previewer.getAccessible().addAccessibleListener(new AccessibleAdapter() { + @Override + public void getName(AccessibleEvent e) { + e.result = PreferencesMessages.CEditorColoringConfigurationBlock_preview; + } + }); fListViewer.addSelectionChangedListener(new ISelectionChangedListener() { @Override