Productivity! Code Style Page (Project Properties Dialog Box)

The Code Style page of the Productivity! Project Properties pages allows user to specify the following options:

  1. Methods Parameters Naming
  2. Fields Naming
  3. Generate Throwing of java.lang.UnsupportedOperation Exception
  4. General options

See also: Productivity! Options Property Page, Productivity! JavaDoc Property Page, Productivity! Cache Property Page, Productivity! Options

To set these options for all new projects, choose the Project | Default Project Properties  menu item.

This property page allows customizing the code generated with Productivity! tools and adjust it to your personal coding style.

Methods Parameters Naming

This option allows customizing names of parameters used in methods generated by Productivity! tools. Any parameter name has a customizable prefix and suffix. With the appropriate checkbox enabled, you'll be able to specify the respective part of a parameter name in the edit box. In other words, you can specify the value to be used when naming parameters.

Productivity! tools generate names of parameters if their actual names are unknown (when source code of a class is unavailable). By default, they utilize usual Java convention for parameters naming, but you can force using prefixes and/or suffixes according to your own requirements.

Fields Naming

This option allows customizing names of fields according to the coding style you prefer. You can customize a prefix and suffix of a field name. With appropriate checkbox enabled, you'll be able to specify the respective part of a field name in the edit box.

The current version of Productivity! uses this option in GetSet.Creator. Depending on values specified, GetSet.Creator can define the appropriate name of the get/set method (by removing a prefix and suffix) and the appropriate parameter names.

Generate Throwing of java.lang.UnsupportedOperation Exception

Using these radiobuttons you can exactly specify the rules of code generating in the method body. If you enable  the Generate always radiobutton, Productivity! always generates method body with TODO comment and the code that throws java.lang.UnsupportedOperation exception.

If you enable the Generate only when needed radiobutton, Productivity! generates the code that throws exception only for the method with non-void return type.

General

These options provide more opportunities for you to fine-tune the code generated by Productivity!

Generate method body near current cursor position

This option allows you to specify the anchor position where the generated code will be inserted. If the appropriate checkbox is selected, the whole code will be generated in the position close to cursor (if the cursor is within a method, the code will be generated near this method). If this option is disabled, all the methods will be inserted in the end of a class definition and the constructors will be inserted after the last defined constructor. The only exception is the generation of get/set methods - if this option is disabled, a get/set method will be inserted after the appropriate set/get method.

Generate JavaDoc during methods generation

This checkbox is used to specify whether the JavaDoc comment templates will be generated during the methods generation. If you enable it, all the methods generated by the Productivity! tools will include the JavaDoc comment templates (the same as one produced by Easy.JavaDoc). The only exception is the generation of anonymous inner classes - JavaDoc will never be added during the anonymous inner class generation.

See also: Productivity! Options Property Page, Productivity! JavaDoc Property Page, Productivity! Cache Property Page, Productivity! Options