...
Wiki Markup |
---|
{div:class=navigation}
{table:width=100%}
{tr}
{td:width=33%}{align:left}[Previous|Refactoring Basics] {span:class=sep}\| {span}{span:class=text}Refactoring Basics{span}{align}{td}
{td:width=33%}{align:center}[Top|Quick Start] {span:class=sep}\| {span}{span:class=text}Quick Start{span}{align} {td}
{td:width=33%}{align:right}[Next|Find Usages] {span:class=sep}\| {span}{span:class=text}Find Usages{span}{align} {td}
{tr}
{table}
{div} |
Wiki Markup |
---|
{redirect:https://www.jetbrains.com/idea/help/folding-and-expanding-code-blocks.html |
...
...
Info |
---|
|
Folding helps you keep your code neat and readable, by automatically collapsing the boilerplate or by replacing it with more relevant statements. |
You can see the original code behind the folded regions by placing the caret on it, or by moving the mouse over the collapsed pieces of code. Additionally you can always expand or collapse the folded blocks at the caret by calling the Toggle folding action via the shortcut
+ ( + span |
---|
|
. Wiki Markup |
---|
{span:class=shortcut}Ctrl{span} |
+ Wiki Markup |
---|
{span:class=shortcut}.{span} |
( Wiki Markup |
---|
{span:class=shortcut}Cmd{span} |
+ Wiki Markup |
---|
{span:class=shortcut}.{span} |
for Mac).
1. Generics
A very basic example of code folding is when the editor replaces parameter types in generics with the diamond operator added in Java 7. The code itself remains the same but it looks shorter and clearer.
...
You can always change the default behavior of code folding for particular statements via
→ → span |
---|
|
Code Folding Wiki Markup |
---|
{span:class=shortcut}Settings{span} |
→ Wiki Markup |
---|
{span:class=shortcut}Editor{span} |
→ Wiki Markup |
---|
{span:class=shortcut}Code Folding{span} |
.

4. Other useful actions
...
...
...
...
...
...
...
Wiki Markup |
---|
{span:class=shortcut}Shift{span} |
+ Wiki Markup |
---|
{span:class=shortcut}Ctrl{span} |
+ Wiki Markup |
---|
{span:class=shortcut}+{span} |
( Wiki Markup |
---|
{span:class=shortcut}Shift{span} |
+ Wiki Markup |
---|
{span:class=shortcut}Cmd{span} |
+ Wiki Markup |
---|
{span:class=shortcut}+{span} |
for Mac) automatically expands all collapsed blocks in the opened file.
div |
---|
|
HTML Table |
---|
|
Table Row (tr) |
---|
Table Cell (td) |
---|
|
Align |
---|
|
Next span |
---|
|
Find Usages Wiki Markup |
---|
{div:class=navigation}
{table:width=100%}
{tr}
{td:width=33%}{align:left}[Previous|Refactoring Basics] {span:class=sep}\| {span}{span:class=text}Refactoring Basics{span}{align}{td}
{td:width=33%}{align:center}[Top|Quick Start] {span:class=sep}\| {span}{span:class=text}Quick Start{span}{align} {td}
{td:width=33%}{align:right}[Next|Find Usages] {span:class=sep}\| {span}{span:class=text}Find Usages{span}{align} {td}
{tr}
{table}
{div} |