当我在 Eclipse 中编程时,自动完成\建议框通常会在键入一个点时打开(例如在键入 System.
或 SomeObject.
之后,并停留在输入与任何建议的代码类似的代码时打开。
这就是我要说的:
我经常使用自动完成\建议框来发挥我的优势,如果可能的话,我想做一些改变以提高我在编程时的工作效率;
有没有办法让建议框一直可见, 实时显示建议(并在出现时显示空白框 没有可用的建议)?
有什么方法可以向建议框添加永久自定义建议(例如,切换案例模板或一行代码,如
public String toString()
)?是否有任何方法可以重新排序建议框(例如,类私有(private)变量在一般函数之前或
System.out.println()
在System.out.print( )
) ?有什么方法可以重新设计建议框 - 即更改其文本颜色、背景颜色、重新调整建议框窗口的大小并移除黄色的 java-doc 弹出窗口?
最佳答案
仅供引用,在 Eclipse 术语中,此功能称为Content Assist。
Is there any way to make the suggestions box visible all the time, showing suggestions in real-time (and showing a blank box when there are no available suggestions) ?
不,那是不可能的。您可以随时通过 Ctrl+Space(在 Mac 上为 Command+Space)调用它
Is there any way to add permanent custom suggestions to the suggestions box (e.g. a switch case template or a line of code like public String toString()) ?
是的,您可以通过首选项> Java> 编辑器> 模板 添加自己的模板
Is there any way to re-order the suggestions box (e.g. class private variables before general functions or System.out.println() before System.out.print()) ?
不是真的。通过Preferences> Java> Content Assist> Advanced 可以对提案类型的“循环”顺序进行一些控制>,但这并不是您要找的东西。我认为,提案的顺序基于调用 Content Assist 时的当前上下文。
Is there any way to re-design the suggestions box - i.e changing its text color, background color, re-sizing the suggestions box window and removing the yellow java-doc pop-up?
所有自定义选项都可以在首选项> Java> Content Assist 下使用;颜色选项在首选项> 常规> 外观> 颜色和字体下可用,但我认为颜色弹出窗口可能来自您的操作系统颜色设置。
如果您正在使用(或愿意使用)Eclipse Juno (4.2),那么有一个新项目调用 Code Recommenders你可能会觉得有趣。
关于java - 更改 Eclipse 自动完成的行为(内容辅助),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11590849/