KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > navigator > ILinkHelper


1 /*******************************************************************************
2  * Copyright (c) 2003, 2007 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 package org.eclipse.ui.navigator;
12
13 import org.eclipse.jface.viewers.IStructuredSelection;
14 import org.eclipse.ui.IEditorInput;
15 import org.eclipse.ui.IWorkbenchPage;
16
17 /**
18  * <p>
19  * Provides information to the Common Navigator on how to link selections with
20  * active editors and vice versa.
21  * </p>
22  * <p>
23  * The Common Navigator allows clients to plug-in their own custom logic for
24  * linking selections from the Viewer to active editors. This interface is used
25  * by the <b>org.eclipse.ui.navigator.linkHelper </b> extension
26  * point to gather information and trigger editor activations.
27  * </p>
28  *
29  * <p>
30  * Clients may implement this interface.
31  * </p>
32  *
33  * @since 3.2
34  */

35 public interface ILinkHelper {
36
37     /**
38      * <p>
39      * Determine the correct structured selection for the Common Navigator given
40      * anInput.
41      * </p>
42      *
43      * @param anInput
44      * An Editor input
45      * @return A selection to be set against the {@link CommonViewer}
46      */

47     IStructuredSelection findSelection(IEditorInput anInput);
48
49     /**
50      * <p>
51      * Activate the correct editor for aSelection.
52      * </p>
53      *
54      * @param aPage
55      * A WorkbenchPage to use for editor location and activation
56      * @param aSelection
57      * The current selection from the {@link CommonViewer}
58      */

59     void activateEditor(IWorkbenchPage aPage, IStructuredSelection aSelection);
60 }
61
Popular Tags