I'm making a console-based Java/Groovy application that does a lot of find/replaces in text files. If, say, the program knows you replaced foo
with bar
last time, it should by default know you probably want to replace the next foo
with bar
as well. My idea was to pre-populate the input field of the What would you like to rename this to?
prompt so that you don't have to retype it unnecessarily, but I can't find an easy way to do this in Java.
Is this possible, and if so, would it be a recommended practice?