< Day Day Up > |
Recipe 3.8 Inserting Method Parameter Names3.8.1 ProblemYou forgot the parameters of a method you want to call, and instead of receiving hints in tool tips (see the previous recipe), you want Eclipse to fill in the parameter names in your code for you. 3.8.2 SolutionSelect Window Preferences Java Editor Code Assist, and check the "Fill argument names on method completion" and "Guess filled argument names" checkboxes. 3.8.3 DiscussionWhen you check these checkboxes, code assist automatically fills in names of the parameters passed to that method in your code. For example, say you've typed java.util.Arrays.fill, and you press Ctrl-Space to invoke code assist, then you select one of the methods code assist offers you. Code assist will insert names for each parameter into your code, and as you tab between them, it displays their type in a tool tip, as shown in Figure 3-11. Figure 3-11. Auto-naming of parameters |
< Day Day Up > |