KickJava   Java API By Example, From Geeks To Geeks.

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


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.jdt.ui.ITypeHierarchyViewPart;
14
15 import org.eclipse.jdt.internal.ui.actions.AbstractToggleLinkingAction;
16
17
18 /**
19  * This action toggles whether the type hierarchy links its selection to the active
20  * editor.
21  *
22  * @since 2.1
23  */

24 public class ToggleLinkingAction extends AbstractToggleLinkingAction {
25     
26     private ITypeHierarchyViewPart fHierarchyViewPart;
27     
28     /**
29      * Constructs a new action.
30      */

31     public ToggleLinkingAction(ITypeHierarchyViewPart part) {
32         setChecked(part.isLinkingEnabled());
33         fHierarchyViewPart= part;
34     }
35
36     /**
37      * Runs the action.
38      */

39     public void run() {
40         fHierarchyViewPart.setLinkingEnabled(isChecked());
41     }
42
43 }
44
Popular Tags