IntelliJ IDEA enables you to quickly unwrap or extract expressions from the enclosing statements. This action is available for:
- Java: for, foreach, if..elseif...else, try...catch...finally, while...do, do...while, and lone braces.
- XML, HTML, and JSP
- Place the caret on the expression you want to extract or unwrap.
- Choose Ctrl+Shift+DeleteCtrl+Shift+DeleteCtrl+Shift+DeleteCtrl+Shift+DeleteCtrl+Shift+DeleteCtrl+Shift+DeleteCtrl+Shift+DeleteCtrl+Shift+DeleteAlt+RShift Command DeleteShift Command DeleteShift Command Delete. IntelliJ IDEA shows a pop-up window with all the actions that are available in the current context.
Statements to be extracted are displayed on the blue background, statements to be removed are displayed
on the grey background.
on the main menu or press
- Click the desired action or select it using the up and down arrow keys and press EnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnter.