JBoss.orgCommunity Documentation
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 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:
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 rename a Seam component in the Java editor it's necessary to select the component, left click the file and then select Seam Refactor > Rename Seam Component.
For details, see also the movie, "Renaming a Seam component in the Java Editor".
To open the Refactoring wizard in the Seam Components view you should left click the component you want to open and choose Rename Seam Component option.
For details, see also the movie, "Renaming a Seam component in the Seam Components view".
When you open components.xml
file using JBoss Tools XML Editor, open the
Refactoring wizard in the Tree tab by left-clicking the component in
components area and choosing Rename option.
For details, see also the movie, "Renaming a Seam component in the components.xml file".
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.
For details, see also a set of movies about renaming Seam context variables in EL in different locations: