Coding tools

 

Organize imports / Auto-import

This feature allows you to remove unnecessary imports, sort imports and auto-import classes which need to be imported to produce correct source code. To do this choose Refactor | Organize imports / Auto-import or press Ctrl-O.

 

If CodeGuide can not auto-import a certain class because a class with this name is available in several packages it will make leave the choice to the user:

 

 

Surround with try catch

This feature allows you to surround a couple of statements with a try-catch-clause that will catch all exception which can be thrown by the statements. To do this select the desired statements in the code and choose Refactor | Surround with try/catch.

 

 

Create setters and getters

This feature allows you to create setter and getter methods for a couple of fields. Just select the desired fields in your code and choose Refactor | Create setters and getters. The methods will be automatically created with appropriate names, types and parameters.

 

 

Create constructor

This feature allows you to create a constructor for a couple of fields. Just select the desired fields in your code and choose Refactor | Create constructor. The constructor will be automatically created. It will take values for all selected fields as parameters and initialize these fields with the corresponding values.

 

 

Create stubs for abstract/interface methods

This feature allows you to create stubs for an unimplemented method in a class. If a class implements an interface or inherits abstract methods from its superclass it must declare all the unimplemented methods. The stubs for these methods can be created automatically. To do this place the cursor inside the desired class and choose Refactor | Create stubs for abstract/interface methods. The necessary methods are created with appropriate type, name, parameters and exceptions.

 

 

Insert method documentation

This feature will create simple JavaDoc comments for methods inserting the correct tags for parameters, return type and exceptions. You can either create a stub for a single method using Refactor | Insert method documentation or for all methods in a file using Refactor | Insert all missing method documentations.