aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarolyn MacLeod2011-11-11 11:44:35 (EST)
committerPaul Webster2011-11-11 11:44:35 (EST)
commit8a86e632f23a4795e6f70dfcbc6dc91c64e8c806 (patch)
tree072e122d3509494cf04cb0067e5a52e568583616
parent1ebce21a189c6a448e8f0ed9cbc4305ca84b9a28 (diff)
downloadeclipse.platform.ui-8a86e632f23a4795e6f70dfcbc6dc91c64e8c806.zip
eclipse.platform.ui-8a86e632f23a4795e6f70dfcbc6dc91c64e8c806.tar.gz
eclipse.platform.ui-8a86e632f23a4795e6f70dfcbc6dc91c64e8c806.tar.bz2
Bug 348461 - Perspective switcher tool items need to be accessible
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/e4/ui/workbench/addons/perspectiveswitcher/PerspectiveSwitcher.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/e4/ui/workbench/addons/perspectiveswitcher/PerspectiveSwitcher.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/e4/ui/workbench/addons/perspectiveswitcher/PerspectiveSwitcher.java
index a90990f..c3ef88f 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/e4/ui/workbench/addons/perspectiveswitcher/PerspectiveSwitcher.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/e4/ui/workbench/addons/perspectiveswitcher/PerspectiveSwitcher.java
@@ -35,6 +35,8 @@ import org.eclipse.e4.ui.workbench.UIEvents;
import org.eclipse.e4.ui.workbench.modeling.EModelService;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleAdapter;
+import org.eclipse.swt.accessibility.AccessibleEvent;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.MenuDetectEvent;
@@ -339,6 +341,17 @@ public class PerspectiveSwitcher {
});
+ psTB.getAccessible().addAccessibleListener(new AccessibleAdapter() {
+ public void getName(AccessibleEvent e) {
+ if (0 <= e.childID && e.childID < psTB.getItemCount()) {
+ ToolItem item = psTB.getItem(e.childID);
+ if (item != null) {
+ e.result = item.getToolTipText();
+ }
+ }
+ }
+ });
+
final ToolItem createItem = new ToolItem(psTB, SWT.PUSH);
createItem.setImage(getOpenPerspectiveImage());
createItem.setToolTipText(WorkbenchMessages.OpenPerspectiveDialogAction_tooltip);