How to add placeholder in GenerateAction
Answered
Hi, there is a generate method action in my plugin.
I want to add a placeholder to the method I generated, so that users can easily replace these texts.
like this
public $Class$ convertTo$Class$() {
$Class$ other = new $Class$();
other.setName(this.name);
other.setXX(this.xx);
...
return other;
}
Users can replace these "red rectangle" placeholders($Class$) by entering text as soon as the method is generated.
Can anyone give me some advice?
Thanks
Please sign in to leave a comment.
Use an InplaceRefactoring. See VariableInplaceRenamer.java to see how it's done.