Recipe 3.8 Inserting Method Parameter Names

     

Recipe 3.8 Inserting Method Parameter Names

3.8.1 Problem

You 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 Solution

Select Window Preferences Java Editor Code Assist, and check the "Fill argument names on method completion" and "Guess filled argument names" checkboxes.

3.8.3 Discussion

When 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
figs/ecb_0311.gif



Eclipse Cookbook
Inside XML (Inside (New Riders))
ISBN: 596007108
EAN: 2147483647
Year: 2006
Pages: 232
Authors: Steve Holzner

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net