Difference between revisions of "Team1/Renaming Java elements"

From CDOT Wiki
Jump to: navigation, search
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
=== 6. Renaming Java elements ===
  
=== 1. Renaming Java elements ===
+
6.1. While the particular class is selected, click on ''Refactor -> Rename''<br/>
 +
[[Image:rename1.jpg |400px]]
  
1.1. Go to the "src" folder in your package and right click on it, then select: ''New -> Class''<br/>
+
<br/>6.2. In the ''Rename Compilation Unit'' window, write down the new name for the class, e.g.''VehicleRegistration'' and check the Update references" then click on Next .<br />
[[Image:newclass1.jpg |600px]]
+
[[Image:rename2.jpg |500px ]]
  
<br/>1.2. In the ''New Java Class'' window, write down your class name, e.g."VehicleRegistration" and check the ''public static void main(String[] args)''. Press Finish to close the window.<br />
+
<br/>6.3. In the new window, the changes to be performed are displayed. <br />
[[Image:newclass2.jpg |500px ]]
+
[[Image:rename3.jpg |500px ]]
  
<br/>1.3. The following code will be the content of the ''VehicleRegistration'' class in ''cs.ecl.basics.lab'' package.<br />
+
<br/>6.4. Note the new class name in the content of the class..<br />
[[Image:newclass3.jpg |600px ]]
+
[[Image:rename4.jpg |500px ]]
 
 
'''6. Renaming Java elements '''
 
<br/>Go to the "src" folder in your package and right click on it, then select: New -> Class
 
<br/>[[Image:eclLab1_4.jpg|500px ]]
 
 
 
<br/>In the "New Java Class" window, write down your class name, e.g."Lab" and check the "public static void main(String[] args)"
 
[[Image:eclLab1_5.jpg|400px ]]
 
 
 
<br/>The following code will be the content of the Lab1_1 class.
 
[[Image:eclLab1_7.jpg|500px ]]
 
<br/>The following code will be the content of the Lab1_1 class.
 
[[Image:eclLab1_8.jpg|500px ]]
 

Latest revision as of 11:19, 30 January 2011

6. Renaming Java elements

6.1. While the particular class is selected, click on Refactor -> Rename
Rename1.jpg


6.2. In the Rename Compilation Unit window, write down the new name for the class, e.g.VehicleRegistration and check the Update references" then click on Next .
Rename2.jpg


6.3. In the new window, the changes to be performed are displayed.
Rename3.jpg


6.4. Note the new class name in the content of the class..
Rename4.jpg