Change/remove hover delay in Eclipse editor - eclipse

I'm using Eclipse, and have set up my preferences so that editor hovers only appear when I press Ctrl by using the "Combined Hovers Keys Modifier" setting. However, when I Ctrl+Hover an item, I still have to wait for the hover delay.
Is there any way to remove this delay?
I'm using multiple Eclipse distributions, all at least Oxygen or newer. This is also for multiple OSes, including Fedora, Ubuntu, and Windows.
I'm looking for answers that don't tamper with operating system settings. Solutions like the accepted answer for this question about adding delay to tooltips aren't acceptable.

Hovers in Eclipse are implemented by registering an SWT MouseTrackListener on the control (GUI element) that wants to react to being hovered over, and showing the hover when MouseTrackListener.mouseHover() is invoked.
The documentation for MouseTrackListener.mouseHover() says:
Sent when the mouse pointer hovers (that is, stops moving for an
(operating system specified) period of time) over a control.
suggesting that there is no cross-platform way to change the delay.
You could consider filing an SWT issue to request adding an option for customizing the delay.

Related

Eclipse Debugger Loses Focus when Switching Files

When debugging (Juno, SR1 on mac) I prefer using the keyboard keys instead of the mouse to step, step into, step out, go, etc. But these keyboard shortcuts only seem to work when the editor is in focus. The real problem happens when stepping in or out to another file. The editor correctly shows the current line in the new file, but that file is not focused. Consequently, I must grab the mouse and click in that view to re-enable the hotkeys.
This drags my debugging down to a crawl, as I'm constantly having to use the mouse instead of touch-typing. Searches don't find quite this issue. Anyone with work-arounds?
It depends on the Eclipse version. Eclipse 4.2 sucks on Windows and Ubuntu - Due to a bug
https://bugs.eclipse.org/bugs/show_bug.cgi?id=372941.
Maybe you can change the key bindings:
Go to Window->Preferences - General->Keys, search for "step into", etc. And change in the select box: "When:" to "In Windows" (from "Debugging") or experiment with it to get result you want.
Setting it to "In Windows" I could "Step into" from any focused Eclipse component e.g. Package Manager, Console, Breakpoints, Servers, etc. And even when stepping into file.

Move Eclipse's Find/Replace dialog to a view?

I find Eclipse's (Eclipse 3.7, Indigo, running under Mac OS X 10.6.8) Find/Replace floating dialog box to be very annoying. Part of the time it ends up obscuring the search results. Is there any way to have Eclipse move the Find/Replace somewhere else? I'd like it to be a pop-up view, as I often do with the Console, Servers, Outline, and other views. However, if it could be incorporated into the view which it's searching, that would be great, too.
Eclipse's Find / Replace dialog is a dialog, not a view, so you can't drag and drop it to one of the view areas.
Here's a Eclipse search plugin that might work for you. Scroll all the way to the bottom of the page to get the Software Update link.
Worst case, you could write your own Eclipse plug-in that creates a view that does a Find / Replace.
TL;DR
Find/replace cannot be used as a view. Here are two ways to find text without obstructing the search:
Use incremental search (CTRL+J)
Use the quick search plugin (CTRL+SHIFT+L)
Pros and cons
Both approaches behave differently from the traditional find/replace and may require some getting used to.
Approach 1.
It works out of the box, no need to install a plugin, but it (currently) does not support pasting nor searching for the current selection (but there is CTRL+K for the latter). You can use UP and DOWN or repeat CTRL+J or CTRL+SHIFT+J to jump between matches.
Approach 2.
This still opens a dialog, but one which integrates the search results rather than obscuring them. I suggest resizing it to have a good preview size.
The default shortcut shadows the "Show Key Assist" original, but this can be changed. It is an extra install and AFAIK only supports case sensitive searches, but it supports searching for the selection and pasting.
It shows matches across files, starting with the top open editor (if you have more than one visible, e.g. side by side, it sometimes does not start with the one you were last on). You can move between matches with UP and DOWN and hit enter to go back to the editor on the selected match.
NOTE
I suppose on OSX you can replace CTRL with CMD in keyboard shortcuts above to achieve the same, but I could not test it. The shortcuts can be customized in Preferences->General->Keys

How to disable Eclipse's behavior of maximizing editor when double clicking a tab?

I recently updated my Eclipse (now running 20100218-1602), and I've found whenever I click around quickly between tabs on the tab bar, it will sometimes maximize the editor and hide the PHP Explorer to the left. After researching a little, this appears to be a feature of double clicking a tab. So I guess it's my fault, I'm sure I'm clicking around too fast and mistakenly double clicking a tab, but it happens often enough on what I'd consider a normal editing session that I've come to absolutely loathe it, and even after the usual googling due diligence cannot figure out how to turn it off.
From this post someone mentions the Window.AutoHideAll shortcut, however that seems to only be for assigning keyboard shortcuts--this is a mouse click thing. But maybe it's a clue.
I can't find anything relevant under Eclipse -> Preferences -> PHP. I don't think it's specific to PHP because if I switch to the Java perspective, double clicking a tab hides the Package Explorer.
Any suggestions are appreciated, thanks!
You could settle for a simpler solution than some arcane settings or shortcut:
resize your Eclipse main windows a bit smaller
drag the views you do not want to be covered after a "tab double-click" outside the main Eclipse window
there is no 3.
When you double-click, the Editor will cover only the main Eclipse window, while the other views will still be visible just beside that window.

How to turn off the Javadoc hover in Eclipse (or selectively enable it)?

A fellow developer dislikes the Eclipse hovering Javadoc and would like to disable it (one option), or, better yet, only selectively enable it (other option). He's using Eclipse 3.3. Is this possible?
Not sure what you mean by "selectively" enabling it. Based on what?
Directions below are for 3.5, I don't have 3.3 lying around to check but I'm pretty sure same settings were available.
Go to Window - Preferences; select Java -> Editor -> Hovers on left hand side. You'll have to uncheck the Combined Hover option on the right; you can then either uncheck Javadoc option or check it but specify a modifier key for it (in the edit box below). In the latter case javadoc hover would only appear if you hold that key.
I've got to say, though, that the inconvenience of not having Combined Handler makes this really not worth it in my opinion.
You could go to
Preferences / Java / Editor / Hover
and untick the "Combined Hover" option: no more popup.
Then you would have:
Shift+F2: open the external javadoc if javadoc archive or directory has been associated with your project (and if some javadoc has been generated)
Alt+Shift+Q, followed by J: open the javadoc view, with the same content than the popup previously seen on mouse hovering.
In Eclipse 3.6 you can now specify a modifier key to be pressed down for the Combined Hover to be activated. This way, you can have the old behavior without the automatic popups. The automatic popups were driving me crazy, often obscuring something I was trying to read.

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.