I like when Eclipse lets me jump between parameters in a method call using a Tab key. I would like my plugin to provide a similar functionality. To be precise, I am injecting some piece of text into the editor and I would like to highlight specific syntax and let the programmer jump to the next match using the Tab key.
Here is an example. Lets suppose I dynamically created the following snippet:
String a = "bogus string";
int i = a.[?]
I will inject that into the editor and I would like that [?]
is highlighted and ready for modification (user might type length()
). Moreover, if there is more [?]
fragments, I would like user to use Tab to move to the next one.
After researching a bit, I found that it might be done using templates. However, I can't find any relevant examples on the Web. Does anybody have experience with this?
UPDATE:
I found two links that might be useful, although I am still not able to come up with a solution.