Generate dependencies for Spring TestContext Framework
IntelliJ IDEA 10 gives you an easy way of generating bean dependencies for Spring Test Contexts. Simply hit Alt+Insert in your Spring Test to invoke the "Generate…" popup, select the "Bean dependency..." action to run and choose the beans you like. IntelliJ IDEA actually runs a live template inside to complete the code generation. It creates @Autowired field and adds @Qualifier if more than one bean of the desired type is configured in test contexts. In addition, you can try "Add @Qualifier" quick fix for an incorrect @Autowired class members It runs a live template and generates the
Zen Coding support in IntelliJ IDEA
With IntelliJ IDEA 9.0.2 you can edit HTML and CSS code really fast using Zen Coding features. To use it, you have to install Zen Coding plugin for Web IDE/IntelliJ IDEA: go to Zen Coding Project Download Page, download an archive that contains a set of live templates, and extract it to "<Your Home Directory>.IntelliJIdea90configtemplates" folder ("~/Library/Preferences/IntelliJIDEA90/templates" for Mac OS X). Zen Coding plugin involves more than 200 different HTML and CSS live templates. To see all of them, just open Settings (Ctrl+Alt+S), Live Templates, Zen Coding group. Native
Creating live templates from… templates
Sometimes I find myself writing repetitive code constructs without being able to extract common code due to Java syntax hmm... let's call them peculiarities. 'Sounds like a job for a live template', I think, and I simply create it. Here's how. The documentation has it too, but a good example never hurts. Let's suppose you have read/write synchronization in your project, and from time to time you need to wrap a bunch of statements in, say, a read action. This involves putting them into a Runnable and giving the latter to some runReadAction method. Do you still do this manually? You don't need
Generating Spring Bean Dependencies
You can easily generate setter or constructor dependency to any Spring Bean from your application contexts. Just press Alt+Insert or select Generate from the Code menu, then select appropriate dependency type, and then select a bean.IntelliJ IDEA will correctly update your application context file and, if needed, invoke a Live Template to generate a proper constructor or setter method in your class file.