Index: src/org/eclipse/mat/ui/editor/MultiPaneEditor.java =================================================================== --- src/org/eclipse/mat/ui/editor/MultiPaneEditor.java (revision 1081) +++ src/org/eclipse/mat/ui/editor/MultiPaneEditor.java (working copy) @@ -50,6 +50,7 @@ import org.eclipse.mat.query.IQueryContext; import org.eclipse.mat.ui.MemoryAnalyserPlugin; import org.eclipse.mat.ui.Messages; +import org.eclipse.mat.ui.accessibility.AccessibleToolbarAdapter; import org.eclipse.mat.ui.snapshot.ImageHelper.ImageImageDescriptor; import org.eclipse.mat.ui.util.ErrorHelper; import org.eclipse.mat.ui.util.NavigatorState; @@ -214,11 +215,15 @@ // create tool bar ToolBar toolbar = new ToolBar(composite, SWT.FLAT); + // Add custom AccessibleAdapter, passing in associated ToolBar. + toolbar.getAccessible().addAccessibleListener(new AccessibleToolbarAdapter(toolbar) ); GridDataFactory.fillDefaults().grab(true, false).indent(0, 2).applyTo(toolbar); toolbarMgr = new ToolBarManager(toolbar); // create tool bar toolbar = new ToolBar(composite, SWT.FLAT); + // Add custom AccessibleAdapter, passing in associated ToolBar. + toolbar.getAccessible().addAccessibleListener(new AccessibleToolbarAdapter(toolbar) ); GridDataFactory.fillDefaults().grab(false, false).indent(0, 2).applyTo(toolbar); toolbarMgrHelp = new ToolBarManager(toolbar); Index: src/org/eclipse/mat/ui/accessibility/AccessibleToolbarAdapter.java =================================================================== --- src/org/eclipse/mat/ui/accessibility/AccessibleToolbarAdapter.java (revision 0) +++ src/org/eclipse/mat/ui/accessibility/AccessibleToolbarAdapter.java (revision 0) @@ -0,0 +1,49 @@ +/******************************************************************************* + * Copyright (c) 2011 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial implementation + *******************************************************************************/ + +package org.eclipse.mat.ui.accessibility; + +import org.eclipse.swt.accessibility.ACC; +import org.eclipse.swt.accessibility.AccessibleAdapter; +import org.eclipse.swt.accessibility.AccessibleEvent; +import org.eclipse.swt.widgets.ToolBar; +import org.eclipse.swt.widgets.ToolItem; + +public class AccessibleToolbarAdapter extends AccessibleAdapter +{ + + private ToolBar toolBar; // ToolBar with which this adapter is associated. + + public AccessibleToolbarAdapter(ToolBar toolBar) + { + super(); + this.toolBar = toolBar; // Store ref to associated toolbar + } + + @Override + public void getName(AccessibleEvent e) + { + if (e.childID != ACC.CHILDID_SELF) + { // Not self - ie probably a child + ToolItem item = toolBar.getItem(e.childID); // Try to get child item + if (item != null) + { // Found it + String toolTip = item.getToolTipText(); // Get tool tip if any + if (toolTip != null) + { // Got one + e.result = toolTip; // Return to caller in AccessibleEvent + } + } + } + } // getName() + +} // AccessibleToolbarAdapter + Index: src/org/eclipse/mat/ui/snapshot/views/inspector/InspectorView.java =================================================================== --- src/org/eclipse/mat/ui/snapshot/views/inspector/InspectorView.java (revision 1081) +++ src/org/eclipse/mat/ui/snapshot/views/inspector/InspectorView.java (working copy) @@ -56,6 +56,7 @@ import org.eclipse.mat.snapshot.model.IPrimitiveArray; import org.eclipse.mat.ui.MemoryAnalyserPlugin; import org.eclipse.mat.ui.Messages; +import org.eclipse.mat.ui.accessibility.AccessibleToolbarAdapter; import org.eclipse.mat.ui.snapshot.ImageHelper; import org.eclipse.mat.ui.snapshot.editor.HeapEditor; import org.eclipse.mat.ui.snapshot.editor.ISnapshotEditorInput; @@ -476,6 +477,8 @@ GridDataFactory.fillDefaults().grab(true, true).align(SWT.FILL, SWT.FILL).applyTo(tabFolder); ToolBar toolBar = new ToolBar(tabFolder, SWT.HORIZONTAL | SWT.FLAT); + // Add custom AccessibleAdapter, passing in associated ToolBar. + toolBar.getAccessible().addAccessibleListener(new AccessibleToolbarAdapter(toolBar) ); tabFolder.setTopRight(toolBar); // set the height of the tab to display the tool bar correctly tabFolder.setTabHeight(Math.max(toolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT).y, tabFolder.getTabHeight()));