最近在Eclipse中安装了一个插件:checkStyle检查了一下代码,好多:File contains tab characters(this is the first instance).于是上网上查了一下在windows-》prefrences->editors->Text editors中设置Displayed tab width为4,然后勾选了insert spaces for tabs。
 但是这样好像是只对我再新建文件后用tab管用,之前用的tab,有没有快速的方法全部换成四个空格啊。   求解答,谢谢!
ps:一个一个的换,类似了,无语!求解答,谢谢!

解决方案 »

  1.   

    在preferences, section Java > Code Style > formatter 选择当前的formatter, edit,
    勾上use spaces to indent wrapped lines
      

  2.   

    android源码里面有现成的formatter,导进去也可以,在development/ide/eclipse/下面
      

  3.   

      小哥,貌似这样不行啊,我在prefrences中设置完成。然后再用checkstyle还是提示:File contains tab characters(this is the first instance).
      我是这样做的你看对不:
      windows->prefrences->java->code style->formatter->edit->在General settings中Tab policy中选择:Tabs Only,然后再选择:use spaces to indent wrapped lines。点Ok。再用checkstyle检查还是不行。
      我也在工程名上右键->prefrences->java code style->formatter->选Enable project specific settings->edit->在General settings中Tab policy中选择:Tabs Only,然后再选择:use spaces to indent wrapped lines。点Ok。还是不行。求解答!谢谢啊!
      

  4.   

    android源码里面有现成的formatter,导进去也可以,在development/ide/eclipse/下面
      

  5.   

    是不是这个:android-formatting.xml?