01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 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.browsing;
11:
12: import org.eclipse.jdt.internal.ui.actions.AbstractToggleLinkingAction;
13:
14: /**
15: * This action toggles whether this package explorer links its selection to the active
16: * editor.
17: *
18: * @since 2.1
19: */
20: public class ToggleLinkingAction extends AbstractToggleLinkingAction {
21:
22: JavaBrowsingPart fJavaBrowsingPart;
23:
24: /**
25: * Constructs a new action.
26: */
27: public ToggleLinkingAction(JavaBrowsingPart part) {
28: setChecked(part.isLinkingEnabled());
29: fJavaBrowsingPart = part;
30: }
31:
32: /**
33: * Runs the action.
34: */
35: public void run() {
36: fJavaBrowsingPart.setLinkingEnabled(isChecked());
37: }
38:
39: }
|