问题描述
当我在 Eclipse 中编程时,自动完成建议框通常在键入一个点时打开(例如在键入 System.
或 SomeObject.
后,并停留键入与任何建议类似的代码时打开.
这就是我要说的:
我经常使用自动完成建议框来发挥我的优势,如果可能的话,为了提高我在编程时的工作效率,我想做出一些改变;
有没有办法让建议框一直可见,实时显示建议(并在出现时显示一个空白框没有可用的建议)?
有什么方法可以向建议框添加永久的自定义建议(例如切换案例模板或一行代码,如
public String toString()
)?有什么方法可以重新排列建议框的顺序(例如在通用函数之前的类私有变量或
System.out.print() 之前的
) ?System.out.println()
)有什么方法可以重新设计建议框 - 即更改其文本颜色、背景颜色、重新调整建议框窗口的大小并删除黄色的 java-doc 弹出窗口?
仅供参考,在 Eclipse 术语中,此功能称为 Content Assist.
有没有办法让建议框一直可见,实时显示建议(没有可用建议时显示一个空白框)?
不,这不可能.您可以随时通过 +(Mac 上为 +)调用它
有什么方法可以向建议框添加永久的自定义建议(例如 switch case 模板或一行代码,如 public String toString())?
是的,您可以通过Preferences > Java > Editor > Templates
有什么方法可以重新排列建议框的顺序(例如,通用函数之前的类私有变量或 System.out.print() 之前的 System.out.println())?
不是真的.通过 Preferences > Java > Content Assist > Advanced 可以对通过提案类型循环"的顺序进行一些控制>,但这并不是您真正要寻找的.我认为,提案的顺序基于调用 Content Assist 的当前上下文.
有什么方法可以重新设计建议框 - 即更改其文本颜色、背景颜色、重新调整建议框窗口的大小并删除黄色的 java-doc 弹出窗口?
所有自定义选项都可以在Preferences > Java > Content Assist 下使用;颜色选项在 Preferences > General > Appearance > Color and Fonts 下可用,但我认为它的颜色弹出窗口可能来自您的操作系统颜色设置.
如果您正在使用(或愿意使用)Eclipse Juno (4.2) 那么有一个新的项目调用 您可能会感兴趣的代码推荐器.
When I am programming in Eclipse, the auto-complete suggestions box usually opens when typing a dot (for example after typing System.
or SomeObject.
, and stays open while typing a similar code to any of the suggested.
This is what I'm talking about:
I often use the auto-complete suggestions box to my advantage, and there are couple of changes I would like to make in order to improve my productivity while programming, if possible;
Is there any way to make the suggestions box visible all the time,showing suggestions in real-time (and showing a blank box when thereare no available suggestions) ?
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()
) ?Is there any way to re-order the suggestions box (e.g. class private variables before general functions or
System.out.println()
beforeSystem.out.print()
) ?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?
FYI, in Eclipse terminology this feature is called Content Assist.
No, that's not possible. You can invoke it any time you want via + (+ on Mac)
Yes, you can add your own templates via Preferences > Java > Editor > Templates
Not really. There is some control of the order for "cycling" through proposal types via Preferences > Java > Content Assist > Advanced, but it's not really what you're looking for. The order of proposals is, I think, based on the current context of when Content Assist is invoked.
All of the customization option are available under Preferences > Java > Content Assist; color options are available under Preferences > General > Appearance > Color and Fonts, but I think the colors for that pop-up might come from your operating system color settings.
If you're using (or willing to use) Eclipse Juno (4.2) then there is a new project call Code Recommenders that you might find interesting.
这篇关于更改 Eclipse 自动完成(内容辅助)的行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!