开发者

Is there a way to tell eclipse to organize import A, import A.X and import B in that order?

Please see the sample program below (just to illustrate the problem and the code as such does nothing):

import java.util.Map;
import java.util.Properties;
import java.util.Map.Entry;

public class Test {

    public static void main(String[] args) {

        Map map;

        Properties props;

        Entry entry = new Entry<String, String>() {

            @Override
            public Str开发者_开发问答ing setValue(String value) {
                // TODO Auto-generated method stub
                return null;
            }

            @Override
            public String getValue() {
                // TODO Auto-generated method stub
                return null;
            }

            @Override
            public String getKey() {
                // TODO Auto-generated method stub
                return null;
            }
        };
    }
}

Eclipse organizes them as above and not as follows:

import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;

thanks.


everithing you can do about the "organize import" function is defined in the following preferences page:

preferences -> java -> code style -> organize imports


I realized that it's a bug in solaris eclipse v 3.5.0. This doesn't seem to happen on eclipse helios on windows.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜