]>
Commit | Line | Data |
---|---|---|
1b2798f6 EK |
1 | /******************************************************************************* |
2 | * Copyright (c) 2010, 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 | *******************************************************************************/ | |
11 | package org.eclipse.jdt.internal.ui.callhierarchy; | |
12 | ||
13 | import org.eclipse.jface.action.Action; | |
14 | import org.eclipse.jface.action.IAction; | |
15 | ||
16 | import org.eclipse.ui.PlatformUI; | |
17 | ||
18 | import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; | |
19 | import org.eclipse.jdt.internal.ui.JavaPluginImages; | |
20 | ||
21 | ||
22 | /** | |
23 | * The action to pin the Call Hierarchy view. | |
24 | * | |
25 | * @since 3.7 | |
26 | */ | |
27 | class PinCallHierarchyViewAction extends Action { | |
28 | private CallHierarchyViewPart fView= null; | |
29 | ||
30 | /** | |
31 | * Constructs a 'Pin Call Hierarchy view' action. | |
32 | * | |
33 | * @param view the Call Hierarchy view | |
34 | */ | |
35 | public PinCallHierarchyViewAction(CallHierarchyViewPart view) { | |
36 | super(CallHierarchyMessages.PinCallHierarchyViewAction_label, IAction.AS_CHECK_BOX); | |
37 | setToolTipText(CallHierarchyMessages.PinCallHierarchyViewAction_tooltip); | |
38 | JavaPluginImages.setLocalImageDescriptors(this, "pin_view.gif"); //$NON-NLS-1$ | |
39 | PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.CALL_HIERARCHY_PIN_VIEW_ACTION); | |
40 | fView= view; | |
41 | } | |
42 | ||
43 | /* | |
44 | * @see org.eclipse.jface.action.Action#run() | |
45 | */ | |
46 | @Override | |
47 | public void run() { | |
48 | fView.setPinned(isChecked()); | |
49 | } | |
50 | } |