tags:

views:

166

answers:

5

The problem is that, there're two much setters and getters messing up the source code editor, I have to scroll up and down and distinguish where are the demarcation of the business methods. Is there a plugin that I can hide or fold setters and getters?

I know there're some libraries can eliminate setters and getters by using annotations or AOP techniques, this is not allowed in my project.

+1  A: 

I'd rather place the business methods above the setters and getters, and place something like this between them:

//================== Setters and getters start =====================
Bozho
+1  A: 

Use Ctrl + O to navigate

Create section that separate specific part of code (like Bozho suggested).

Instead of scrolling the code You can use the outline view.

While You are working with Eclipse the mouse is not really needed.

Vash
+1  A: 

Coffee Bytes Code Folding is your friend:

Adds Code Folding preference page - Enable/Disable folding types - Control Folds: e.g. getter/setter, main methods, constructors, other methods separately. - Fold Javadocs, Block Comments, etc. separately - Filter foldable regions (e.g. on number of lines) - Define own foldable regions based on specially defined comments and define custom folding structures (e.g. if, while, try/catch, switch, comments, ...) - New icon set

Sylar
This project is dead, and the update site doesn't work.
ZZcat
You can installit via Yoxos marketplace in eclipse itself (Help -> Eclipse Marketplace). Maintained or not, it still works, with some small issues in Helios and offers more functionality than the default folding.
Sylar
+2  A: 

If you have too many getters and setters confusing you with business methods, it sounds like it is time to refactor into two separate classes.

Thorbjørn Ravn Andersen
A: 

Checkout projectlombok. It will generate getters/setters for your properties automatically and keeps your source clean of this boilerplate code.

Jeroen Rosenberg
he said he knows about such projects and isn't allowed to use them
Bozho