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 / General / July 2005

Tip: Looking for answers? Try searching our database.

Eclipse: Stripping whitespace at EOL

Thread view: 
Tim Tyler - 12 Jul 2005 13:59 GMT
Can Eclipse be configured to strip whitespace at EOL?

Either at every save - or in the formatter?

If so, what's the best way to do that?
Signature

__________
|im |yler  http://timtyler.org/  tim@tt1lock.org  Remove lock to reply.

Andrew Thompson - 12 Jul 2005 14:36 GMT
> Can Eclipse be configured to strip whitespace at EOL?
>
> Either at every save - or in the formatter?

I do not understand what you mean by 'the formatter'.

Here, in Eclipse 3.0.2 , the keyboard actions, ^a ^F ,
removes whitespace from the ends of source lines.

Isn't ^F invoking the formatter?

Signature

Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane

Tim Tyler - 12 Jul 2005 22:41 GMT
Andrew Thompson <SeeMySites@www.invalid> wrote or quoted:

> > Can Eclipse be configured to strip whitespace at EOL?
> >
> > Either at every save - or in the formatter?
>
> I do not understand what you mean by 'the formatter'.

See Preferences -> Java -> Code style -> Formatter.

> Here, in Eclipse 3.0.2 , the keyboard actions, ^a ^F ,
> removes whitespace from the ends of source lines.
>
> Isn't ^F invoking the formatter?

Try typing "//   " (without quotes) - on a blank line - and then
performing the above actions.

The formatter can remove /some/ spaces - but doesn't seem to deal with
all of them :-|
Signature

__________
|im |yler  http://timtyler.org/  tim@tt1lock.org  Remove lock to reply.

Andrew Thompson - 12 Jul 2005 23:53 GMT
> Andrew Thompson <SeeMySites@www.invalid> wrote or quoted:
>
>>> Can Eclipse be configured to strip whitespace at EOL?
..
>> I do not understand what you mean by 'the formatter'.
>
> See Preferences -> Java -> Code style -> Formatter.

Right.  Eclipse is not one of my more common IDE's
( I was seeking your help with it some time ago when I
screwed up the settings on an earlier version of Eclipse. )

I more commonly use TextPad, which automatically trims
all whitespace at the end of lines (none of this
'configurable' crap!), or JBuilder, which seems to
do it flawlessly.

>> Here, in Eclipse 3.0.2 , the keyboard actions, ^a ^F ,
>> removes whitespace from the ends of source lines.
..
> Try typing "//   " (without quotes) - on a blank line - and then
> performing the above actions.

Uh-huh..  Oooh..

> The formatter can remove /some/ spaces - but doesn't seem to deal with
> all of them :-|

You could try swi..  No, maybe I shouldn't go there.   ;-)

Signature

Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
In Hypno-Vision

Roland - 12 Jul 2005 16:13 GMT
> Can Eclipse be configured to strip whitespace at EOL?
>
> Either at every save - or in the formatter?
>
> If so, what's the best way to do that?
I miss that feature in Eclipse too. It's useful (I know from JBuilder),
for instance when auto-indent adds "superfluous" whitespace everytime I
insert/type an empty line.

The only way that I know of to remove trailing whitespace is to use
Find/Replace with regular expression "[\t ]+$" (without the qoutes).
Signature

Regards,

Roland de Ruiter
` ___      ___
`/__/ w_/ /__/
/  \ /_/ /  \

Dale King - 16 Jul 2005 08:18 GMT
>> Can Eclipse be configured to strip whitespace at EOL?
>>
[quoted text clipped - 8 lines]
> The only way that I know of to remove trailing whitespace is to use
> Find/Replace with regular expression "[\t ]+$" (without the qoutes).

Actually, Eclipse has functionality to remove trailing whitespace, but
for some reason they don't expose it by default.

If you go to the key bindings, select modify and select File for the
category you will see that there is a Remove trailing whitespace that
can be bound to a key.

I don't see any way to actually add that to the menus.

To do it automatically check out the AnyEdit plugin:
http://andrei.gmxhome.de/anyedit/

Signature

 Dale King

Tim Tyler - 16 Jul 2005 13:50 GMT
Dale King <DaleWKing@insightbb.nospam.com> wrote or quoted:

> >> Can Eclipse be configured to strip whitespace at EOL? [...]

> > I miss that feature in Eclipse too. It's useful (I know from JBuilder),
> > for instance when auto-indent adds "superfluous" whitespace everytime I
[quoted text clipped - 9 lines]
> category you will see that there is a Remove trailing whitespace that
> can be bound to a key.

Thanks.  Doing it on save would be nice - but I don't think
the Eclipse folk have got the ability to easily execute a
series of actions on a keypress yet - without writing code.

Your http://andrei.gmxhome.de/anyedit/ looks like it would do
exactly what I want, though.
Signature

__________
|im |yler  http://timtyler.org/  tim@tt1lock.org  Remove lock to reply.



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.