KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > typehierarchy > ShowInheritedMembersAction


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.ui.typehierarchy;
12
13 import org.eclipse.swt.custom.BusyIndicator;
14
15 import org.eclipse.jface.action.Action;
16
17 import org.eclipse.ui.PlatformUI;
18
19 import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
20 import org.eclipse.jdt.internal.ui.JavaPluginImages;
21
22 /**
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
25  */

26 public class ShowInheritedMembersAction extends Action {
27     
28     private MethodsViewer fMethodsViewer;
29     
30     /**
31      * Creates the action.
32      */

33     public ShowInheritedMembersAction(MethodsViewer viewer, boolean initValue) {
34         super(TypeHierarchyMessages.ShowInheritedMembersAction_label);
35         setDescription(TypeHierarchyMessages.ShowInheritedMembersAction_description);
36         setToolTipText(TypeHierarchyMessages.ShowInheritedMembersAction_tooltip);
37         
38         JavaPluginImages.setLocalImageDescriptors(this, "inher_co.gif"); //$NON-NLS-1$
39

40         fMethodsViewer= viewer;
41         
42         PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.SHOW_INHERITED_ACTION);
43  
44         setChecked(initValue);
45     }
46     
47     /*
48      * @see Action#actionPerformed
49      */

50     public void run() {
51         BusyIndicator.showWhile(fMethodsViewer.getControl().getDisplay(), new Runnable JavaDoc() {
52             public void run() {
53                 fMethodsViewer.showInheritedMethods(isChecked());
54             }
55         });
56     }
57 }
58
Popular Tags