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.ui.views.navigator;
11:
12: /**
13: * This action toggles whether this navigator links its selection to the active
14: * editor.
15: *
16: * @since 2.1
17: */
18: public class ToggleLinkingAction extends ResourceNavigatorAction {
19:
20: /**
21: * Constructs a new action.
22: */
23: public ToggleLinkingAction(IResourceNavigator navigator,
24: String label) {
25: super (navigator, label);
26: setChecked(navigator.isLinkingEnabled());
27: }
28:
29: /**
30: * Runs the action.
31: */
32: public void run() {
33: getNavigator().setLinkingEnabled(isChecked());
34: }
35:
36: }
|