Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 141ff582157034f78e544cb2cddc5ed620d04dc8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*******************************************************************************
 * Copyright (c) 2003, 2015 IBM Corporation and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.ui.navigator;

import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IWorkbenchPage;

/**
 * <p>
 * Provides information to the Common Navigator on how to link selections with
 * active editors and vice versa.
 * </p>
 * <p>
 * The Common Navigator allows clients to plug-in their own custom logic for
 * linking selections from the Viewer to active editors. This interface is used
 * by the <b>org.eclipse.ui.navigator.linkHelper </b> extension
 * point to gather information and trigger editor activations.
 * </p>
 *
 * @since 3.2
 */
public interface ILinkHelper {

	/**
	 * <p>
	 * Determine the correct structured selection for the Common Navigator given
	 * anInput.
	 * </p>
	 *
	 * @param anInput
	 *            An Editor input
	 * @return A selection to be set against the {@link CommonViewer}
	 */
	IStructuredSelection findSelection(IEditorInput anInput);

	/**
	 * <p>
	 * Activate the correct editor for aSelection.
	 * </p>
	 *
	 * @param aPage
	 *            A WorkbenchPage to use for editor location and activation
	 * @param aSelection
	 *            The current selection from the {@link CommonViewer}
	 */
	void activateEditor(IWorkbenchPage aPage, IStructuredSelection aSelection);
}

Back to the top