129
|
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 * Port to the D programming language:
|
|
11 * Frank Benoit <benoit@tionex.de>
|
|
12 *******************************************************************************/
|
|
13
|
|
14 module dwtx.jface.text.IFindReplaceTargetExtension;
|
|
15
|
|
16 import dwt.dwthelper.utils;
|
|
17
|
|
18 import dwt.graphics.Color;
|
|
19 import dwt.graphics.Point;
|
|
20
|
|
21
|
|
22 /**
|
|
23 * Extension interface for {@link dwtx.jface.text.IFindReplaceTarget}.
|
|
24 * <p>
|
|
25 * Introduces the concepts of find/replace sessions, searching in a limiting
|
|
26 * scope and a replace-all mode.
|
|
27 * <p>
|
|
28 * If a scope is set, <code>findAndSelect</code> is limited to the scope.
|
|
29 * Occurrences outside of the scope are not considered.
|
|
30 *
|
|
31 * @since 2.0
|
|
32 */
|
|
33 public interface IFindReplaceTargetExtension {
|
|
34
|
|
35 /**
|
|
36 * Indicates that a session with the target begins.
|
|
37 * All calls except <code>beginSession()</code> and <code>endSession()</code> to
|
|
38 * <code>IFindReplaceTarget</code> and
|
|
39 * <code>IFindReplaceTargetExtension</code> must be embedded within calls to
|
|
40 * <code>beginSession()</code> and <code>endSession()</code>.
|
|
41 *
|
|
42 * @see #endSession()
|
|
43 */
|
|
44 void beginSession();
|
|
45
|
|
46 /**
|
|
47 * Indicates that a session with the target ends.
|
|
48 *
|
|
49 * @see #beginSession()
|
|
50 */
|
|
51 void endSession();
|
|
52
|
|
53 /**
|
|
54 * Returns the find scope of the target, <code>null</code> for global scope.
|
|
55 *
|
|
56 * @return returns the find scope of the target, may be <code>null</code>
|
|
57 */
|
|
58 IRegion getScope();
|
|
59
|
|
60 /**
|
|
61 * Sets the find scope of the target to operate on. <code>null</code>
|
|
62 * indicates that the global scope should be used.
|
|
63 *
|
|
64 * @param scope the find scope of the target, may be <code>null</code>
|
|
65 */
|
|
66 void setScope(IRegion scope);
|
|
67
|
|
68 /**
|
|
69 * Returns the currently selected range of lines as a offset and length.
|
|
70 *
|
|
71 * @return the currently selected line range
|
|
72 */
|
|
73 Point getLineSelection();
|
|
74
|
|
75 /**
|
|
76 * Sets a selection.
|
|
77 *
|
|
78 * @param offset the offset of the selection
|
|
79 * @param length the length of the selection
|
|
80 */
|
|
81 void setSelection(int offset, int length);
|
|
82
|
|
83 /**
|
|
84 * Sets the scope highlight color
|
|
85 *
|
|
86 * @param color the color of the scope highlight
|
|
87 */
|
|
88 void setScopeHighlightColor(Color color);
|
|
89
|
|
90
|
|
91 /**
|
|
92 * Sets the target's replace-all mode.
|
|
93 *
|
|
94 * @param replaceAll <code>true</code> if this target should switch into replace-all mode,
|
|
95 * <code>false</code> if it should leave the replace-all state
|
|
96 */
|
|
97 void setReplaceAllMode(bool replaceAll);
|
|
98 }
|