JBoss.orgCommunity Documentation

Chapter 11. Seam Refactoring Tools

11.1. Using the Refactorinig Wizard
11.2. Renaming Seam Components
11.2.1. Renaming Seam Components in the Java Editor
11.2.2. Renaming Seam Components in the Seam Components View
11.2.3. Renaming Seam Components in the Seam Components Editor
11.3. Renaming Seam Context Variables in EL

The goal of Seam components refactoring is to make system-wide code changes without affecting the behavior of the program. Seam Tools provides assistance with code refactoring.

Seam refactoring tools includes the following refactoring operations:

Refactoring commands are available from the context menus of several views and editors; for details, see Section 11.1, “Using the Refactorinig Wizard”.

Note:

Seam refactoring could be only performed in the file that is not marked as Read only in its properties.

Properties View for Java File

Figure 11.1. Properties View for Java File


This wizard is opened always when the user clicks the Rename Seam Component, Rename Seam Context Variable or Rename command in any of the views/editors mentioned later in this chapter.


In the Seam Components name field you should enter a new name of the component, then click Next and follow the next wizard steps:


As you see, when performing a refactoring operation, you can preview all of the changes resulting from a refactoring action before you choose to carry them out.

The view represents two windows: one with the original source code and the other with refactored one.

With the help of , , , buttons you can quickly navigate between the differences in the code. If you don't agree with some changes you can't undo them but you can remove the class from the list of classes that need refactoring.


To apply the changes click Finish.

Renaming the selected seam component corrects all references to the component (also in other files in the project). Renaming a type doesn't allow to rename similarly named variables and methods.

Renaming a Seam component could be performed in the:

Renaming a Seam context variables in EL could be executed in .java, .xml, .jsp, .xhtml and .properties files in Seam projects using the context menu command Seam RefactorRename Seam Context Variable.