01: /*******************************************************************************
02: * Copyright (c) 2003, 2007 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.navigator;
11:
12: import org.eclipse.jface.viewers.IStructuredSelection;
13: import org.eclipse.ui.IEditorInput;
14: import org.eclipse.ui.IWorkbenchPage;
15:
16: /**
17: * <p>
18: * Provides information to the Common Navigator on how to link selections with
19: * active editors and vice versa.
20: * </p>
21: * <p>
22: * The Common Navigator allows clients to plug-in their own custom logic for
23: * linking selections from the Viewer to active editors. This interface is used
24: * by the <b>org.eclipse.ui.navigator.linkHelper </b> extension
25: * point to gather information and trigger editor activations.
26: * </p>
27: *
28: * <p>
29: * Clients may implement this interface.
30: * </p>
31: *
32: * @since 3.2
33: */
34: public interface ILinkHelper {
35:
36: /**
37: * <p>
38: * Determine the correct structured selection for the Common Navigator given
39: * anInput.
40: * </p>
41: *
42: * @param anInput
43: * An Editor input
44: * @return A selection to be set against the {@link CommonViewer}
45: */
46: IStructuredSelection findSelection(IEditorInput anInput);
47:
48: /**
49: * <p>
50: * Activate the correct editor for aSelection.
51: * </p>
52: *
53: * @param aPage
54: * A WorkbenchPage to use for editor location and activation
55: * @param aSelection
56: * The current selection from the {@link CommonViewer}
57: */
58: void activateEditor(IWorkbenchPage aPage,
59: IStructuredSelection aSelection);
60: }
|