Use them Live templates | IntelliJ IDEA Documentation
Look at children for more interesting examples.