【发布时间】:2012-09-17 06:25:36
【问题描述】:
在 Eclipse 中,当按下 CtrlShiftF 时,我需要像在 Java 上那样使用 Formatter 格式化 XML。
在 XML 上使用 CtrlShiftF 不能提供我想要的结果。
有没有像“Window→Java→Code Style→Formatter”这样的工具来完成这项工作?
“Window→XML→XML Files→Editor”和“Window→Editors→Text Editors”缺少很多功能,例如“Window →Java→Code Style→Formatter→Edit→Indentation→Align fields in columns" 这样XML结果就会像这样:
android:id = "@+id/textView1"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content"
我不在乎它是外部插件还是库。 我使用 Eclipse 4.2.0 Juno 进行 Android 开发。
【问题讨论】:
-
“没有提供我想要的结果”...是你想要的结果是什么?
-
完全自定义格式。比如控制空白行、对齐字段等。
-
我看到一个空白行选项...您要对齐哪些字段?会不会只是看到 Layout editor 的格式,不一样?
-
@nitind 关于“空白行”,您是绝对正确的!关于我编辑问题的对齐字段。
标签: xml eclipse eclipse-plugin