]> git.uio.no Git - ifi-stolz-refaktor.git/blame - case-study/jdt-after/ui/org/eclipse/jdt/internal/ui/typehierarchy/ShowQualifiedTypeNamesAction.java
Case Study: adding data and statistics
[ifi-stolz-refaktor.git] / case-study / jdt-after / ui / org / eclipse / jdt / internal / ui / typehierarchy / ShowQualifiedTypeNamesAction.java
CommitLineData
1b2798f6
EK
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
7 *
8 * Contributors:
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11package org.eclipse.jdt.internal.ui.typehierarchy;
12
13import org.eclipse.swt.custom.BusyIndicator;
14
15import org.eclipse.jface.action.Action;
16
17import org.eclipse.ui.PlatformUI;
18
19import org.eclipse.jdt.ui.ITypeHierarchyViewPart;
20
21import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
22import org.eclipse.jdt.internal.ui.JavaPluginImages;
23
24/**
25 * Action enable / disable showing qualified type names
26 */
27public 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 @Override
48 public void run() {
49 BusyIndicator.showWhile(fView.getSite().getShell().getDisplay(), new Runnable() {
50 public void run() {
51 fView.showQualifiedTypeNames(isChecked());
52 }
53 });
54 }
55}