KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > text > IFindReplaceTargetExtension


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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.jface.text;
13
14 import org.eclipse.swt.graphics.Color;
15 import org.eclipse.swt.graphics.Point;
16
17
18 /**
19  * Extension interface for {@link org.eclipse.jface.text.IFindReplaceTarget}.
20  * <p>
21  * Introduces the concepts of find/replace sessions, searching in a limiting
22  * scope and a replace-all mode.
23  * <p>
24  * If a scope is set, <code>findAndSelect</code> is limited to the scope.
25  * Occurrences outside of the scope are not considered.
26  *
27  * @since 2.0
28  */

29 public interface IFindReplaceTargetExtension {
30
31     /**
32      * Indicates that a session with the target begins.
33      * All calls except <code>beginSession()</code> and <code>endSession()</code> to
34      * <code>IFindReplaceTarget</code> and
35      * <code>IFindReplaceTargetExtension</code> must be embedded within calls to
36      * <code>beginSession()</code> and <code>endSession()</code>.
37      *
38      * @see #endSession()
39      */

40     void beginSession();
41
42     /**
43      * Indicates that a session with the target ends.
44      *
45      * @see #beginSession()
46      */

47     void endSession();
48
49     /**
50      * Returns the find scope of the target, <code>null</code> for global scope.
51      *
52      * @return returns the find scope of the target, may be <code>null</code>
53      */

54     IRegion getScope();
55
56     /**
57      * Sets the find scope of the target to operate on. <code>null</code>
58      * indicates that the global scope should be used.
59      *
60      * @param scope the find scope of the target, may be <code>null</code>
61      */

62     void setScope(IRegion scope);
63
64     /**
65      * Returns the currently selected range of lines as a offset and length.
66      *
67      * @return the currently selected line range
68      */

69     Point getLineSelection();
70
71     /**
72      * Sets a selection.
73      *
74      * @param offset the offset of the selection
75      * @param length the length of the selection
76      */

77     void setSelection(int offset, int length);
78
79     /**
80      * Sets the scope highlight color
81      *
82      * @param color the color of the scope highlight
83      */

84     void setScopeHighlightColor(Color color);
85
86
87     /**
88      * Sets the target's replace-all mode.
89      *
90      * @param replaceAll <code>true</code> if this target should switch into replace-all mode,
91      * <code>false</code> if it should leave the replace-all state
92      */

93     void setReplaceAllMode(boolean replaceAll);
94 }
95
Popular Tags