Page 1 of 1

Eclipse tips

Posted: Mon Nov 30, 2009 7:46 am
by janiii
Many of you use eclipse as the developing environment for L2J. I will try to give you some tips using this tool that could help you developing L2J code (also any other code). you are free to give your tips here too ;)

- Writing code and don't know which methods an object of given class have? Eclipse has a nice feature called code completion (content assist), which makes coding really easy ;) CTRL + SPACE should give you possibilities of code you want to write. e.g. you write L2Pc and hit the shortcut, it should give you all possibilities you can write, e.g. L2PcInstance.

- Searching for a java class and don't know in which package it is? CTRL + SHIFT + T pops up a window where you can type the name of your java class and open it.

- Searching for a file (be it a .sql file or .properties or .java)? CTRL + SHIFT + R pops up a window where you can type a name of your file and open it.

- Having unresolved imports or just some imports more then needed in your java file? CTRL + SHIFT + O organizes the imports for you, importing the needed class if it finds it and deleting the unneeded ones.

- Searching for a method in a very long class? CTRL + O outlines the current class and you can type the name of the method and navigate to it straight.

- Having the line of code and wanting to navigate to it? just type the line in CTRL + L and go there.

- Wanting to know where in workspace a method of a class is called? having the cursor on desired method/property just hit CTRL + ALT + H or right-click on the method and click on Open Call hierarchy . a new window in perspective is opened where you can see who call the method (also the calling of the call, etc).

- Having a messy code? select part of code you want to format (CTRL+A for selecting all) and hitting CTRL + SHIFT + F formats the code according to your format settings.

- Searching for a word in a file and wanting to go match by match? select the word and CTRL + K finds the next occurring of the selected text in the file. CTRL + SHIFT + K finds the previous occurrence of the selected text in the file.

- Wanting to see line numbers? in menu Window -> Preferences -> General -> Editors -> Text Editors -> check Show Line Numbers.

- Wanting to see spaces and tabs? (you will see how messy the code is, mixing tabs and spaces!) in menu Window -> Preferences -> General -> Editors -> Text Editors -> check Show Whitespace Characters.

- Looking for a method/class/variable declaration Click and then F3 shows you the declaration.

The above listed shortcuts are what I use every day :)
Other Eclipse shortcuts and tips: http://www.bristle.com/Tips/Eclipse.htm

Re: eclipse tips

Posted: Tue Jan 05, 2010 6:34 pm
by janiii
Ignore white spaces in patches (so that the patches from forum apply without problems!)

Main menu -> Window -> Preferences -> General -> Compare/Patch -> tab General -> check checkbox Ignore white space:
Image

==============================================================================================

Or you can set it just for the diff when you are applying it:
Image

Re: eclipse tips

Posted: Tue Jan 05, 2010 6:50 pm
by janiii
eclipse video tutorial for total beginners: http://eclipsetutorial.sourceforge.net/

===========================================================================================

eclipse galileo guides: http://help.eclipse.org/galileo/index.jsp -> Java Development Guide

basic tutorial: http://help.eclipse.org/galileo/topic/o ... torial.htm
tips and tricks: http://help.eclipse.org/galileo/topic/o ... _tips.html

Re: eclipse tips

Posted: Wed Jan 18, 2012 8:29 am
by Zoey76
Topic cleaned up, soon to be updated.

Feel free to PM with new tips.