01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jdt.internal.ui.typehierarchy;
11:
12: import org.eclipse.jdt.ui.ITypeHierarchyViewPart;
13:
14: import org.eclipse.jdt.internal.ui.actions.AbstractToggleLinkingAction;
15:
16: /**
17: * This action toggles whether the type hierarchy links its selection to the active
18: * editor.
19: *
20: * @since 2.1
21: */
22: public class ToggleLinkingAction extends AbstractToggleLinkingAction {
23:
24: private ITypeHierarchyViewPart fHierarchyViewPart;
25:
26: /**
27: * Constructs a new action.
28: */
29: public ToggleLinkingAction(ITypeHierarchyViewPart part) {
30: setChecked(part.isLinkingEnabled());
31: fHierarchyViewPart = part;
32: }
33:
34: /**
35: * Runs the action.
36: */
37: public void run() {
38: fHierarchyViewPart.setLinkingEnabled(isChecked());
39: }
40:
41: }
|