This is a short and visual tutorial that explains how to use the rectangular edit feature of lunar eclipse's "Editor Enhancements" plugin.
Imagine you have the following code:
Figure 1
Now the instance variables x
, y
and z
should be made private. Instead of prepending the
private
modifier to every line by hand, you place the selection as shown in figure 2 and hit A-r. Enter
the string "private " (don't forget the trailing space!) into the texfield of the popup window and confirm the replacement.
Figure 2
The result can be seen in figure 3.
Figure 3
In a next step you want the change the variable's type from int
to double
. Select the text as shown
in figure 4, enter "double" into the textfield and confirm the replacement.
Figure 4
Now the code should look like in figure 5.
Figure 5
In the last example I'll show you how the make the variables x
and y
static. Again, place the selection
like in figure 6, enter "static " (don't forget the trailing space!) into the textfield and confirm the replacement.
The result is shown in figure 7.