Using Structured Selection

Structured Selection lets you quickly select Java code in a syntax-aware way.

To use Structured Selection:

When a statement or a list of statements is selected, you can press Alt+Shift+Arrow Right or select Edit > Expands Selection To > Next Element, which will expand the selection with the statement (if any exists) that is immediately after the selected statements.

When a statement or a list of statements is selected, you can press Alt+Shift+Arrow Left or select Edit > Expands Selection To > Previous Element, which will expand the selection with the statement (if any exists) that is immediately before the selected statements.

Pressing Alt+Shift+Arrow Down or selecting Edit > Expands Selection To > Restore Last Selection from the menu bar lets you restore the previous structured selection.

Related concepts
Java editor

Related tasks
Using the Java editor
Using Surround with Try/Catch
Extracting a method
Extracting a local variable
Inlining a local variable
Replacing a local variable with a query

Related reference
Edit menu

Legal notices