KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > search > ui > text > ISearchEditorAccess


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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
12 package org.eclipse.search.ui.text;
13
14 import org.eclipse.jface.text.IDocument;
15 import org.eclipse.jface.text.source.IAnnotationModel;
16
17 /**
18  * <p>This interface allows editors to provide customized access to editor internals for the
19  * search implementation to highlight matches. The search system will use the document to
20  * do line/character offset conversion if needed and it will add annotations to the annotation
21  * model.</p>
22  * <p> The search system will ask an editor for an adapter of this class whenever it needs
23  * access to the document or the annotation model of the editor. Since an editor might use
24  * multiple documents and/or annotation models, the match is passed in when asking the editor.
25  * The editor is then expected to return the proper annotation model or document for the given
26  * match.</p>
27  * <p>
28  * This interface is intended to be implemented by clients.
29  * </p>
30  * @since 3.0
31  */

32 public interface ISearchEditorAccess {
33     /**
34      * Finds the document displaying the match.
35      * @param match the match
36      * @return the document displaying the given match.
37      */

38     IDocument getDocument(Match match);
39     /**
40      * Finds the annotation model for the given match
41      * @param match the match
42      * @return the annotation model displaying the given match.
43      */

44     IAnnotationModel getAnnotationModel(Match match);
45 }
46
Popular Tags