简体   繁体   中英

Exclude packages from Eclipse's organize imports

There are certain classes, such as Closeable , File and Container , that have doppelgänger classes in obscure packages that I am extremely unlikely to ever use. Normally, that wouldn't be an issue, but when I Organize Imports I have to manually select the correct type to import. Is there any way to exclude specific packages from the Organize Imports tool?

Eclipse Version:
Version: 3.7.1
Build id: M20110909-1335

I don't see, for example, the com.sun.*.Closeable in your example when I use ContentAssist or Organize Imports. I think where you want to configure it is in Preferences > Java > Appearance > Type Filters . However, I don't have com.sun.* listed in my filter list. Maybe it's the "Hide forbidden references" option.

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM