A wizard is used to guide you through the steps necessary to execute the selected refactoring.
Parameters Page
This page gathers information that is required for the refactoring. For example, a rename refactoring parameters page asks you for the new name for the Java element.
After you have provided all required information on this page, you can click
Finish
to carry out the refactoring without previewing the results.
Preview Page
The JDT allows you to preview the results of a refactoring action before you finally choose to carry it out.
The preview page consists of two parts:
-
A tree at the top containing all Java elements affected by the refactoring. Each top-level node in the tree represents one compilation unit.
-
A compare viewer at the bottom. The left hand side of the compare viewer shows the original, the right hand side displays the refactored source.
Problem Page
The refactoring problem page tells you if there is a suspected, potential, or definite problem with the refactoring action you are attempting to do.
Four kinds of problems are possible:
-
Information: These kinds of problems will not affect the refactoring in any way, nor will they negatively affect the code in the workbench. You most likely can ignore these kinds of problems.
-
Warnings: These kinds of problems attempt to predict compiler warnings. These kinds of problems most likely will not negatively affect the code in your workbench.
-
Errors: These kinds of problems are very likely to cause compiler errors or change your workbench code semantically. You can choose to continue with the refactoring despite these errors, although it is not recommended.
-
Stop problems: These kinds of problems actually prevent the refactoring from taking place at all. For example, if you select a comment and choose the Extract Method command from it, the workbench will issue a stop problem on the refactoring attempt because you cannot extract a comment.
In the refactoring preferences (Window > Preferences > Java > Refactoring), you can select the default level for problems to be displayed when you are carrying out a refactoring without a preview, (i.e., you click
Finish
instead of
Next
from the refactoring parameters page).
See Refactoring Errors