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

0
1 comment
Avatar
Permanently deleted user

Use an InplaceRefactoring.  See VariableInplaceRenamer.java to see how it's done.

0

Please sign in to leave a comment.