General Java/Eclipse Question

Put your problem here if it does not fit any of the other categories.

General Java/Eclipse Question

Postby chefgon » Sat Nov 01, 2008 7:58 pm

At work I code with C# using Visual Studio. I'm kind of a stickler about keeping my code neat and organized, so one feature I make liberal use of is the #region and #endregion tags, which allow a block of text to be collapsed and hidden from view. I usually make a region for class-level declarations, one for public methods, private methods, one for UI event handlers, and one for Enumerations.

Does anybody know what the Java or Eclipse equivalent would be? My code is an unorganized mess right now and it's driving me crazy.
chefgon
Junior Developer
Junior Developer
 
Posts: 17
Joined: Fri Oct 31, 2008 8:26 pm

Top

Postby tabrej.khan » Thu Dec 04, 2008 1:55 pm

Hi,
In Eclipse you can see on the left side of the method or multi-line comments a - (minus) sign... click it... the code will collapse and icon changes to + sign
When ever you want to open or expand the code just click on the + sign.

Hope my answer fixes your problem :)
User avatar
tabrej.khan
Freshman
Freshman
 
Posts: 8
Joined: Wed Jul 16, 2008 6:16 am
Location: Bangalore, Karnataka

Postby MrSnowflake » Thu Dec 04, 2008 3:00 pm

Yeah, but that's standard code folding, which VS does too, but with the #region #endregion you can define your own regions, say '#region handle menus' contains the onCreate, onPrepare and onItemSelected of the menu, with VS this would alow you to remove the menu handling from your vision, giving you more space for relevant code.

As fas as I know Eclipse doesn't support this, but there was a plug-in which allowed this, but it only works on older version (<=3.2)
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 11 guests