Replace logic
Similar to the find logic described in previous topic the following methods of FindReplaceDialog have the main logic for replacing occurrences of a given phrase:
Method |
Purpose |
replace |
Initiate a replace operation. If no (more) hits are found, a message is displayed and the dialog is unlocked for a new search operation. |
replaceOne |
Replace the currently selected occurrence of the search phrase. |
By pressing button jbtnReplace a find operation is initiated with a call to method initFind and above methods are called with an initial replace option of RO_YES. Subsequent iterations through the replace process are driven by the user through a selection in method getReplaceChoice which is called each time an instance of the search phrase is found and which can be one of