< Day Day Up > |
Recipe 3.11 Surrounding Code with do/for/if/try/while Blocks3.11.1 ProblemYou want to enclose a section of code in a try/catch block or in a do/for/if/while construct. 3.11.2 SolutionSelect the lines to surround, press Ctrl-1 (or select Edit Quick Fix) to list all the possibilities, and select one of them. 3.11.3 DiscussionFigure 3-14 shows the possibilities that appear when you select code and press Ctrl-l. When you select one of these possibilities, the selected code becomes surrounded with the construct you've chosen. Figure 3-14. Surrounding code in a block
3.11.4 See AlsoChapter 2 of Eclipse (O'Reilly). |
< Day Day Up > |