日食:排除特定的软件包自动填充类名称的时候 [英] Eclipse: Exclude specific packages when autocompleting a class name
问题描述
当自动完成Eclipse的一个类名,例如如果你输入:
LISTI
<大骨节病>标签骨节病>
一个弹出菜单出现为您提供完成匹配类名(你可以使用鼠标或通过使用箭头键选择:
在这个例子中我几乎可以肯定要 java.util.ListIterator中
和<即code> com.sun.xml.internal.bind.v2的概率。 runtime.reflect.ListIterator (或任何来自其他包)是我想要的是在一万元左右的。
我知道这个特殊的类将出现在列表中频繁(每隔我宣布时间的ListIterator
),所以我想能够排除自动完成搜索其他包,使 java.util.ListIterator中
是自动完成,而不需要一个弹出菜单。
这可能吗?
窗口 - &GT; preferences-&GT; Java的&GT;&外观 - GT;类型过滤器
您应该可以指定有你不希望看到的软件包。
请参阅Java提示和技巧
要出现在内容帮助排除某些类型,请使用
的Java&GT配置的类型过滤功能;外观&GT;型过滤器
preference页面。结果
类型匹配这些过滤器模式将不会出现在打开类型对话框中的一个,并不会提供给内容辅助,快速修复和组织导入。结果
这些过滤器模式不影响在Package Explorer和层次的看法。
块引用>finnw (在OP)在评论中补充说:
现在,你如何添加一个类来这个名单?我不感兴趣的java.awt.List中,但偶尔我想java.awt.Window中或java.awt.Dimension中。 -
块引用>类型过滤器实际上是基于类模式匹配,这意味着如果添加:
java.awt.List中
这班将从内容消协主张。结果
如果你知道所有java.awt.Lxxx
类不感兴趣,你可以添加java.awt.L *
从
java.awt中
所有其他类仍然会在那里为内容辅助。结果
与最近的Eclipse(我现在一日食3.6Mx,但这应该为3.5.x的工作以及),你不仅限于的包的模式只在类型过滤器。When auto-completing a class name in Eclipse, e.g. if you type:
ListI
TabA pop-up menu appears offering you matching class names for completion (which you can select with the mouse or by using the arrow keys:
In this example I almost certainly want
java.util.ListIterator
and the probability thatcom.sun.xml.internal.bind.v2.runtime.reflect.ListIterator
(or anything else from that package) is what I want is about one in a million.I know this particular class will appear in the list frequently (every time I declare a
ListIterator
) so I would like to be able to exclude the other packages from autocomplete searches, so thatjava.util.ListIterator
is auto-completed without the need for a pop-up menu.Is this possible?
解决方案Window->Preferences->Java->Appearance->Type Filters
You should be able to specify there the packages you do not want to see.
To exclude certain types from appearing in content assist, use the type filter feature configured on the
Java > Appearance > Type Filters
preference page.
Types matching one of these filter patterns will not appear in the Open Type dialog and will not be available to content assist, quick fix and organize imports.
These filter patterns do not affect the Package Explorer and Hierarchy views.
finnw (the OP) adds in the comments:
Now how do you add a single class to this list? I'm not interested in java.awt.List but occasionally I want java.awt.Window or java.awt.Dimension. –
"Type filter" is actually based on class pattern matching, meaning if you add:
java.awt.List
that class will disappear from the content assist propositions.
If you know alljava.awt.Lxxx
classes are of no interest, you could addjava.awt.L*
All other classes from
java.awt
would still be there for the content assist.
With a recent eclipse (I have right now a eclipse 3.6Mx, but this should work for 3.5.x as well), you are not limited to package pattern only in the Type Filter.这篇关于日食:排除特定的软件包自动填充类名称的时候的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!