Eclipse tips

Find all FAQs, HOWTOs and guides here.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Locked
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Eclipse tips

Post 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
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper โ™€
I don't give private support - PM will be ignored!
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: eclipse tips

Post 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
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper โ™€
I don't give private support - PM will be ignored!
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: eclipse tips

Post 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
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper โ™€
I don't give private support - PM will be ignored!
User avatar
Zoey76
L2j Inner Circle
L2j Inner Circle
Posts: 7005
Joined: Tue Aug 11, 2009 3:36 am

Re: eclipse tips

Post by Zoey76 »

Topic cleaned up, soon to be updated.

Feel free to PM with new tips.
Powered by Eclipse 4.30 ๐ŸŒŒ | Eclipse Temurin 21 โ˜• | MariaDB 11.3.2 ๐Ÿ—ƒ๏ธ | L2J Server 2.6.3.0 - High Five ๐Ÿš€

๐Ÿ”— Join our Discord! ๐ŸŽฎ๐Ÿ’ฌ
Locked