I'm currently switching from Netbeans to Eclipse. In Netbeans, pressing Alt+Enter on a line with an error or warning will cause a dialogue to pop up with suggested fixes.
In Eclipse, the same dialogue can be shown, but I have to hover over the error/warning with my mouse. The "focus" hotkey doesn't seem to do anything except allow the dialogue to remain open.
Is there any way to emulate the Netbeans dialogue behavior in Eclipse?
In Eclipse this feature is called Quick Fix (Ctrl+1): see Eclipse help: Quick Fix and Quick Assist
Shortcuts can be changed in Window > Preferences: General > Keys (by default Alt+Enter is bound to the command Properties).
It seems that you can hover mouse over any Eclipse IDE component and press a keyboard shortcut to see the component source code. What is that keyboard shortcut?
Guess you're talking about the "Spy": Use alt+shift+F1 for the Plug-In Spy and alt+shift+F2 for the Menu Spy. (or enter "Spy" in the Quick Access field to see your specific shortcut, if it should differ).
Is it possible to bind a keyboard shortcut to the action of selecting the next item in a Content Assist pop-up menu of choices?
Desired configuration:
press OPTION / to invoke the Content Assist pop-up menu
press CONTROL N to navigate down the Content Assist pop-up menu items until I highlight the one I want
I know this is possible as I know somebody who can do just that in his Eclipse.. I used it and it worked.
Here's one solution:
In "Preference" - "Keys", find your combination of keys to move cursor one line up/down (search command "Line up"/"Line down"), and set its scope to "In Dialog/Window" to make it work in Content Assist prompt.
Note that this configuration doesn't make it work in all windows. At least, not in "Open Source..." (Ctrl + Shift + R).
How can I enable autocomplete in Eclipse? I can't find it!
If you would like to use autocomplete all the time without having to worry about hitting Ctrl + Spacebar or your own keyboard shortcut, you can make the following adjustment in the Eclipse preferences to trigger autocomplete simply by typing several different characters:
Eclipse > Preferences > Java > Editor > Content Assist
Auto Activation > Auto activation triggers for Java
Enter all the characters you want to trigger autocomplete, such as the following:
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ._
Now any time that you type any of these characters, Eclipse will trigger autocomplete suggestions based on the context.
By default in Eclipse you only have to press Ctrl + space for autocomplete. Then select the desired method and wait 500ms for the javadoc info to pop up.
If this doesn't work go to the Eclipse Windows menu → Preferences → Java → Editor → Content assist and check your settings here
window->preferences->java->Editor->Contest Assist
Enter in Auto activation triggers for java:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ._
Apply and Close
other method:
type initial letter then ctrl+spacebar for auto-complete options.
For auto-completion triggers in Eclipse like IntelliJ, follow these steps,
Go to the Eclipse Windows menu -> Preferences -> Java -> Editor -> Content assist and check your settings here
Enter in Autocomplete activation string for java:
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ._#
Apply and Close the Dialog box.
Thanks.
For anyone having this problem with newer versions of Eclipse, head over to Window->Preferences->Java->Editor->Content assist->Advanced and mark Java Proposals and Chain Template Proposals as active.
I am not sure if this has to be explicitly enabled anywhere..but for this to work in the first place you need to include the javadoc jar files with the related jars in your project. Then when you do a Cntrl+Space it shows autocomplete and javadocs.
If you are only unfamiliar with the auto-complete while typing syntax or inbuilt methods in the eclipse you can simply type the desired syntax or method name and press Ctrl+Space that will display the list of desired options and you can select one of them.
If the auto-complete option is not enabled then you have to check your settings from Windows menu -> Preferences -> Java -> Editor -> Content assist
If the auto-complete option is not enabled then you have to check your settings from Windows menu -> Preferences -> Java -> Editor -> Content assist->Advanced and mark Java Proposals and Chain Template Proposals .
In Eclipse click Windows Drop-Down > Click Preferences > Navigate to Java > Editor > Content Assist
In order to Make the Auto suggestion/completion to work you have to set trigger that invoke the Auto Completion.
Now go to,
Auto Activation > Auto activation triggers for Java
Enter all the characters you want to trigger autocomplete to be
invoked in Eclipse IDE, such as the following:
Alpahabets: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
OR
Special Characters: ~!##$%^&*()_+=-:;'"|?/.,
OR
Any combination of Alpahabets & Special Characters.
Now based on the references, Eclipse will trigger autocomplete suggestions for you.
For me, it helped after I changed the theme to 'mac' since I am running on a MacOSX.
Eclipse: >Preferences > General > Appearance > Choose 'Mac' from the menu.
Is there any way in Netbeans of displaying the contextual menu with the keyboard? I've tried Shift+F10 and the key next to the right Ctrl key with no success, but I can open it clicking with the right button.
Saludos.
Shift+F10 is the official way in Netbeans 6.9. If this is not working for you, go to "Tools" - "Options" - "Keymap" and check which shortcut is assigned to "Popup"