Eclipse: volume block with if

In eclipse, we can surround a piece of code with try / catch. I want to surround a piece of code with an if statement. Is there a shortcut key. Pressing Ctrl + 1 after selecting a code block did not give me a hint of the environment with If .

+8
java eclipse
source share
2 answers

Highlight a block of code, press Alt + Shift + Z , then select if (3).

+18
source share

At Eclipse Galileo

  • Select the code and right click it
  • Select Surround with option in the context menu
  • Select if statement .
+3
source share

All Articles