Eclipse shortcut for getting the error context menu - eclipse

Well the title may be little confusing, but I believe everyone is familiar with the feature that Eclipse usually lets you autocorrect the possible mistakes just by clicking a light bulb
icon present at the left margin of the code editor. When we press that light bulb, we get some autocorrect options in a context menu. Is there any available shortcut for that?

I think you mean Ctrl+1 (Press the Control-Key then without releasing it, press the One-Key)
That should pop up that menu, if the cursor is on the error (in your case between the C and the l from CustomerImpl).

Related

Key binding for changing eclipse tab traversal

When using eclipse, I often use the find/replace tool without touching the mouse. I'll press Ctrl+F, type the text I want to find, press tab, type the replacement text, then press Shift+Tab 3 times, to bring focus to the "replace all" button, then I press Space to perform the action and ESC to close the window.
Today, I tried this and tab will only switch between the "find" text box and the "replace with" text box, meaning I have to go to my mouse to perform the "replace all" action, which takes forever (comparatively). I have had this problem before, and thought I recalled a key binding that changes the focus traversal policy for eclipse, but I cant seem to find it now. Googling has turned up nothing, but I don’t think I am searching for the right terms. I don’t think this is OS related, but I am on a Mac.
Thanks in advance!
I finally found this. It was OS related- Mac has a setting to allow tab navigation through buttons.
System Preferences-> keyboard, at the bottom select "all controls"

Eclipse: show error message only with keyboard

I love my keyboard. When coding(c++) in eclipse some time I do some syntactic mistakes. For example
std::String
it should have been std::string. I have been coding some java programs :p. What I m looking for is a way to display the error info
Type 'std::String' could not be resolved
using some keyboard shortcut. Instead of clicking on the bug icon that appears on the left side of the page. I know about CNTRL + '+' and '.' . So how do I do this ? Thanks
In the source code editor, pressing F2 while the (keyboard's) cursor is at at underlined text opens an overly window that contains the warning/error description. Works for JDT/java, so I assume it's the same for CDT/c++.
In addtion, (in JDT/java) pressing F2 on methods/classes without problem shows the javadoc in an overlay window.
I don't know about a keyboard shortcut for that, but here is another solution:
Open up the "Problems" view (Window -> Show View -> Problems) and position it wherever you like.
You can configure what problems are shown there by clicking on the small triangle in the upper right corner. There you have to select "Show -> Errors/Warnings on Selection". This way only errors in the currently edited file will be visible.
Now you have all your syntax errors in view without any keyboard interaction at all.
Screenshot:

Disabling the hint window that EClipse Editor shows

when I hover over the codes in ECLispe Editor it pops up this yellow hint box for everything that I am on it to show some useful info about it. well it is cool but it is also annoying! is there a way that I can deactivate it as Default setting and then anytime I needed it I hit a hot-key to bring it up...
If you go:
Window->Preferences
In the tree look for "Hovers" under Java->Editor->Hovers
You can uncheck all the ones you do not want, or add keyboard shortcuts to activate a Hover. Not particularly useful, but may help.

Eclipse help box

I am using Eclipse to program Android apps and I love how the little helper box thing comes up when you start to type and suggests things to you.
However, this only happens sporadically and I was wondering if there was a way to keep it visible for longer or, even better, a key combo I could press to bring it up. If I start to type something, it either helps me by suggesting things or doesn't appear.
Try Ctrl+Space. The feature is known as "content assist," "code completion," "auto-complete." In the Visual Studio world, I think it's called "Intellisense."
If you want the suggestions to appear immediately (I prefer this) you can change the delay by going to Window → Preferences → Java → Editor → Content Assist and change the Auto activation delay to 0. In my version of Eclipse (Helios for Java EE), that field is third from the bottom.
An easier way of finding this preference screen is to use the search box in the upper-left-hand corner of the prefs (as before, Window → Preferences), and typing completion. From there you can see all of the different content assist preferences that Eclipse offers. Mine has Java, JavaScript, CSS, HTML, JSP, and XML - most of those because I'm using a fancier version of Eclipse.
By default, when writing Java code, the . (period) key triggers auto-activation of content assist. You can change this setting in the same screen as the auto-activation delay.
I think its Control+Space for Code completion. Try that
Also go easy with the code completion popup delay. Dont set it to 0, i remember a strange behaviour in Eclipse where there was no popup at all.
Ctrl+Space is the shortcut for Content Assist.
Ctrl+1 is the shortcut for Quick Fix.
Ctrl+2 is the shortcut for a menu of Quick Assists. (Ctrl+2, F is the shortcut for Quick Assist - Assign to var/field, and in place of F you can also type L or R for other options.)
To see and/or modify available shortcuts you can go to Window > Preferences > General > Keys.

Faster way (keyboard shortcuts?) to use quick fixes in Eclipse?

I often use the Eclipse feature (Galileo) of suggested error corrections to automatically create code stubs or to refactor things. For example, I would write a method that calls other methods which don't exist yet, then move the mouse over the error message and click on "create method". Or, change this to the class name and choose "add static modifier" from the quick fixes.
I think this is very convenient because it lets me stay in one place in my code and sort of "remotely" wire up what's not currently visible on my screen. What I think is annoying though, is that I have to leave the keyboard, hover my mouse over the error symbol, wait for the tooltip to pop up, and click on the option (doing that, I sometimes move the mouse a little over the edge and the tooltip goes away again - very annoying).
Am I missing a faster method here? I can't seem to find a keyboard shortcut, but then I have overlooked stuff from the huge preference dialog before.
Ctrl+1 : Quick Fix.
(Cmd+1 on Mac)
Just put your cursor on the part you suspect you can perform an action (correction, refactoring, ...) and hit the Quick Fix shortcut. The same popup will be displayed, and you can select the right option with the up and down keys.
That, combined with Ctrl+3 (Quick Access) gives you most of eclipse features at your fingertips ;)
See also:
Eclipse Tip: Shortcut to Quick Fix
My Favorite Eclipse Shortcut: Quick Fix
Eclipse hotkeys: eclipse shortcuts gold mine.
As an additional tip, a specific type of quick fix I use all the time has a dedicated shortcut:
Alt+Shift+J: Add Javadoc comment stub for current method.
After using ctrl+1 like mentioned in the top answer, press ctrl + enter to apply the selected fix all to problems of the same category.
In general, keyboard shortcuts in IDEs (and code tools in general) are coming from a user principle that holds that the more your hands/fingers can remain poised over the keyboard (as in the f-j centered "touch typist" position), the more productive you can become. This is probably why the use of the number keypad is not encouraged, or other keys, less common to the most basic layout keyboard, are not used. Many hold that useful keyboard shortcuts should be easily reachable from this position.
One thing I will say about eclipse keyboard shortcuts is that if you use a popular Windows presentation utility called Zoom-it, you need to turn that off when using eclipse. There are several show-stopper conflicts between the two, such as Ctrl-1 and Ctrl-3.