In Eclipse, the default case of auto-activation only happens when user type ".", but in others, like Visual Studio, the Intellisense is much more powerful. We also want Eclipse to realize auto-activation when we enter all the letters and some symbols. Actually there is a way:
Go to Eclipse:
Windows -> Preferences -> Java -> Editor -> Content Assist
Check "Enable auto-activation":
Auto activation delay : set to a small number, like 0~50.
Auto activation triggers for Java: set to .abcdefghijklmnopqrstuvwxyz(,
Auto activation triggers for Javadoc: leave it as @#
Apply->OK.
Then we are done!
Also, sometime we want to auto insert some code template, there's also a way:
Windows -> Preferences -> Java -> Editor -> Templates
There are a lot of templates. Also we can define our own templates.
When use, we can type the name of the template and then press content assist key, which can be found under:
Windows -> Preferences -> General -> Keys. The default key is alt+/
It can be much more powerful when we insert our own templates.
Enjoy it!
No comments:
Post a Comment