Search code examples
javaeclipsecode-templates

can I add import when editing method body code template in eclipse


I am trying to edit the template of creating a new method. I want to do something like this:

throw new mypackage.UnimplementedException();

but I want to add my package to imports and not to declare it with full package on the method body. I tried using:

 ${:import(mypackage.UnimplementedException)}

but it doesn't work (works only in editor templates)


Solution

  • I submitted a request for this: https://bugs.eclipse.org/bugs/show_bug.cgi?id=333313