Friday, July 1, 2011

Small Roads in Eclipse

Hello All,
When i was wondering for some easy steps or shorcuts in eclipse i searched and got many but i wanted to keep them at one place.So here i am with small collection.
May be it helps somebody!!!


1) Ctrl + Space – Intelli-sense or auto completion 

2) How do I get line numbers?
Go to Window -> Preferences -> General -> Editors -> All Text Editors and check Show line numbers.




NOTE: You can also change the color appearance.

3) How do I get soft tabs?
        To get soft tabs (tabs replaced by spaces) as you type, go to Window -> Preferences -> Java -> Code style-> Formatter and select the profile Java Conventions [built-in]. This should be set correctly to  give soft tabs.

    You can create your own profile by clicking Show...; for soft tabs, go to Indentation un-check Use tab   characters. After making your changes, you will be prompted for a name for your new profile.





4)      Global Search - One of my favorites is Ctrl + Shift + G, which searches the workspace for   references to the selected method or variable.



5)       A complete list of shortcuts can be seen with Alt + Shift + L. Going through that list is sure to teach you a few new tricks about Eclipse.





 6) Ctrl + O - Doing it once gives you the ability to quick search/jump to methods in the class you have already open.Doing it twice, gives you the same ability but then for all methods in the current class plus super classes. Very handy!

7)  Ctrl + F6 - toggle between tabbed editors.




8) Ctrl + E - List of open editors.

9)  Ctrl + F3 and Ctrl + O also show the list of the functions in a class.




10)  Ctrl + T - type hierarchy 




11)      Ctrl + Shift + R - will open a dialog for you where you can type the name of method which u wish to open.





12)      Add getter and setters for particular field:
                       write String temp and press (Ctrl + 1) after selecting the field


    you will get an option to add getters and setters for that field.





13)      To quickly do a rename that doesn't require full analysis of dependencies in other files, write String temp and press (Ctrl + 1) after selecting the field you will get an option to rename.





14)  Edit -> Quick fix will produce effect of Ctrl + 1

15)      Ctrl + L - to go to specific line number.





16)      To find a matching bracket select an opening or closing bracket and pressCtrl + Shift + P or select Navigate > Go To > Matching Bracket. You can also double click before an opening or after a closing bracket - this selects the text between the two brackets.

17) To create a delegate method for a field select the field's declaration and invoke Source > Generate Delegate Methods. This adds the selected methods to the type that contains a forward call to delegated methods. This is an example of a delegate method.


   

18)      F4 To display hierarchy view of current class.





19) Ctrl + Shift + O - To manage imports automatically.

20) Ctrl + 3 –  Check this out.





21) Ctrl + Alt + H - Open Call Hierarchy.





22) Ctrl + Mouse Click - takes you to the declaration or definition

23) Ctrl + Q - Go to the last edit location.

24) Alt + ← and Alt + → - Hop back and forth through the files you have visited.

25)  ALT + Shift + C  - To change method signature.    






No comments:

Post a Comment