|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.javatools.editor.plugins.FindHighlightPlugin
The FindHighlightPlugin
provides support for finding
and highlighting occurrences of text. Highlights are added to the
editor pane for the given search text, and maintained across document
modifications until the next find is issued, or until clients
clear them explicitly.
To use this plugin, install it into the editor pane by calling
on the installPlugin()
BasicEditorPane
. Once it is installed, you can
use the plugin by just calling
with the appropriate parameters. findText()
Field Summary | |
static int |
DEFAULT_FIND_PRIORITY
The default priority level given to the highlight find results. |
static java.lang.String |
HIGHLIGHT_FIND_RESULT
The name of the highlight style for find results. |
Constructor Summary | |
FindHighlightPlugin()
Constructs a new FindHighlightPlugin that is not
currently associated with any editor or document. |
Method Summary | |
void |
changedUpdate(javax.swing.event.DocumentEvent event)
Gives notification that an attribute or set of attributes changed. |
void |
clearFindHighlighting()
Clears the results of a previous find highlighting request. |
void |
deinstall(BasicEditorPane editor)
Called when the plugin is being removed from the BasicEditorPane (for example when the editor is closed.) This is used to notify plugins that they should unregister any listeners that were attached. |
int |
findText(java.lang.String searchText,
int startOffset,
boolean searchForward,
boolean matchCase,
boolean wrapAround,
boolean highlightOccurrences)
This is the public entrypoint for users of this plugin for the find operation. |
int |
findText(java.lang.String searchText,
int startOffset,
boolean searchForward,
boolean matchCase,
boolean wrapAround,
boolean wholeWordOnly,
boolean highlightOccurrences)
This is the public entrypoint for users of this plugin for the find operation. |
boolean |
hasFindHighlighting()
Fetches whether there is an active find highlighting enabled. |
void |
insertUpdate(javax.swing.event.DocumentEvent event)
Gives notification that there was an insert into the document. |
void |
install(BasicEditorPane editor)
Called when this plugin is being installed into the BasicEditorPane. |
void |
propertyChange(java.beans.PropertyChangeEvent event)
This method gets called when a bound property is changed. |
void |
removeUpdate(javax.swing.event.DocumentEvent event)
Gives notification that a portion of the document has been removed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEFAULT_FIND_PRIORITY
public static final java.lang.String HIGHLIGHT_FIND_RESULT
Constructor Detail |
public FindHighlightPlugin()
FindHighlightPlugin
that is not
currently associated with any editor or document.
Method Detail |
public void install(BasicEditorPane editor)
install
in interface EditorPlugin
editor
- the editor panepublic void deinstall(BasicEditorPane editor)
deinstall
in interface EditorPlugin
editor
- the editor panepublic void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange
in interface java.beans.PropertyChangeListener
event
- A PropertyChangeEvent object describing the event source
and the property that has changed.public void insertUpdate(javax.swing.event.DocumentEvent event)
insertUpdate
in interface javax.swing.event.DocumentListener
event
- the document eventpublic void removeUpdate(javax.swing.event.DocumentEvent event)
removeUpdate
in interface javax.swing.event.DocumentListener
event
- the document eventpublic void changedUpdate(javax.swing.event.DocumentEvent event)
changedUpdate
in interface javax.swing.event.DocumentListener
event
- the document eventpublic int findText(java.lang.String searchText, int startOffset, boolean searchForward, boolean matchCase, boolean wrapAround, boolean highlightOccurrences)
searchText
- the search text to findstartOffset
- the starting location to do the searchsearchForward
- whether to search forwardmatchCase
- whether to match case, true to perform
case-sensitive matcheswrapAround
- whether to wrap-around to the beginning of
the document in case the search text was not found,
true to wrap around
public int findText(java.lang.String searchText, int startOffset, boolean searchForward, boolean matchCase, boolean wrapAround, boolean wholeWordOnly, boolean highlightOccurrences)
searchText
- the search text to findstartOffset
- the starting location to do the searchsearchForward
- whether to search forwardmatchCase
- whether to match case, true to perform
case-sensitive matcheswrapAround
- whether to wrap-around to the beginning of
the document in case the search text was not found,
true to wrap aroundwholeWordOnly
- whether to check for whole-word occurrences only,
true to check for whole word only
public void clearFindHighlighting()
public boolean hasFindHighlighting()
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.