[android-developers] eclipse XML formatting not working

2012-02-13 Thread John Goche
Hello,

I've recently reinstalled eclipse and ADT and android plugin for eclipse.
I am trying to set the formatting properties for my projects by going to
Preferences - XML - XML Files - Editor and setting them, but when
I save and do a CTRL-SHIFT-F eclipse behaves as if I never set any of
them. Anyone have this problem or know how to fix it?

Thanks,

JG

(eclipse SDK 3.7.1 eclipse plugin for developer tools 16.0.1)

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] eclipse XML formatting not working

2012-02-13 Thread Tor Norbye
On Mon, Feb 13, 2012 at 7:01 AM, John Goche johngoch...@googlemail.comwrote:

 Hello,

 I've recently reinstalled eclipse and ADT and android plugin for eclipse.
 I am trying to set the formatting properties for my projects by going to
 Preferences - XML - XML Files - Editor and setting them, but when
 I save and do a CTRL-SHIFT-F eclipse behaves as if I never set any of
 them. Anyone have this problem or know how to fix it?


Go to Preferences - Android - Editors and uncheck the first option
(Format XML files using the standard Android XML style rather than
the configured Eclipse XML style (additional options below).

The builtin Eclipse XML formatter isn't suitable for formatting XML files
the standard Android way (where for example layouts and value files are
formatted differently), so in Android projects we use an alternate
formatter (which also sorts attributes etc). If you uncheck the option
above, it will just use the default Eclipse XML formatter instead.

-- Tor

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] eclipse XML formatting not working

2012-02-13 Thread John Goche
On Mon, Feb 13, 2012 at 4:48 PM, Tor Norbye tnor...@google.com wrote:

 Go to Preferences - Android - Editors and uncheck the first option
 (Format XML files using the standard Android XML style rather than
 theĀ configured Eclipse XML style (additional options below).

Thanks, that worked!

 The builtin Eclipse XML formatter isn't suitable for formatting XML files
 the standard Android way (where for example layouts and value files are
 formatted differently), so in Android projects we use an alternate formatter
 (which also sorts attributes etc). If you uncheck the option above, it will
 just use the default Eclipse XML formatter instead.

Not sure what the benefits of having attributes sorted rather than appear in
the order the user wants them to be is, but I guess I'm not going to run into
any problem if I format the XML files my own preferred way. Otherwise, please
let me know.

Thanks,

JG

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] eclipse XML formatting not working

2012-02-13 Thread Tor Norbye
On Mon, Feb 13, 2012 at 8:27 AM, John Goche johngoch...@googlemail.comwrote:

 On Mon, Feb 13, 2012 at 4:48 PM, Tor Norbye tnor...@google.com wrote:

  Go to Preferences - Android - Editors and uncheck the first option
  (Format XML files using the standard Android XML style rather than
  the configured Eclipse XML style (additional options below).

 Thanks, that worked!

  The builtin Eclipse XML formatter isn't suitable for formatting XML files
  the standard Android way (where for example layouts and value files are
  formatted differently), so in Android projects we use an alternate
 formatter
  (which also sorts attributes etc). If you uncheck the option above, it
 will
  just use the default Eclipse XML formatter instead.

 Not sure what the benefits of having attributes sorted rather than appear
 in
 the order the user wants them to be is, but I guess I'm not going to run
 into
 any problem if I format the XML files my own preferred way. Otherwise,
 please
 let me know.


The order doesn't matter -- just like the formatting and whitespace itself
doesn't matter -- but for clarity some developers prefer to list ids and
attributes first, and in layouts the layout params before the others etc.

-- Tor

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en