Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 248092

Summary: Allow java editor templates to add imports
Product: [Eclipse Project] JDT Reporter: J. Christopher Bare <christopherbare>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: CLOSED WORKSFORME QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert
Version: 3.5   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description J. Christopher Bare CLA 2008-09-22 02:24:45 EDT
I use the editor template mechanism to add common boiler-plate lines of code like creating log4j loggers, for example:

	private static final Logger log = Logger.getLogger(TestData.class);

The problem is, I still have to do an additional step to import org.apache.log4j.Logger. (Down with java.util.Logger!)

It would be cool if templates could be assigned imports that would get automagicly added if not present. Thanks!

-chris
Comment 1 Dani Megert CLA 2008-09-22 03:53:55 EDT
This works in R3.4 (see import and importStatic variables).
Comment 2 J. Christopher Bare CLA 2008-09-23 23:17:23 EDT
Thanks, that works great!
Comment 3 Dani Megert CLA 2008-09-24 03:27:45 EDT
Good to hear ;-)