|
Eclipse Platform Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defines the target for finding and replacing strings.
The two main methods are findAndSelect
and
replaceSelection
. The target does not provide any way to
modify the content other than replacing the selection.
In order to provide backward compatibility for clients of
IFindReplaceTarget
, extension interfaces are used as a means
of evolution. The following extension interfaces exist:
IFindReplaceTargetExtension
since version
2.0 introducing the notion of find/replace session and of a find/replace
scope. In additions, in allows clients to replace all occurrences of a given
find query.IFindReplaceTargetExtension3
since
version 3.0 allowing clients to specify search queries as regular
expressions.
Clients of a IFindReplaceTarget
that also implements the
IFindReplaceTargetExtension
have to indicate the start of a find/replace
session before using the target and to indicate the end of the session when the
target is no longer used.
IFindReplaceTargetExtension
,
IFindReplaceTargetExtension3
Method Summary | |
boolean |
canPerformFind()
Returns whether a find operation can be performed. |
int |
findAndSelect(int widgetOffset,
String findString,
boolean searchForward,
boolean caseSensitive,
boolean wholeWord)
Searches for a string starting at the given widget offset and using the specified search directives. |
Point |
getSelection()
Returns the currently selected range of characters as a offset and length in widget coordinates. |
String |
getSelectionText()
Returns the currently selected characters as a string. |
boolean |
isEditable()
Returns whether this target can be modified. |
void |
replaceSelection(String text)
Replaces the currently selected range of characters with the given text. |
Method Detail |
public boolean canPerformFind()
public int findAndSelect(int widgetOffset, String findString, boolean searchForward, boolean caseSensitive, boolean wholeWord)
Replaced by IFindReplaceTargetExtension3.findAndSelect(int, String, boolean, boolean, boolean, boolean)
.
widgetOffset
- the widget offset at which searching startsfindString
- the string which should be foundsearchForward
- true
searches forward, false
backwardscaseSensitive
- true
performs a case sensitive search, false
an insensitive searchwholeWord
- if true
only occurrences are reported in which the findString stands as a word by itself
public Point getSelection()
public String getSelectionText()
public boolean isEditable()
true
if target can be modifiedpublic void replaceSelection(String text)
Replaced by IFindReplaceTargetExtension3.replaceSelection(String, boolean)
.
text
- the substitution text
|
Eclipse Platform Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.