The goal of Seam components refactoring is to make system-wide code changes without affecting the behavior of the program. The Seam module of JBoss Tools provides assistance in easily code refactoring.
Starting from Jboss Tools M4 refactoring functionality became also available for managed beans, method and properties used in ELs. Thus now Seam refactoring tools include the next refactoring operations:
Refactoring commands are available from the context menus of several views and editors and use a standard Eclipse refactoring wizard. For details, see "Using the Refactoring Wizard" later in this chapter.
Seam refactoring could be only performed in the file that is not marked as Read only in its properties.
This wizard is opened always when the user clicks Rename Seam Component/Rename Seam Context Variable/Rename command in any of the mentioned views.
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 also 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:
If you want to rename certain seam component using Java Editor,first of all it's necessary to open it. If you don't know ,where the seam component is declared,use Open Seam Components icon.
To open the rename Seam Component command in Java Editor it's necessary to left click the file >Seam Refactor>Rename Seam Component.
To open Refactoring wizard in the Seam Components view you should left click the component you wants to open and choose Rename Seam Component option.
When you open components.xml
file using JBossTools XML Editor, open the
Refactoring wizard in the Tree tab by left-clicking the component in
components area and choosing Rename option.
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 Refactor > Rename Seam Context Variable.