Is there a way to automatically generate getters and setters in Eclipse? Is there a way to automatically generate getters and setters in Eclipse? android android

Is there a way to automatically generate getters and setters in Eclipse?


Bring up the context menu (i.e. right click) in the source code window of the desired class. Then select the Source submenu; from that menu selecting Generate Getters and Setters... will cause a wizard window to appear.

Source -> Generate Getters and Setters...

Select the variables you wish to create getters and setters for and click OK.


In Eclipse Juno, by default, ALT+SHIFT+S,R opens the getter/setter dialog box. Note you have to press all 4 keys.


Right click -> Source -> Generate setters and getters

But to make it even more convenient, I always map this to ALT+SHIFT+G from Windows -> Preferences -> General -> Keys