KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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.ui.ITypeHierarchyViewPart;
20
21 import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
22 import org.eclipse.jdt.internal.ui.JavaPluginImages;
23
24 /**
25  * Action enable / disable showing qualified type names
26  */

27 public class ShowQualifiedTypeNamesAction extends Action {
28
29     private ITypeHierarchyViewPart fView;
30     
31     public ShowQualifiedTypeNamesAction(ITypeHierarchyViewPart v, boolean initValue) {
32         super(TypeHierarchyMessages.ShowQualifiedTypeNamesAction_label);
33         setDescription(TypeHierarchyMessages.ShowQualifiedTypeNamesAction_description);
34         setToolTipText(TypeHierarchyMessages.ShowQualifiedTypeNamesAction_tooltip);
35         
36         JavaPluginImages.setLocalImageDescriptors(this, "th_showqualified.gif"); //$NON-NLS-1$
37

38         fView= v;
39         setChecked(initValue);
40         
41         PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.SHOW_QUALIFIED_NAMES_ACTION);
42     }
43
44     /*
45      * @see Action#actionPerformed
46      */

47     public void run() {
48         BusyIndicator.showWhile(fView.getSite().getShell().getDisplay(), new Runnable JavaDoc() {
49             public void run() {
50                 fView.showQualifiedTypeNames(isChecked());
51             }
52         });
53     }
54 }
55
Popular Tags