|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rice.cs.drjava.model.FindReplaceMachine
public class FindReplaceMachine
Implementation of logic of find/replace over a document.
Constructor Summary | |
---|---|
FindReplaceMachine(SingleDisplayModel model,
DocumentIterator docIterator)
Standard Constructor. |
Method Summary | |
---|---|
void |
cleanUp()
|
FindResult |
findNext()
|
int |
getCurrentOffset()
Gets the character offset to which this machine is currently pointing. |
OpenDefinitionsDocument |
getDocument()
|
String |
getFindWord()
|
OpenDefinitionsDocument |
getFirstDoc()
|
boolean |
getIgnoreCommentsAndStrings()
|
boolean |
getIgnoreTestCases()
|
boolean |
getMatchCase()
|
boolean |
getMatchWholeWord()
|
String |
getReplaceWord()
|
boolean |
getSearchAllDocuments()
|
boolean |
isSearchBackwards()
|
boolean |
onMatch()
Determine if the machine is on an instance of the find word. |
void |
positionChanged()
Called when the current position is updated in the document implying _skipText should not be set if the user toggles _searchBackwards |
int |
processAll(Runnable1<FindResult> findAction)
Processes all occurences of the find word with the replace word in the current document or in all documents depending the value of the machine register _searchAllDocuments. |
int |
replaceAll()
Replaces all occurences of the find word with the replace word in the current document of in all documents depending the value of the machine register _searchAllDocuments. |
boolean |
replaceCurrent()
If we're on a match for the find word, replace it with the replace word. |
void |
setDocument(OpenDefinitionsDocument doc)
|
void |
setFindAnyOccurrence()
|
void |
setFindWord(String word)
Change the word being sought. |
void |
setFirstDoc(OpenDefinitionsDocument firstDoc)
|
void |
setIgnoreCommentsAndStrings(boolean ignoreCommentsAndStrings)
|
void |
setIgnoreTestCases(boolean ignoreTestCases)
|
void |
setLastFindWord()
|
void |
setMatchCase(boolean matchCase)
|
void |
setMatchWholeWord()
|
void |
setPosition(int pos)
|
void |
setReplaceWord(String word)
Change the replacing word. |
void |
setSearchAllDocuments(boolean searchAllDocuments)
|
void |
setSearchBackwards(boolean searchBackwards)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FindReplaceMachine(SingleDisplayModel model, DocumentIterator docIterator)
docIterator
- an object that allows navigation through open Swing documents (it is DefaultGlobalModel)Method Detail |
---|
public void cleanUp()
public void positionChanged()
public void setLastFindWord()
public boolean isSearchBackwards()
public void setSearchBackwards(boolean searchBackwards)
public void setMatchCase(boolean matchCase)
public boolean getMatchCase()
public void setMatchWholeWord()
public boolean getMatchWholeWord()
public void setFindAnyOccurrence()
public void setSearchAllDocuments(boolean searchAllDocuments)
public void setIgnoreCommentsAndStrings(boolean ignoreCommentsAndStrings)
public boolean getIgnoreCommentsAndStrings()
public void setIgnoreTestCases(boolean ignoreTestCases)
public boolean getIgnoreTestCases()
public void setDocument(OpenDefinitionsDocument doc)
public void setFirstDoc(OpenDefinitionsDocument firstDoc)
public void setPosition(int pos)
public int getCurrentOffset()
public String getFindWord()
public String getReplaceWord()
public boolean getSearchAllDocuments()
public OpenDefinitionsDocument getDocument()
public OpenDefinitionsDocument getFirstDoc()
public void setFindWord(String word)
word
- the new word to seekpublic void setReplaceWord(String word)
word
- the new replacing wordpublic boolean onMatch()
public boolean replaceCurrent()
public int replaceAll()
public int processAll(Runnable1<FindResult> findAction)
findAction
- action to perform on the occurrences; input is the FindResult, output is ignored
public FindResult findNext()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |