KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > packageview > 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.packageview;
12
13 import org.eclipse.jdt.ui.IPackagesViewPart;
14
15 import org.eclipse.jdt.internal.ui.actions.AbstractToggleLinkingAction;
16
17
18 /**
19  * This action toggles whether this package explorer links its selection to the active
20  * editor.
21  *
22  * @since 2.1
23  */

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

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

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