1 /*******************************************************************************
2 * Copyright (c) 2000, 2011 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package org.eclipse.jdt.internal.ui.typehierarchy;
13 import org.eclipse.swt.custom.BusyIndicator;
15 import org.eclipse.jface.action.Action;
17 import org.eclipse.ui.PlatformUI;
19 import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
20 import org.eclipse.jdt.internal.ui.JavaPluginImages;
23 * Action to show / hide inherited members in the method view
24 * Depending in the action state a different label provider is installed in the viewer
26 public class ShowInheritedMembersAction extends Action {
28 private MethodsViewer fMethodsViewer;
32 * @param viewer the viewer
33 * @param initValue the initial state
35 public ShowInheritedMembersAction(MethodsViewer viewer, boolean initValue) {
36 super(TypeHierarchyMessages.ShowInheritedMembersAction_label);
37 setDescription(TypeHierarchyMessages.ShowInheritedMembersAction_description);
38 setToolTipText(TypeHierarchyMessages.ShowInheritedMembersAction_tooltip);
40 JavaPluginImages.setLocalImageDescriptors(this, "inher_co.gif"); //$NON-NLS-1$
42 fMethodsViewer= viewer;
44 PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.SHOW_INHERITED_ACTION);
46 setChecked(initValue);
50 * @see Action#actionPerformed
54 BusyIndicator.showWhile(fMethodsViewer.getControl().getDisplay(), new Runnable() {
56 fMethodsViewer.showInheritedMethods(isChecked());