JBoss.orgCommunity Documentation
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”.
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 Section 5.2.2, “Open Seam Component” icon.
To rename a Seam component in the Java editor it's necessary to select the component, left click the file and then select
→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.
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.
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 →