From the course: IntelliJ IDEA Community Edition Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Create and use live templates
From the course: IntelliJ IDEA Community Edition Essential Training
Create and use live templates
- [Instructor] IntelliJ IDEA lets you expand abbreviations into full code. These are called live templates. IntelliJ IDEA comes predefined with dozens of live templates for various languages. I'm working in Java, and to use an existing live template, I simply type the abbreviation. I've demonstrated this previously with sout, which stands for system out. When I type that string and then press tab or enter a return, it expands to system.out.println. Here's where these live templates are defined. I'll go to Preferences on Mac or Settings on Windows, and under Editor, there's a Live Templates window. Notice that there are live templates for all sorts of languages and platforms. There's Kotlin, Java, Maven, and so on. And for Android developers, there are dozens of live templates under different Android categories. Under the Java section for example, here's one called fori which creates an iteration loop. So I can…
Contents
-
-
-
-
-
Create new packages, classes, and interfaces1m 30s
-
(Locked)
Generate boilerplate code2m 49s
-
(Locked)
Reformat code and optimize imports4m 34s
-
(Locked)
Navigate code and find files2m 39s
-
(Locked)
Refactor code4m 1s
-
(Locked)
Create and use live templates2m 34s
-
(Locked)
Store code in scratch files2m 22s
-
(Locked)
Challenge: Create a class that represents a data object1m 9s
-
(Locked)
Solution: Create a class that represents a data object3m 10s
-
-
-
-
-
-