Eclipse - go to class/interface via hyperling without mouse - java

the default Eclipse settings is when you are in Java editor and hold Ctrl and go by mouse over a class or interface name, you can click it and go into that class.
Is it possible to do it by keyboard shortcut only, without mouse? Just move cursor to the name and press a shortcut.
I have set it this way for methods (command "Open Implementation" bound to Ctrl+I) but I can't find out how to do it for classes. Thank you!

Move the cursor over the type and hit F3
Side note: Ctrl+Shift+L opens a small window with all shortcuts and descriptions

yes, for sure make the caret on that class and press F3

Related

Why isn't eclipse displaying any information

I am using Eclipse IDE for Java. I need to know, let's say, I am to use the Random class. When I hover onto the Random class, it doesn't display me any information like the "the random class is used to creating random integer", or is this like a buy in Eclipse
Is this how it meant to be? Please help, I am new to programming.
If you're speaking about the popup tooltip that displays information about an item; Go to Window > Preferences > Java > Editor > Hovers.
If you're speaking about the javadoc of a class; Go to Window > show view > javadoc
in javadoc view, right click and open attached javadoc to display the javadoc.
Other way to display detailed information of the methods, class, declaration... when you hover over in Eclipse is to press CTRL while you hover.

Eclipse direct shortcut instead of yellow popup?

How do I remove this middle step of having to press enter after F12 to make the actual navigation? I don't need this yellow popup telling me there's one shortcut for me.
In the second image you can see the problem: I want F12 to immediate open up the definition / declaration of the symbol my cursor is currently at. Need it for Java.
Have you tried to hover over the type/method with your mouse then hold ctrl and left mouse click.
It's a default shortcut in eclipse.
edit: sorry this should have been a comment to your question, not an answer.
The problem was indeed multiple bindings for the same key.

How to view class package type and parameters in IntelliJ?

When hovering your mouse over a Class or variable, how come I don't see any information on the type of the class?
Is this not a feature in IntelliJ?
For example, in vs.net, if I mouse over any variable or class it will popup and tell me what namespace that belongs to etc.
And when I am using a method of a class, it also tells me the different overloads for the method (like types for each parameter, and a list of all the overloads).
This must be a feature in IntelliJ, I just don't know how to get it.
Can someone please clear this up?
Also, how can I tidy up the formatting of a page?
It doesn't work on hover yet, please star/vote the issue.
You need to use keyboard shortcuts for quick documentation pop-up or parameter info pop-up (Ctrl+Q and Ctrl+P with default Windows keymap, F1 and Cmd+P with default OS X 10.5+ keymap).
Code | Reformat Code... is the answer to your second question.
Formatting: Code -> Reformat (shortcut: Ctrl-Alt-L)
Hover doesn't produce the kind of information I'd like either. You can get info with Ctrl-Q ("Quick Help") in Windows or F1 in OS X, which will show where it's from and what it is, with most stuff in the popup window linked up in a reasonable way.
That popup view can also be pinned and/or docked; I often have it docked on the bottom.

How to get eclipse to go to the ONLY implementation of an interface's method?

If I'm in an interface and pointing to a method name, what can I do to quickly go to the ONLY implementation of that method?
Using Eclipse 3.6.
F3 is the typical "go to implementation". For interfaces that go to the interface definition.
Instead use Ctrl + T to see all implementations of the interface definition. You can then easily go to the one you want with the arrow keys and Enter. I believe that the first one is automatically selected so that Ctrl-T + Enter will do what you need.
I just checked this on my Eclipse 3.6 install: Hold control (command on Mac), hover over the method name and select "Open Implementation".
You may assign a keyboard shortcut to this action by using Window > Preferences > General > Keys and searching for "Open Implementation".
In the keymap (General > Keys) search for "open implementation" and map it to whatever you want. I chose Ctrl + Shift + I. Make sure you select "Editing Java Source" in the When box. I tested it, and having the cursor over the method name and pressing Ctrl + Shift + I took me directly to the implementation instead of showing the hierarchy that you get with Ctrl + T.
Also you can see an answer to a nearly identical question for other options:
In eclipse, ctrl-click goes to the declaration of the method I clicked. For interfaces with one implementation, how can I just directly to that implementation?
If someone still need this information nowadays (Eclipse version 2022), to jump into interface method definition starting from an #Override method, now in Eclipse you can see on the left, next to the method signature, a little white triangle. By clicking on that you will jump to the implemented interface method. here an image of the little triangle
Oterwise, if you are on a interface method definition and you need to jump to one of the implementations, you must use CTRL+T shortcut to see the list of available implementations and than click on one of them.

How to quickly navigate between Java class method definitions in a large class without the 'Find' dialog in Eclipse?

I use what I think is a typical layout in Eclipse: my workspace contains the Project Explorer on the left and the Java editor window taking up most of the screen, with the small console window at the foot of this editor pane.
When I open a very long Java class, containing a large number of method definitions, in the editor pane, it can take a long time to move between methods. I use CTRL-F to open the Find dialog and then type in the name of the method if I can remember it.
Is there a better way to navigate between method definitions in a large class in Eclipse?
Ctrl+O will open a dialog with the methods (and variables) list. It supports "advanced" :-) searching so you can just type a few letters of the method's name
Use the Outline View.
I use a layout much like yours but I keep the Outline panel open in it beneath the project/package explorer. This makes it easy to see the project's outline as well as the current editor's outline at a glance.
In addition to the Ctrl+O option for a quick outline, one can type (on a Mac) Cmd-Alt-Q then O to focus the Outline view. Once focus is in the Outline view, you can use the arrow keys or letter keys to navigate through the list of methods.
Cmd-Alt-Q is useful for opening many of the views. In my Eclipse Helios right now, a momentary delay after playing the chord presents a quick list of many different views, many of which have their own hot key.
Finally, you can use the "Next/Previous member" chord to jump to the previous or next method definition in the file. Again in my Helios build, the Next member key is Ctrl-Alt-down . Yours may be different.
To find out what the keystrokes are in your Eclipse build, open the eclipse preferences. Use the searcher to search for 'keys'. Open the configuration for Keys . Then in the keys search bar look for "member". There should be an item for "Next member" with a bound shortcut key/chord. Browsing the list of hotkeys is a great way to improve Eclipse productivity in the long run ;)

Categories