You can use the refactoring function of the workbench to
rename source files and correct references to those files.
With refactoring, you can rename EGL source files or JSP files
that are controlled by a JSF Handler.
- In one of the following places, select the file you want to rename:
- Right-click the file in the Project Explorer view
- For files that contain a main part, right-click the main part
in the Outline view, Parts List view, or Parts Reference view
- For files that contain a main part, place the cursor on the part
name in the EGL editor and right-click
- From the pop-up menu, click . The Rename Part window
opens.
- In the Rename Part window, type a new name for the file, following
EGL naming conventions.
- You can click Preview for a list of the
changes EGL will make if you proceed.
- If you clear the Update references check
box, EGL will not search other files for references to change. In
most instances, select this check box.
- Click OK.
Renaming a file makes the following changes:
- EGL changes the name of the file to the new name
- For files that contain a main part, EGL changes the name of the
part to match the new file name
- For files that contain a main part, EGL searches the build path
for references to that part and changes the references to match the
new name of the part. For example, if you rename a file that contains
a called program, EGL changes the code that calls that program to
use the new name.
- For files that contain a JSF Handler, EGL links the JSP file to
the new file and changes any references in the JSP to the JSF Handler
to use the new name, but it does not change the name of the JSP file.
- For files that contain a JSF Handler, EGL updates references to
the file in the faces configuration file.
- For JSP files that are controlled by a JSF Handler, EGL updates
the view property of the JSF Handler to
refer to the new JSP file.
- For Program parts within an EGL plug-in project, EGL corrects
the reference to the program in the plugin.xml file.
You might still need to check for other changes caused by refactoring.
For example, EGL does not change labels used with the
forward statement.
Suppose that you have a line of code that passes control to a JSF
Handler like this:
forward to "myWebPage";
In
this case, if you renamed
myWebPage, EGL does not
change this
forward statement to reflect
the new label for the page. You must search for changes and update
the files manually.