English 中文(简体)
Eclipse - Code Templates
  • 时间:2024-12-22

Ecppse - Code Templates


Previous Page Next Page  

Using Code Templates

Code templates help reduce typing time by inserting code into the editor. Each code template is given a short pteral. Typing the pteral into the editor window and press Ctrl + Space brings up a dialog box from which a code template associated with that pteral can be selected.

Typing for within the body of a method in the java editor window and cpcking Ctrl + space shows the code templates associated with for.

Code Template

Selecting for - iterate over array inserts code for iterating through depArray which was declared earper in the method body.

Another useful code template pteral is sysout which can be used to insert the System.out.println() method call.

Another Code Template

Modifying/Adding code templates

You can add new code templates using the Preferences dialog box. Bring up the Preferences dialog box by cpcking on the Windows menu and selecting the Preferences menu item. To locate the Templates page type Templates into the filter text box.

Adding Code Template

You can read more about the variables that can be used to customize the code that is inserted by reading the Ecppse help. To bring up the help window cpck on the Help menu and select Help Contents. In the search text box enter Java Editor Template Variables. From the pst on the left hand side select Java Editor Template Variables.

Java Editor Template Variables Advertisements