Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Tools / August 2006

Tip: Looking for answers? Try searching our database.

Hi, a simple one in comments formatting for eclipse

Thread view: 
shlomiw@gmail.com - 30 Jul 2006 08:42 GMT
Hi !

I'm working on eclipse 3.1.0 .
There is something that quite annoying in the code formatter and I
didn't figure out where to change it. When I comment lines with two
slashes "//", I like it when it is in the same column as the code and
not at the beginning, e.g:
class A
{
  // my comment
  public int a;
}

when I'm copying lines starting with comments, the formatter put the
comment at the beginning of the line, e.g:
class A
{
  // my comment
  public int a;

//    my comment
  public int a;

}

how could it be avoided?

Thanks in advance,
Shlomi
TheDude - 30 Jul 2006 11:59 GMT
Try
Window -> Preferences -> Java -> Editor -> Typing, and unselect "Adjust
indentation" checkbox.
I hope that helps.
shlomiw@gmail.com - 30 Jul 2006 12:42 GMT
> Try
> Window -> Preferences -> Java -> Editor -> Typing, and unselect "Adjust
> indentation" checkbox.
> I hope that helps.

tnx for your reply -
it works, but then it's not performing identation on all the others. is
it possible to apply this only on comments?

cheers
shlomiw@gmail.com - 01 Aug 2006 11:44 GMT
hmmm...

apparently it is not that simple :-(
https://bugs.eclipse.org/bugs/show_bug.cgi?id=65841
(Target milestone: 3.3)

> > Try
> > Window -> Preferences -> Java -> Editor -> Typing, and unselect "Adjust
[quoted text clipped - 6 lines]
>
> cheers
Roland de Ruiter - 01 Aug 2006 12:18 GMT
> hmmm...
>
[quoted text clipped - 11 lines]
>>
>> cheers

You could use Ctrl+Shift+F to format the code again. (Or select the
pasted lines and hit Ctrl+Shift+F to format only those lines).
Signature

Regards,

Roland

shlomiw@gmail.com - 02 Aug 2006 08:28 GMT
tnx, that better. Hopefully it'll be fixed in next eclipse's version.
It seems that I'm not the only one who is frustrated.

> > hmmm...
> >
[quoted text clipped - 14 lines]
> You could use Ctrl+Shift+F to format the code again. (Or select the
> pasted lines and hit Ctrl+Shift+F to format only those lines).


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.