Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there a shortcut in eclipse for generating resources (constructors , get/set .....)

currently in eclipse if i want to generate a constructor or getters/setters i go the class name right click on that ->source->access the right Generation option

eclipse

while in the android studio we have a convenient and fast shortcut to do that i just need to press CMD+N anywhere in the page to open the generate dialog

android studio

is there an eclipse shortcut available that is equivalent to that ?

like image 399
A.Alqadomi Avatar asked Oct 12 '15 08:10

A.Alqadomi


People also ask

Can generate getters and setters in eclipse?

To generate getters and setters, do the following: Create the fields you want in the class then press Alt+Shift+S, R. A dialog will pop up allowing you to choose the fields you want to generate getters and setters for. Click Select All to create getters/setters for all fields.

What is Ctrl Shift G in eclipse?

Ctrl + Shift + G. Search for references in the workspace. Command + T. Ctrl + T. Shows type hierarchy of the current java class.


2 Answers

Press Alt+s then type c for constructor, r for set/get s for toStringetc..

like image 60
Rustam Avatar answered Sep 22 '22 17:09

Rustam


You can go to Windows -> Preferences -> General -> Keys to map this action to a shortcut of choice.

This is how to do it:

enter image description here

like image 26
randers Avatar answered Sep 20 '22 17:09

randers