Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.eclipse.jface.text
Interface IFindReplaceTarget  view IFindReplaceTarget download IFindReplaceTarget.java

All Known Implementing Classes:
TextViewer.FindReplaceTarget

public interface IFindReplaceTarget

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:

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.


Method Summary
 boolean canPerformFind()
          Returns whether a find operation can be performed.
 int findAndSelect(int widgetOffset, java.lang.String findString, boolean searchForward, boolean caseSensitive, boolean wholeWord)
          Searches for a string starting at the given widget offset and using the specified search directives.
 org.eclipse.swt.graphics.Point getSelection()
          Returns the currently selected range of characters as a offset and length in widget coordinates.
 java.lang.String getSelectionText()
          Returns the currently selected characters as a string.
 boolean isEditable()
          Returns whether this target can be modified.
 void replaceSelection(java.lang.String text)
          Replaces the currently selected range of characters with the given text.
 

Method Detail

canPerformFind

public boolean canPerformFind()
Returns whether a find operation can be performed.


findAndSelect

public int findAndSelect(int widgetOffset,
                         java.lang.String findString,
                         boolean searchForward,
                         boolean caseSensitive,
                         boolean wholeWord)
Searches for a string starting at the given widget offset and using the specified search directives. If a string has been found it is selected and its start offset is returned.

Replaced by IFindReplaceTargetExtension3.findAndSelect(int, String, boolean, boolean, boolean, boolean) 55 .


getSelection

public org.eclipse.swt.graphics.Point getSelection()
Returns the currently selected range of characters as a offset and length in widget coordinates.


getSelectionText

public java.lang.String getSelectionText()
Returns the currently selected characters as a string.


isEditable

public boolean isEditable()
Returns whether this target can be modified.


replaceSelection

public void replaceSelection(java.lang.String text)
Replaces the currently selected range of characters with the given text. This target must be editable. Otherwise nothing happens.

Replaced by IFindReplaceTargetExtension3.replaceSelection(String, boolean) 55 .