Bug 333313

Summary: [code templates] Add template variable resolvers to code templates
Product: [Eclipse Project] JDT Reporter: ohad shai <ohadshai>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3 CC: amj87.iitr, daniel_megert
Version: 3.7   
Target Milestone: ---   
Hardware: All   
OS: All   
URL: http://stackoverflow.com/questions/3625562/can-i-add-import-when-editing-method-body-code-template-in-eclipse
Whiteboard:

Description ohad shai CLA 2010-12-29 14:58:43 EST
Build Identifier: 20100917-0705

to be able to add import when create a template for method body.
details and example can be found here: add import when editing method body code template in eclipse.

Reproducible: Always

Steps to Reproduce:
1. create a new method using the automatic tools
2.
3.
Comment 2 Ayushman Jain CLA 2011-01-06 06:48:49 EST
Can you please give more context to what you're trying to do? In steps to reproduce, please specify exact steps, menu options, etc that you're trying to exercise and also where you're trying to specify the template. Thanks!
Comment 3 ohad shai CLA 2011-01-06 15:08:09 EST
To reproduce:
in windows preferences, in the menu of Java-Code style-code template.
in method body currently I write this:
//TODO oshai implement
throw new very.long.packname.UnimplementedException();

I want to be able to write this:
${:import(very.long.packname.UnimplementedException)}
//TODO oshai implement
throw new very.long.packname.UnimplementedException();

then when I create a method with the automatic tools, import is added also.
Similar thing is possible in Java Editor template menu.
this will make my code more clear.
Comment 4 Ayushman Jain CLA 2011-01-07 00:39:53 EST
Moving to JDT/UI for comment