Search code examples
javaeclipseshortcut

How to select all the occurrences of a word in Eclipse


What I wan't to know is if it is possible to SELECT all of the occurrences of the same word in a Java Program. I know that it is possible in Sublime Text 3 but I wan't to know if it Will work in Eclipse. And I don't mean highlight, I already know Mark Occurrences, I want it to like, select the word here is a example:

 public class Employee1 

 {
    private String guyName;
    private String jobTitle;

    public String getName() {
        return guyName;
    }
    public void setName(String name) {
        this.guyName = name;
    }
    public String getJobTitle() {
        return jobTitle;
    }
    public void setJobTitle(String jobTitle) {
        this.jobTitle = jobTitle;
    }

 }

I want to be able to change all of the guyName variables to personName just by selecting one, pressing a shortcut that selects all of the same word then just type and change it. Thanks :D ~Scoutdrago3


Solution

  • Yeah - select the variable name - then use Alt-Shift-R, then rename. Only variable names can be changed that way.