KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > views > navigator > 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
12 package org.eclipse.ui.views.navigator;
13
14 /**
15  * This action toggles whether this navigator links its selection to the active
16  * editor.
17  *
18  * @since 2.1
19  */

20 public class ToggleLinkingAction extends ResourceNavigatorAction {
21
22     /**
23      * Constructs a new action.
24      */

25     public ToggleLinkingAction(IResourceNavigator navigator, String JavaDoc label) {
26         super(navigator, label);
27         setChecked(navigator.isLinkingEnabled());
28     }
29
30     /**
31      * Runs the action.
32      */

33     public void run() {
34         getNavigator().setLinkingEnabled(isChecked());
35     }
36
37 }
38
Popular Tags